Chatterino
ActionNames.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "HotkeyCategory.hpp"
4 
5 #include <QString>
6 
7 #include <map>
8 
9 namespace chatterino {
10 
11 // ActionDefinition is an action that can be performed with a hotkey
13  // displayName is the value that would be shown to a user when they edit or create a hotkey for an action
14  QString displayName;
15 
16  QString argumentDescription = "";
17 
18  // minCountArguments is the minimum amount of arguments the action accepts
19  // Example action: "Select Tab" in a popup window accepts 1 argument for which tab to select
20  uint8_t minCountArguments = 0;
21 
22  // maxCountArguments is the maximum amount of arguments the action accepts
24 };
25 
26 using ActionDefinitionMap = std::map<QString, ActionDefinition>;
27 
28 inline const std::map<HotkeyCategory, ActionDefinitionMap> actionNames{
30  {
31  {"reject", ActionDefinition{"Confirmable popups: Cancel"}},
32  {"accept", ActionDefinition{"Confirmable popups: Confirm"}},
33  {"delete", ActionDefinition{"Close"}},
34  {"openTab",
36  "Select Tab",
37  "<next, previous, or index of tab to select>",
38  1,
39  }},
40  {"scrollPage",
42  "Scroll",
43  "<up or down>",
44  1,
45  }},
46  {"search", ActionDefinition{"Focus search box"}},
47  {"execModeratorAction",
49  "Usercard: execute moderation action",
50  "<ban, unban or number of the timeout button to use>", 1}},
51  }},
53  {
54  {"changeChannel", ActionDefinition{"Change channel"}},
55  {"clearMessages", ActionDefinition{"Clear messages"}},
56  {"createClip", ActionDefinition{"Create a clip"}},
57  {"delete", ActionDefinition{"Close"}},
58  {"focus",
60  "Focus neighbouring split",
61  "<up, down, left, or right>",
62  1,
63  }},
64  {"openInBrowser", ActionDefinition{"Open channel in browser"}},
65  {"openInCustomPlayer",
66  ActionDefinition{"Open stream in custom player"}},
67  {"openInStreamlink", ActionDefinition{"Open stream in streamlink"}},
68  {"openModView", ActionDefinition{"Open mod view in browser"}},
69  {"openViewerList", ActionDefinition{"Open viewer list"}},
70  {"pickFilters", ActionDefinition{"Pick filters"}},
71  {"reconnect", ActionDefinition{"Reconnect to chat"}},
72  {"reloadEmotes",
74  "Reload emotes",
75  "[channel or subscriber]",
76  0,
77  1,
78  }},
79  {"runCommand",
81  "Run a command",
82  "<name of command>",
83  1,
84  }},
85  {"scrollPage",
87  "Scroll",
88  "<up or down>",
89  1,
90  }},
91  {"scrollToBottom", ActionDefinition{"Scroll to the bottom"}},
92  {"scrollToTop", ActionDefinition{"Scroll to the top"}},
93  {"setChannelNotification",
95  "Set channel live notification",
96  "[on or off. default: toggle]",
97  0,
98  1,
99  }},
100  {"setModerationMode",
102  "Set moderation mode",
103  "[on or off. default: toggle]",
104  0,
105  1,
106  }},
107  {"showSearch", ActionDefinition{"Search current channel"}},
108  {"showGlobalSearch", ActionDefinition{"Search all channels"}},
109  {"startWatching", ActionDefinition{"Start watching"}},
110  {"debug", ActionDefinition{"Show debug popup"}},
111  }},
113  {
114  {"clear", ActionDefinition{"Clear message"}},
115  {"copy",
117  "Copy",
118  "<source of text: split, splitInput or auto>",
119  1,
120  }},
121  {"cursorToStart",
123  "To start of message",
124  "<withSelection or withoutSelection>",
125  1,
126  }},
127  {"cursorToEnd",
129  "To end of message",
130  "<withSelection or withoutSelection>",
131  1,
132  }},
133  {"nextMessage", ActionDefinition{"Choose next sent message"}},
134  {"openEmotesPopup", ActionDefinition{"Open emotes list"}},
135  {"paste", ActionDefinition{"Paste"}},
136  {"previousMessage",
137  ActionDefinition{"Choose previously sent message"}},
138  {"redo", ActionDefinition{"Redo"}},
139  {"selectAll", ActionDefinition{"Select all"}},
140  {"selectWord", ActionDefinition{"Select word"}},
141  {"sendMessage",
143  "Send message",
144  "[keepInput to not clear the text after sending]",
145  0,
146  1,
147  }},
148  {"undo", ActionDefinition{"Undo"}},
149 
150  }},
152  {
153 #ifndef NDEBUG
154  {"addCheerMessage", ActionDefinition{"Debug: Add cheer test message"}},
155  {"addEmoteMessage", ActionDefinition{"Debug: Add emote test message"}},
156  {"addLinkMessage",
157  ActionDefinition{"Debug: Add test message with a link"}},
158  {"addMiscMessage", ActionDefinition{"Debug: Add misc test message"}},
159  {"addRewardMessage",
160  ActionDefinition{"Debug: Add reward test message"}},
161  {"addSubMessage", ActionDefinition{"Debug: Add sub test message"}},
162 #endif
163  {"moveTab",
165  "Move tab",
166  "<next, previous, or new index of tab>",
167  1,
168  }},
169  {"newSplit", ActionDefinition{"Create a new split"}},
170  {"newTab", ActionDefinition{"Create a new tab"}},
171  {"openSettings", ActionDefinition{"Open settings"}},
172  {"openTab",
174  "Select tab",
175  "<last, next, previous, or index of tab to select>",
176  1,
177  }},
178  {"openQuickSwitcher", ActionDefinition{"Open the quick switcher"}},
179  {"popup",
181  "New popup",
182  "<split or window>",
183  1,
184  }},
185  {"quit", ActionDefinition{"Quit Chatterino"}},
186  {"removeTab", ActionDefinition{"Remove current tab"}},
187  {"reopenSplit", ActionDefinition{"Reopen closed split"}},
188  {"setStreamerMode",
190  "Set streamer mode",
191  "[on, off, toggle, or auto. default: toggle]",
192  0,
193  1,
194  }},
195  {"toggleLocalR9K", ActionDefinition{"Toggle local R9K"}},
196  {"zoom",
198  "Zoom in/out",
199  "<in, out, or reset>",
200  1,
201  }},
202  {"setTabVisibility",
204  "Set tab visibility",
205  "[on, off, or toggle. default: toggle]",
206  0,
207  1,
208  }}}},
209 };
210 
211 } // namespace chatterino
const std::map< HotkeyCategory, ActionDefinitionMap > actionNames
Definition: ActionNames.hpp:28
uint8_t maxCountArguments
Definition: ActionNames.hpp:23
QString argumentDescription
Definition: ActionNames.hpp:16
QString displayName
Definition: ActionNames.hpp:14
Definition: Application.cpp:48
Definition: ActionNames.hpp:12
std::map< QString, ActionDefinition > ActionDefinitionMap
Definition: ActionNames.hpp:26
uint8_t minCountArguments
Definition: ActionNames.hpp:20