~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to khotkeys/app/kded.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
 
 
3
 KHotKeys
 
4
 
 
5
 Copyright (C) 1999-2001 Lubos Lunak <l.lunak@kde.org>
 
6
 
 
7
 Distributed under the terms of the GNU General Public License version 2.
 
8
 
 
9
****************************************************************************/
 
10
 
 
11
#ifndef _KHOTKEYS_KDED_H_
 
12
#define _KHOTKEYS_KDED_H_
 
13
 
 
14
#include <kdedmodule.h>
 
15
#include "settings.h"
 
16
 
 
17
#include <QtCore/QObject>
 
18
#include <QtDBus/QtDBus>
 
19
#include <QtGui/QKeySequence>
 
20
 
 
21
#include <KService>
 
22
 
 
23
namespace KHotKeys
 
24
    {
 
25
    class ActionDataGroup;
 
26
    class SimpleActionData;
 
27
    }
 
28
 
 
29
class KHotKeysModule
 
30
    : public KDEDModule
 
31
    {
 
32
    Q_OBJECT
 
33
    Q_CLASSINFO("D-Bus Interface", "org.kde.khotkeys")
 
34
 
 
35
    public Q_SLOTS:
 
36
 
 
37
        Q_SCRIPTABLE Q_NOREPLY void reread_configuration();
 
38
 
 
39
        Q_SCRIPTABLE Q_NOREPLY void quit();
 
40
 
 
41
        /**
 
42
         * Register an shortcut for service @serviceStorageId with the key
 
43
         * sequence @seq.
 
44
         *
 
45
         * @param serviceStorageId the KService::storageId of the service
 
46
         * @param sequence         the key sequence to use
 
47
         *
 
48
         * @returns @c true if the key sequence was successfully set, @c if
 
49
         * the sequence is not available.
 
50
         */
 
51
        Q_SCRIPTABLE QString register_menuentry_shortcut(const QString &storageId, const QString &sequence);
 
52
 
 
53
        /**
 
54
         * Get the currently active shortcut for service @p serviceStorageId.
 
55
         *
 
56
         * @param serviceStorageId the KService::storageId of the service
 
57
         *
 
58
         * @returns the active global shortcuts for that service
 
59
         */
 
60
        Q_SCRIPTABLE QString get_menuentry_shortcut(const QString &storageId);
 
61
 
 
62
    private Q_SLOTS:
 
63
 
 
64
        //! Save
 
65
        void save();
 
66
 
 
67
        //! Initialize the module. Delayed initialization.
 
68
        void initialize();
 
69
 
 
70
    public:
 
71
 
 
72
        KHotKeysModule(QObject* parent, const QList<QVariant>&);
 
73
        virtual ~KHotKeysModule();
 
74
 
 
75
    private:
 
76
 
 
77
        //! The action list from _settings for convenience
 
78
        KHotKeys::ActionDataGroup* actions_root;
 
79
 
 
80
        //! The current settings
 
81
        KHotKeys::Settings _settings;
 
82
 
 
83
        //! Is the module initialized
 
84
        bool _initialized;
 
85
 
 
86
        /** 
 
87
         * @name Some method in need for a better home 
 
88
         */
 
89
        //@{
 
90
            //! Get the group for the menuentries. Will create it if needed
 
91
            KHotKeys::ActionDataGroup *menuentries_group();
 
92
 
 
93
            //! Find a menuentry_action for the service with @storageId in group @group
 
94
            KHotKeys::SimpleActionData *menuentry_action(const QString &storageId);
 
95
        //@}
 
96
    };
 
97
 
 
98
//***************************************************************************
 
99
// Inline
 
100
//***************************************************************************
 
101
 
 
102
 
 
103
#endif