File indexing completed on 2024-04-14 03:57:11

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 2008 Alexander Dymo <adymo@kdevelop.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef KSHORTCUTSCHEMESHELPER_P_H
0009 #define KSHORTCUTSCHEMESHELPER_P_H
0010 
0011 #include <QString>
0012 
0013 class KActionCollection;
0014 class KXMLGUIClient;
0015 
0016 class KShortcutSchemesHelper
0017 {
0018 public:
0019     /**
0020      * Saves actions from these collections to the shortcut scheme file.
0021      *
0022      * This doesn't save anything for action collections without a parent xmlgui client.
0023      *
0024      *  @return true if the shortcut scheme was successfully saved.
0025      */
0026     static bool saveShortcutScheme(const QList<KActionCollection *> &collections, const QString &schemeName);
0027 
0028     /**
0029      * @return the current shortcut scheme name for the application.
0030      */
0031     static QString currentShortcutSchemeName();
0032 
0033     /**
0034      * @return the name of the (writable) file to save the shortcut scheme to.
0035      */
0036     static QString writableShortcutSchemeFileName(const QString &componentName, const QString &schemeName);
0037 
0038     /**
0039      * @return the name of the scheme file for application itself.
0040      */
0041     static QString writableApplicationShortcutSchemeFileName(const QString &schemeName);
0042 
0043     /**
0044      * @return the name of the file to read the shortcut scheme from.
0045      */
0046     static QString shortcutSchemeFileName(const QString &componentName, const QString &schemeName);
0047 
0048     /**
0049      * @return the name of the scheme file for application itself, for reading.
0050      */
0051     static QString applicationShortcutSchemeFileName(const QString &schemeName);
0052 };
0053 
0054 #endif