Deluge Firmware 1.3.0
Build date: 2025.04.16
Loading...
Searching...
No Matches
rename_ui.h
1/*
2 * Copyright © 2022-2023 Synthstrom Audible Limited
3 *
4 * This file is part of The Synthstrom Audible Deluge Firmware.
5 *
6 * The Synthstrom Audible Deluge Firmware is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU General Public License as published by the Free Software Foundation,
8 * either version 3 of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * See the GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along with this program.
15 * If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#pragma once
19
20#include "gui/ui/qwerty_ui.h"
21
22class RenameUI : public QwertyUI {
23public:
24 RenameUI(const char* title_);
25 bool opened();
26 void displayText(bool blinkImmediately = false) override;
27 void renderOLED(deluge::hid::display::oled_canvas::Canvas& canvas) override;
28 bool getGreyoutColsAndRows(uint32_t* cols, uint32_t* rows) override;
29 bool exitUI() override;
30 ActionResult buttonAction(deluge::hid::Button b, bool on, bool inCardRoutine) override;
31 ActionResult padAction(int32_t x, int32_t y, int32_t velocity) override;
32 ActionResult verticalEncoderAction(int32_t offset, bool inCardRoutine) override;
33 UIType getUIType() override { return UIType::RENAME; }
34
35protected:
36 void enterKeyPress() override;
37 virtual bool trySetName(String*) = 0;
38 virtual String getName() const = 0;
39 virtual bool canRename() const { return true; }
40 virtual bool allowEmpty() const { return true; }
41};
bool exitUI() override
returns whether a UI exited
Definition rename_ui.cpp:95
Definition d_string.h:46