/* This file is part of the KDE libraries SPDX-FileCopyrightText: 1997 Stefan Taferner SPDX-FileCopyrightText: 2000 Nicolas Hadacek SPDX-FileCopyrightText: 2001, 2002 Ellis Whitehead SPDX-License-Identifier: LGPL-2.0-or-later */ #include "kstandardshortcut.h" #include "kstandardshortcutwatcher.h" #include "kconfig.h" #include "kconfigwatcher.h" #include "ksharedconfig.h" #include #include #include #include namespace KStandardShortcut { struct KStandardShortcutInfo { //! The standard shortcut id. @see StandardShortcut StandardShortcut id; /** * Unique name for the given accel. The name is used to save the user * settings. It's not representable. Use description for that. * @warning NEVER EVER CHANGE IT OR TRANSLATE IT! */ const char *name; //! Localized label for user-visible display, including translation context. struct { const char *text; const char *context; } description; //! The keys for this shortcut int cutDefault, cutDefault2; //! A shortcut that is created with @a cutDefault and @cutDefault2 QList cut; //! If this struct is initialized. If not initialized @cut is not valid bool isInitialized; // Category of this Shortcut Category category; }; #define CTRL(x) QKeyCombination(Qt::CTRL | Qt::Key_##x).toCombined() #define SHIFT(x) QKeyCombination(Qt::SHIFT | Qt::Key_##x).toCombined() #define CTRLALT(x) QKeyCombination(Qt::CTRL | Qt::ALT | Qt::Key_##x).toCombined() #define CTRLSHIFT(x) QKeyCombination(Qt::CTRL | Qt::SHIFT | Qt::Key_##x).toCombined() #define ALT(x) QKeyCombination(Qt::ALT | Qt::Key_##x).toCombined() #define ALTSHIFT(x) QKeyCombination(Qt::ALT | Qt::SHIFT | Qt::Key_##x).toCombined() /** Array of predefined KStandardShortcutInfo objects, which cover all the "standard" accelerators. Each enum value from StandardShortcut should appear in this table. */ // STUFF WILL BREAK IF YOU DON'T READ THIS!!! // Read the comments of the big enum in kstandardshortcut.h before you change anything! static KStandardShortcutInfo g_infoStandardShortcut[] = { // Group File, {AccelNone, nullptr, {nullptr, nullptr}, 0, 0, QList(), false, Category::InvalidCategory}, {Open, "Open", QT_TRANSLATE_NOOP3("KStandardShortcut", "Open", "@action"), CTRL(O), 0, QList(), false, Category::File}, {New, "New", QT_TRANSLATE_NOOP3("KStandardShortcut", "New", "@action"), CTRL(N), 0, QList(), false, Category::File}, {Close, "Close", QT_TRANSLATE_NOOP3("KStandardShortcut", "Close", "@action"), CTRL(W), CTRL(Escape), QList(), false, Category::File}, {Save, "Save", QT_TRANSLATE_NOOP3("KStandardShortcut", "Save", "@action"), CTRL(S), 0, QList(), false, Category::File}, {Print, "Print", QT_TRANSLATE_NOOP3("KStandardShortcut", "Print", "@action"), CTRL(P), 0, QList(), false, Category::File}, {Quit, "Quit", QT_TRANSLATE_NOOP3("KStandardShortcut", "Quit", "@action"), CTRL(Q), 0, QList(), false, Category::Navigation}, // Group Edit {Undo, "Undo", QT_TRANSLATE_NOOP3("KStandardShortcut", "Undo", "@action"), CTRL(Z), 0, QList(), false, Category::Edit}, {Redo, "Redo", QT_TRANSLATE_NOOP3("KStandardShortcut", "Redo", "@action"), CTRLSHIFT(Z), 0, QList(), false, Category::Edit}, // Both "Cut" and "Delete" use Shift+Delete, but this is okay; see // https://commits.kde.org/kxmlgui/8eabbf6725386e716b7536c71a9181dfe5d959f0 {Cut, "Cut", QT_TRANSLATE_NOOP3("KStandardShortcut", "Cut", "@action"), CTRL(X), SHIFT(Delete), QList(), false, Category::Edit}, {Copy, "Copy", QT_TRANSLATE_NOOP3("KStandardShortcut", "Copy", "@action"), CTRL(C), CTRL(Insert), QList(), false, Category::Edit}, {Paste, "Paste", QT_TRANSLATE_NOOP3("KStandardShortcut", "Paste", "@action"), CTRL(V), SHIFT(Insert), QList(), false, Category::Edit}, {PasteSelection, "Paste Selection", QT_TRANSLATE_NOOP3("KStandardShortcut", "Paste Selection", "@action"), CTRLSHIFT(Insert), 0, QList(), false, Category::Edit}, {SelectAll, "SelectAll", QT_TRANSLATE_NOOP3("KStandardShortcut", "Select All", "@action"), CTRL(A), 0, QList(), false, Category::Edit}, {Deselect, "Deselect", QT_TRANSLATE_NOOP3("KStandardShortcut", "Deselect", "@action"), CTRLSHIFT(A), 0, QList(), false, Category::Edit}, {DeleteWordBack, "DeleteWordBack", QT_TRANSLATE_NOOP3("KStandardShortcut", "Delete Word Backwards", "@action"), CTRL(Backspace), 0, QList(), false, Category::Edit}, {DeleteWordForward, "DeleteWordForward", QT_TRANSLATE_NOOP3("KStandardShortcut", "Delete Word Forward", "@action"), CTRL(Delete), 0, QList(), false, Category::Edit}, {Find, "Find", QT_TRANSLATE_NOOP3("KStandardShortcut", "Find", "@action"), CTRL(F), 0, QList(), false, Category::Edit}, {FindNext, "FindNext", QT_TRANSLATE_NOOP3("KStandardShortcut", "Find Next", "@action"), Qt::Key_F3, 0, QList(), false, Category::Edit}, {FindPrev, "FindPrev", QT_TRANSLATE_NOOP3("KStandardShortcut", "Find Prev", "@action"), SHIFT(F3), 0, QList(), false, Category::Edit}, {Replace, "Replace", QT_TRANSLATE_NOOP3("KStandardShortcut", "Replace", "@action"), CTRL(R), 0, QList(), false, Category::Edit}, // Group Navigation {Home, "Home", QT_TRANSLATE_NOOP3("KStandardShortcut", "Home", "@action Go to main page"), ALT(Home), Qt::Key_HomePage, QList(), false, Category::Navigation}, {Begin, "Begin", QT_TRANSLATE_NOOP3("KStandardShortcut", "Begin", "@action Beginning of document"), CTRL(Home), 0, QList(), false, Category::Navigation}, {End, "End", QT_TRANSLATE_NOOP3("KStandardShortcut", "End", "@action End of document"), CTRL(End), 0, QList(), false, Category::Navigation}, {Prior, "Prior", QT_TRANSLATE_NOOP3("KStandardShortcut", "Prior", "@action"), Qt::Key_PageUp, 0, QList(), false, Category::Navigation}, {Next, "Next", QT_TRANSLATE_NOOP3("KStandardShortcut", "Next", "@action Opposite to Prior"), Qt::Key_PageDown, 0, QList(), false, Category::Navigation}, {Up, "Up", QT_TRANSLATE_NOOP3("KStandardShortcut", "Up", "@action"), ALT(Up), 0, QList(), false, Category::Navigation}, {Back, "Back", QT_TRANSLATE_NOOP3("KStandardShortcut", "Back", "@action"), ALT(Left), Qt::Key_Back, QList(), false, Category::Navigation}, {Forward, "Forward", QT_TRANSLATE_NOOP3("KStandardShortcut", "Forward", "@action"), ALT(Right), Qt::Key_Forward, QList(), false, Category::Navigation}, {Reload, "Reload", QT_TRANSLATE_NOOP3("KStandardShortcut", "Reload", "@action"), Qt::Key_F5, Qt::Key_Refresh, QList(), false, Category::Navigation}, {BeginningOfLine, "BeginningOfLine", QT_TRANSLATE_NOOP3("KStandardShortcut", "Beginning of Line", "@action"), Qt::Key_Home, 0, QList(), false, Category::Navigation}, {EndOfLine, "EndOfLine", QT_TRANSLATE_NOOP3("KStandardShortcut", "End of Line", "@action"), Qt::Key_End, 0, QList(), false, Category::Navigation}, {GotoLine, "GotoLine", QT_TRANSLATE_NOOP3("KStandardShortcut", "Go to Line", "@action"), CTRL(G), 0, QList(), false, Category::Navigation}, {BackwardWord, "BackwardWord", QT_TRANSLATE_NOOP3("KStandardShortcut", "Backward Word", "@action"), CTRL(Left), 0, QList(), false, Category::Navigation}, {ForwardWord, "ForwardWord", QT_TRANSLATE_NOOP3("KStandardShortcut", "Forward Word", "@action"), CTRL(Right), 0, QList(), false, Category::Navigation}, {AddBookmark, "AddBookmark", QT_TRANSLATE_NOOP3("KStandardShortcut", "Add Bookmark", "@action"), CTRL(B), 0, QList(), false, Category::Navigation}, {ZoomIn, "ZoomIn", QT_TRANSLATE_NOOP3("KStandardShortcut", "Zoom In", "@action"), CTRL(Plus), CTRL(Equal), QList(), false, Category::View}, {ZoomOut, "ZoomOut", QT_TRANSLATE_NOOP3("KStandardShortcut", "Zoom Out", "@action"), CTRL(Minus), 0, QList(), false, Category::View}, {FullScreen, "FullScreen", QT_TRANSLATE_NOOP3("KStandardShortcut", "Full Screen Mode", "@action"), CTRLSHIFT(F), 0, QList(), false, Category::View}, {ShowMenubar, "ShowMenubar", QT_TRANSLATE_NOOP3("KStandardShortcut", "Show Menu Bar", "@action"), CTRL(M), 0, QList(), false, Category::View}, {TabNext, "Activate Next Tab", QT_TRANSLATE_NOOP3("KStandardShortcut", "Activate Next Tab", "@action"), CTRL(PageDown), CTRL(BracketRight), QList(), false, Category::Navigation}, {TabPrev, "Activate Previous Tab", QT_TRANSLATE_NOOP3("KStandardShortcut", "Activate Previous Tab", "@action"), CTRL(PageUp), CTRL(BracketLeft), QList(), false, Category::Navigation}, // Group Help {Help, "Help", QT_TRANSLATE_NOOP3("KStandardShortcut", "Help", "@action"), Qt::Key_F1, 0, QList(), false, Category::Help}, {WhatsThis, "WhatsThis", QT_TRANSLATE_NOOP3("KStandardShortcut", "What's This", "@action"), SHIFT(F1), 0, QList(), false, Category::Help}, // Group TextCompletion {TextCompletion, "TextCompletion", QT_TRANSLATE_NOOP3("KStandardShortcut", "Text Completion", "@action"), CTRL(E), 0, QList(), false, Category::Edit}, {PrevCompletion, "PrevCompletion", QT_TRANSLATE_NOOP3("KStandardShortcut", "Previous Completion Match", "@action"), CTRL(Up), 0, QList(), false, Category::Edit}, {NextCompletion, "NextCompletion", QT_TRANSLATE_NOOP3("KStandardShortcut", "Next Completion Match", "@action"), CTRL(Down), 0, QList(), false, Category::Edit}, {SubstringCompletion, "SubstringCompletion", QT_TRANSLATE_NOOP3("KStandardShortcut", "Substring Completion", "@action"), CTRL(T), 0, QList(), false, Category::Edit}, {RotateUp, "RotateUp", QT_TRANSLATE_NOOP3("KStandardShortcut", "Previous Item in List", "@action"), Qt::Key_Up, 0, QList(), false, Category::Navigation}, {RotateDown, "RotateDown", QT_TRANSLATE_NOOP3("KStandardShortcut", "Next Item in List", "@action"), Qt::Key_Down, 0, QList(), false, Category::Navigation}, {OpenRecent, "OpenRecent", QT_TRANSLATE_NOOP3("KStandardShortcut", "Open Recent", "@action"), 0, 0, QList(), false, Category::File}, {SaveAs, "SaveAs", QT_TRANSLATE_NOOP3("KStandardShortcut", "Save As", "@action"), CTRLSHIFT(S), 0, QList(), false, Category::File}, {Revert, "Revert", QT_TRANSLATE_NOOP3("KStandardShortcut", "Revert", "@action"), 0, 0, QList(), false, Category::Edit}, {PrintPreview, "PrintPreview", QT_TRANSLATE_NOOP3("KStandardShortcut", "Print Preview", "@action"), 0, 0, QList(), false, Category::File}, {Mail, "Mail", QT_TRANSLATE_NOOP3("KStandardShortcut", "Mail", "@action"), 0, 0, QList(), false, Category::Help}, {Clear, "Clear", QT_TRANSLATE_NOOP3("KStandardShortcut", "Clear", "@action"), 0, 0, QList(), false, Category::Edit}, {ActualSize, "ActualSize", QT_TRANSLATE_NOOP3("KStandardShortcut", "Zoom to Actual Size", "@action"), CTRL(0), 0, QList(), false, Category::View}, {FitToPage, "FitToPage", QT_TRANSLATE_NOOP3("KStandardShortcut", "Fit To Page", "@action"), 0, 0, QList(), false, Category::View}, {FitToWidth, "FitToWidth", QT_TRANSLATE_NOOP3("KStandardShortcut", "Fit To Width", "@action"), 0, 0, QList(), false, Category::View}, {FitToHeight, "FitToHeight", QT_TRANSLATE_NOOP3("KStandardShortcut", "Fit To Height", "@action"), 0, 0, QList(), false, Category::View}, {Zoom, "Zoom", QT_TRANSLATE_NOOP3("KStandardShortcut", "Zoom", "@action"), 0, 0, QList(), false, Category::View}, {Goto, "Goto", QT_TRANSLATE_NOOP3("KStandardShortcut", "Goto", "@action"), 0, 0, QList(), false, Category::Navigation}, {GotoPage, "GotoPage", QT_TRANSLATE_NOOP3("KStandardShortcut", "Goto Page", "@action"), 0, 0, QList(), false, Category::Navigation}, {DocumentBack, "DocumentBack", QT_TRANSLATE_NOOP3("KStandardShortcut", "Document Back", "@action"), ALTSHIFT(Left), 0, QList(), false, Category::Navigation}, {DocumentForward, "DocumentForward", QT_TRANSLATE_NOOP3("KStandardShortcut", "Document Forward", "@action"), ALTSHIFT(Right), 0, QList(), false, Category::Navigation}, {EditBookmarks, "EditBookmarks", QT_TRANSLATE_NOOP3("KStandardShortcut", "Edit Bookmarks", "@action"), 0, 0, QList(), false, Category::Navigation}, {Spelling, "Spelling", QT_TRANSLATE_NOOP3("KStandardShortcut", "Spelling", "@action"), 0, 0, QList(), false, Category::Edit}, {ShowToolbar, "ShowToolbar", QT_TRANSLATE_NOOP3("KStandardShortcut", "Show Toolbar", "@action"), 0, 0, QList(), false, Category::View}, {ShowStatusbar, "ShowStatusbar", QT_TRANSLATE_NOOP3("KStandardShortcut", "Show Statusbar", "@action"), 0, 0, QList(), false, Category::View}, {KeyBindings, "KeyBindings", QT_TRANSLATE_NOOP3("KStandardShortcut", "Key Bindings", "@action"), CTRLALT(Comma), 0, QList(), false, Category::Settings}, {Preferences, "Preferences", QT_TRANSLATE_NOOP3("KStandardShortcut", "Configure Application", "@action"), CTRLSHIFT(Comma), 0, QList(), false, Category::Settings}, {ConfigureToolbars, "ConfigureToolbars", QT_TRANSLATE_NOOP3("KStandardShortcut", "Configure Toolbars", "@action"), 0, 0, QList(), false, Category::Settings}, {ConfigureNotifications, "ConfigureNotifications", QT_TRANSLATE_NOOP3("KStandardShortcut", "Configure Notifications", "@action"), 0, 0, QList(), false, Category::Settings}, {ReportBug, "ReportBug", QT_TRANSLATE_NOOP3("KStandardShortcut", "Report Bug", "@action"), 0, 0, QList(), false, Category::Help}, {SwitchApplicationLanguage, "SwitchApplicationLanguage", QT_TRANSLATE_NOOP3("KStandardShortcut", "Configure Languageā€¦", "@action"), 0, 0, QList(), false, Category::Settings}, {AboutApp, "AboutApp", QT_TRANSLATE_NOOP3("KStandardShortcut", "About Application", "@action"), 0, 0, QList(), false, Category::Help}, {AboutKDE, "AboutKDE", QT_TRANSLATE_NOOP3("KStandardShortcut", "About KDE", "@action"), 0, 0, QList(), false, Category::Help}, // Both "Cut" and "Delete" use Shift+Delete, but this is okay; see // https://commits.kde.org/kxmlgui/8eabbf6725386e716b7536c71a9181dfe5d959f0 {DeleteFile, "DeleteFile", QT_TRANSLATE_NOOP3("KStandardShortcut", "Delete", "@action"), SHIFT(Delete), 0, QList(), false, Category::File}, {RenameFile, "RenameFile", QT_TRANSLATE_NOOP3("KStandardShortcut", "Rename", "@action"), Qt::Key_F2, 0, QList(), false, Category::File}, {MoveToTrash, "MoveToTrash", QT_TRANSLATE_NOOP3("KStandardShortcut", "Move to Trash", "@action"), Qt::Key_Delete, 0, QList(), false, Category::File}, {Donate, "Donate", QT_TRANSLATE_NOOP3("KStandardShortcut", "Donate", "@action"), 0, 0, QList(), false, Category::Help}, {ShowHideHiddenFiles, "ShowHideHiddenFiles", QT_TRANSLATE_NOOP3("KStandardShortcut", "Show/Hide Hidden Files", "@action"), CTRL(H), ALT(Period), QList(), false, Category::View}, {CreateFolder, "CreateFolder", QT_TRANSLATE_NOOP3("KStandardShortcut", "Create Folder", "@action"), CTRLSHIFT(N), 0, QList(), false, Category::File}, {OpenMainMenu, "OpenMainMenu", QT_TRANSLATE_NOOP3("KStandardShortcut", "Open Main Menu", "@action referring to the menu bar or a hamburger menu"), Qt::Key_F10, 0, QList(), false, Category::View}, {OpenContextMenu, "OpenContextMenu", QT_TRANSLATE_NOOP3("KStandardShortcut", "Open Context Menu", "@action"), Qt::Key_Menu, SHIFT(F10), QList(), false, Category::View}, // dummy entry to catch simple off-by-one errors. Insert new entries before this line. {AccelNone, nullptr, {nullptr, nullptr}, 0, 0, QList(), false, Category::InvalidCategory}}; /** Search for the KStandardShortcutInfo object associated with the given @p id. Return a dummy entry with no name and an empty shortcut if @p id is invalid. */ static KStandardShortcutInfo *guardedStandardShortcutInfo(StandardShortcut id) { if (id >= static_cast(sizeof(g_infoStandardShortcut) / sizeof(KStandardShortcutInfo)) || id < 0) { qWarning() << "KStandardShortcut: id not found!"; return &g_infoStandardShortcut[AccelNone]; } else { return &g_infoStandardShortcut[id]; } } // Sanitize the list for duplicates. For some reason some // people have kdeglobals entries like // Close=Ctrl+W; Ctrl+Esc; Ctrl+W; Ctrl+Esc; // having the same shortcut more than once in the shortcut // declaration is clearly bogus so fix it static void sanitizeShortcutList(QList *list) { for (int i = 0; i < list->size(); ++i) { const QKeySequence &ks = list->at(i); int other = list->indexOf(ks, i + 1); while (other != -1) { list->removeAt(other); other = list->indexOf(ks, other); } } } /** Initialize the accelerator @p id by checking if it is overridden in the configuration file (and if it isn't, use the default). On X11, if QApplication was initialized with GUI disabled, the default will always be used. */ void initialize(StandardShortcut id) { KStandardShortcutInfo *info = guardedStandardShortcutInfo(id); // All three are needed. if (info->id != AccelNone) { Q_ASSERT(info->description.text); Q_ASSERT(info->description.context); Q_ASSERT(info->name); } KConfigGroup cg(KSharedConfig::openConfig(), QStringLiteral("Shortcuts")); if (cg.hasKey(info->name)) { QString s = cg.readEntry(info->name); if (s != QLatin1String("none")) { info->cut = QKeySequence::listFromString(s); sanitizeShortcutList(&info->cut); } else { info->cut = QList(); } } else { info->cut = hardcodedDefaultShortcut(id); } info->isInitialized = true; } void saveShortcut(StandardShortcut id, const QList &newShortcut) { KStandardShortcutInfo *info = guardedStandardShortcutInfo(id); // If the action has no standard shortcut associated there is nothing to // save if (info->id == AccelNone) { return; } KConfigGroup cg(KSharedConfig::openConfig(), QStringLiteral("Shortcuts")); info->cut = newShortcut; bool sameAsDefault = (newShortcut == hardcodedDefaultShortcut(id)); if (sameAsDefault) { // If the shortcut is the equal to the hardcoded one we remove it from // kdeglobal if necessary and return. if (cg.hasKey(info->name)) { cg.deleteEntry(info->name, KConfig::Global | KConfig::Persistent | KConfig::Notify); cg.sync(); } return; } // Write the changed shortcut to kdeglobals sanitizeShortcutList(&info->cut); cg.writeEntry(info->name, QKeySequence::listToString(info->cut), KConfig::Global | KConfig::Persistent | KConfig::Notify); cg.sync(); } QString name(StandardShortcut id) { return QString::fromLatin1(guardedStandardShortcutInfo(id)->name); } QString label(StandardShortcut id) { KStandardShortcutInfo *info = guardedStandardShortcutInfo(id); return QCoreApplication::translate("KStandardShortcut", info->description.text, info->description.context); } // TODO: Add psWhatsThis entry to KStandardShortcutInfo QString whatsThis(StandardShortcut /*id*/) { // KStandardShortcutInfo* info = guardedStandardShortcutInfo( id ); // if( info && info->whatsThis ) // return i18n(info->whatsThis); // else return QString(); } const QList &shortcut(StandardShortcut id) { KStandardShortcutInfo *info = guardedStandardShortcutInfo(id); if (!info->isInitialized) { initialize(id); } return info->cut; } StandardShortcut find(const QKeySequence &seq) { if (!seq.isEmpty()) { for (const KStandardShortcutInfo &shortcutInfo : g_infoStandardShortcut) { const StandardShortcut id = shortcutInfo.id; if (id != AccelNone) { if (!shortcutInfo.isInitialized) { initialize(id); } if (shortcutInfo.cut.contains(seq)) { return id; } } } } return AccelNone; } StandardShortcut findByName(const QString &name) { for (const KStandardShortcutInfo &shortcutInfo : g_infoStandardShortcut) { if (QLatin1StringView(shortcutInfo.name) == name) { return shortcutInfo.id; } } return AccelNone; } QList hardcodedDefaultShortcut(StandardShortcut id) { QList cut; KStandardShortcutInfo *info = guardedStandardShortcutInfo(id); if (info->cutDefault != 0) { cut << info->cutDefault; } if (info->cutDefault2 != 0) { if (cut.isEmpty()) { cut << QKeySequence(); } cut << info->cutDefault2; } return cut; } Category category(StandardShortcut id) { return guardedStandardShortcutInfo(id)->category; } const QList &open() { return shortcut(Open); } const QList &openNew() { return shortcut(New); } const QList &close() { return shortcut(Close); } const QList &save() { return shortcut(Save); } const QList &print() { return shortcut(Print); } const QList &quit() { return shortcut(Quit); } const QList &cut() { return shortcut(Cut); } const QList ©() { return shortcut(Copy); } const QList &paste() { return shortcut(Paste); } const QList &pasteSelection() { return shortcut(PasteSelection); } const QList &deleteWordBack() { return shortcut(DeleteWordBack); } const QList &deleteWordForward() { return shortcut(DeleteWordForward); } const QList &undo() { return shortcut(Undo); } const QList &redo() { return shortcut(Redo); } const QList &find() { return shortcut(Find); } const QList &findNext() { return shortcut(FindNext); } const QList &findPrev() { return shortcut(FindPrev); } const QList &replace() { return shortcut(Replace); } const QList &home() { return shortcut(Home); } const QList &begin() { return shortcut(Begin); } const QList &end() { return shortcut(End); } const QList &beginningOfLine() { return shortcut(BeginningOfLine); } const QList &endOfLine() { return shortcut(EndOfLine); } const QList &prior() { return shortcut(Prior); } const QList &next() { return shortcut(Next); } const QList &backwardWord() { return shortcut(BackwardWord); } const QList &forwardWord() { return shortcut(ForwardWord); } const QList &gotoLine() { return shortcut(GotoLine); } const QList &addBookmark() { return shortcut(AddBookmark); } const QList &tabNext() { return shortcut(TabNext); } const QList &tabPrev() { return shortcut(TabPrev); } const QList &fullScreen() { return shortcut(FullScreen); } const QList &zoomIn() { return shortcut(ZoomIn); } const QList &zoomOut() { return shortcut(ZoomOut); } const QList &help() { return shortcut(Help); } const QList &completion() { return shortcut(TextCompletion); } const QList &prevCompletion() { return shortcut(PrevCompletion); } const QList &nextCompletion() { return shortcut(NextCompletion); } const QList &rotateUp() { return shortcut(RotateUp); } const QList &rotateDown() { return shortcut(RotateDown); } const QList &substringCompletion() { return shortcut(SubstringCompletion); } const QList &whatsThis() { return shortcut(WhatsThis); } const QList &reload() { return shortcut(Reload); } const QList &selectAll() { return shortcut(SelectAll); } const QList &up() { return shortcut(Up); } const QList &back() { return shortcut(Back); } const QList &forward() { return shortcut(Forward); } const QList &showMenubar() { return shortcut(ShowMenubar); } const QList &deleteFile() { return shortcut(DeleteFile); } const QList &renameFile() { return shortcut(RenameFile); } const QList &createFolder() { return shortcut(CreateFolder); } const QList &moveToTrash() { return shortcut(MoveToTrash); } const QList &preferences() { return shortcut(Preferences); } const QList &showHideHiddenFiles() { return shortcut(ShowHideHiddenFiles); } const QList &openMainMenu() { return shortcut(OpenMainMenu); } const QList &openContextMenu() { return shortcut(OpenContextMenu); } }