Line data Source code
1 : /*
2 : * SPDX-License-Identifier: GPL-3.0-only
3 : * MuseScore-CLA-applies
4 : *
5 : * MuseScore Studio
6 : * Music Composition & Notation
7 : *
8 : * Copyright (C) 2026 MuseScore Limited and others
9 : *
10 : * This program is free software: you can redistribute it and/or modify
11 : * it under the terms of the GNU General Public License version 3 as
12 : * published by the Free Software Foundation.
13 : *
14 : * This program is distributed in the hope that it will be useful,
15 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 : * GNU General Public License for more details.
18 : *
19 : * You should have received a copy of the GNU General Public License
20 : * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 : */
22 : #include "navigationcommandsregister.h"
23 :
24 : #include "../navigationcommands.h"
25 :
26 : using namespace muse;
27 : using namespace muse::rcommand;
28 : using namespace muse::ui;
29 :
30 : static const std::vector<CommandInfo> s_commandInfos = {
31 : CommandInfo{
32 : ESCAPE_COMMAND,
33 : TranslatableString("navigation", "Escape"),
34 : TranslatableString("navigation", "Navigate escape"),
35 : InputSchema(),
36 : Decoration(),
37 : Availability::All
38 : },
39 : CommandInfo{
40 : NEXT_SECTION_COMMAND,
41 : TranslatableString("navigation", "Next section"),
42 : TranslatableString("navigation", "Navigate next section"),
43 : InputSchema(),
44 : Decoration(),
45 : Availability::All
46 : },
47 : CommandInfo{
48 : PREV_SECTION_COMMAND,
49 : TranslatableString("navigation", "Previous section"),
50 : TranslatableString("navigation", "Navigate previous section"),
51 : InputSchema(),
52 : Decoration(),
53 : Availability::All
54 : },
55 : CommandInfo{
56 : NEXT_PANEL_COMMAND,
57 : TranslatableString("navigation", "Next panel"),
58 : TranslatableString("navigation", "Navigate next panel"),
59 : InputSchema(),
60 : Decoration(),
61 : Availability::All
62 : },
63 : CommandInfo{
64 : PREV_PANEL_COMMAND,
65 : TranslatableString("navigation", "Previous panel"),
66 : TranslatableString("navigation", "Navigate previous panel"),
67 : InputSchema(),
68 : Decoration(),
69 : Availability::All
70 : },
71 : CommandInfo{
72 : NEXT_TAB_COMMAND,
73 : TranslatableString("navigation", "Next tab"),
74 : TranslatableString("navigation", "Navigate next tab"),
75 : InputSchema(),
76 : Decoration(),
77 : Availability::All
78 : },
79 : CommandInfo{
80 : PREV_TAB_COMMAND,
81 : TranslatableString("navigation", "Previous tab"),
82 : TranslatableString("navigation", "Navigate previous tab"),
83 : InputSchema(),
84 : Decoration(),
85 : Availability::All
86 : },
87 : CommandInfo{
88 : RIGHT_COMMAND,
89 : TranslatableString("navigation", "Right"),
90 : TranslatableString("navigation", "Navigate right"),
91 : InputSchema(),
92 : Decoration(),
93 : Availability::All
94 : },
95 : CommandInfo{
96 : LEFT_COMMAND,
97 : TranslatableString("navigation", "Left"),
98 : TranslatableString("navigation", "Navigate left"),
99 : InputSchema(),
100 : Decoration(),
101 : Availability::All
102 : },
103 : CommandInfo{
104 : UP_COMMAND,
105 : TranslatableString("navigation", "Up"),
106 : TranslatableString("navigation", "Navigate up"),
107 : InputSchema(),
108 : Decoration(),
109 : Availability::All
110 : },
111 : CommandInfo{
112 : DOWN_COMMAND,
113 : TranslatableString("navigation", "Down"),
114 : TranslatableString("navigation", "Navigate down"),
115 : InputSchema(),
116 : Decoration(),
117 : Availability::All
118 : },
119 : CommandInfo{
120 : FIRST_CONTROL_COMMAND,
121 : TranslatableString("navigation", "First control"),
122 : TranslatableString("navigation", "Navigate first control"),
123 : InputSchema(),
124 : Decoration(),
125 : Availability::All
126 : },
127 : CommandInfo{
128 : LAST_CONTROL_COMMAND,
129 : TranslatableString("navigation", "Last control"),
130 : TranslatableString("navigation", "Navigate last control"),
131 : InputSchema(),
132 : Decoration(),
133 : Availability::All
134 : },
135 : CommandInfo{
136 : NEXTROW_CONTROL_COMMAND,
137 : TranslatableString("navigation", "Next row control"),
138 : TranslatableString("navigation", "Navigate next row control"),
139 : InputSchema(),
140 : Decoration(),
141 : Availability::All
142 : },
143 : CommandInfo{
144 : PREVROW_CONTROL_COMMAND,
145 : TranslatableString("navigation", "Previous row control"),
146 : TranslatableString("navigation", "Navigate previous row control"),
147 : InputSchema(),
148 : Decoration(),
149 : Availability::All
150 : },
151 : CommandInfo{
152 : TRIGGER_CONTROL_COMMAND,
153 : TranslatableString("navigation", "Trigger control"),
154 : TranslatableString("navigation", "Navigate trigger control"),
155 : InputSchema(),
156 : Decoration(),
157 : Availability::All
158 : }
159 : };
160 :
161 0 : std::string NavigationCommandsRegister::moduleName() const
162 : {
163 0 : return "navigation";
164 : }
165 :
166 0 : const std::vector<muse::rcommand::Command>& NavigationCommandsRegister::commandList() const
167 : {
168 0 : static std::vector<muse::rcommand::Command> commands;
169 0 : if (commands.empty()) {
170 0 : commands.reserve(s_commandInfos.size());
171 0 : for (const auto& info : s_commandInfos) {
172 0 : commands.push_back(info.command);
173 : }
174 : }
175 0 : return commands;
176 : }
177 :
178 0 : const std::vector<CommandInfo>& NavigationCommandsRegister::commandInfoList() const
179 : {
180 0 : return s_commandInfos;
181 : }
|