2 Copyright (C) 2008 Michael Jansen <kde@michael-jansen.biz>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
19 #ifndef SHORTCUTACTIONS_H
20 #define SHORTCUTACTIONS_H
23 #include <KDE/KActionCollection>
34 * @author Michael Jansen <kde@michael-jansen.biz>
36 class ShortcutsHandler
: public QObject
43 Active
, //!< Create real actions
44 Configuration
}; //!< Create configuration actions ( not active )
51 ShortcutsHandler( HandlerType type
= Active
, QObject
*parent
= 0 );
61 * The action stays in the ownership of this class. Do not delete.
63 * \param id Persistent id for the action
64 * \param name Name for the action. Is used in the global shortcut
65 * configuration dialog
66 * \param shortcut Shortcut that triggers the action
68 * \return The new action or 0 if an error occurred.
70 * \see KAction::registerGlobalShortcut()
75 const KShortcut
&shortcut
);
78 * Remove a action from the collection.
80 * \param id Persistent id for the action
82 * \return The action or 0 if not found.
84 QAction
*getAction( const QString
&id
);
87 * Remove a action from the collection.
89 * \param id Persistent id for the action
91 * \return true if the action was removed.
93 bool removeAction( const QString
&id
);
98 * \warning Does nothing, returns false
100 bool send_macro_key( const QString
& key
, Window window_P
);
106 KActionCollection
*_actions
;
110 } // namespace KHotKeys
112 #endif /* #ifndef SHORTCUTACTIONS_H */