summaryrefslogtreecommitdiffstats
path: root/khotkeys/kcontrol/kcmkhotkeys.h
blob: b406df8fe72af159e12786879c12012e1f9ded02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
/****************************************************************************

 KHotKeys
 
 Copyright (C) 1999-2001 Lubos Lunak <l.lunak@kde.org>

 Distributed under the terms of the GNU General Public License version 2.
 
****************************************************************************/

#ifndef _KCMKHOTKEYS_H_
#define _KCMKHOTKEYS_H_

#include <kcmodule.h>
#include <kshortcut.h>

#include <actions.h>
#include <settings.h>



namespace KHotKeys
{

class Actions_listview_widget;
class Tab_widget;
class Action_data_base;
class Main_buttons_widget;

class Module
    : public KCModule
    {
    Q_OBJECT
    public:
        Module( TQWidget *parent_P, const char *name_P );
        virtual ~Module();
        virtual void load();
        virtual void save();
//        virtual void defaults(); not used
        TQString quickHelp() const;
        int buttons();
        void set_current_action_data( Action_data_base* data_P );
        Action_data_base* current_action_data();
        void action_name_changed( const TQString& name_P );
        Action_data_group* actions_root() const;
        void set_gestures_disabled( bool set );
        bool gestures_disabled() const;
        void set_gesture_button( int button );
        int gesture_button() const;
        void set_gesture_timeout( int time );
        int gesture_timeout() const;
        void set_gestures_exclude( Windowdef_list* windows );
        const Windowdef_list* gestures_exclude() const;
        void set_daemon_disabled( bool disable );
        bool daemon_disabled() const;
        void import();
		KShortcut voice_shortcut() const;
		void set_voice_shortcut( const KShortcut&) ;
    public slots:
        void changed();
    protected:
        void set_new_current_action( bool save_old_P );
        void init_arts();
        Actions_listview_widget* actions_listview_widget;
        Tab_widget* tab_widget;
        Main_buttons_widget* buttons_widget;
        Action_data_group* _actions_root; // vlastni vsechny Action_data
        Action_data_base* _current_action_data;
        bool listview_is_changed;
        bool deleting_action;
        Settings settings;
    protected slots:
        void listview_current_action_changed();
        void new_action();
        void new_action_group();
        void delete_action();
        void global_settings();
    };
    
extern Module* module;

//***************************************************************************
// Inline
//***************************************************************************

// Module

inline
Action_data_group* Module::actions_root() const
    {
    return _actions_root;
    }

inline
Action_data_base* Module::current_action_data()
    {
    return _current_action_data;
    }
    
inline
void Module::set_gestures_disabled( bool set )
    {
    settings.gestures_disabled_globally = set;
    }

inline
bool Module::gestures_disabled() const
    {
    return settings.gestures_disabled_globally;
    }

inline
void Module::set_gesture_button( int button )
    {
    settings.gesture_mouse_button = button;
    }

inline
int Module::gesture_button() const
    {
    return settings.gesture_mouse_button;
    }

inline
void Module::set_gesture_timeout( int time )
    {
    settings.gesture_timeout = time;
    }

inline
int Module::gesture_timeout() const
    {
    return settings.gesture_timeout;
    }

inline
const Windowdef_list* Module::gestures_exclude() const
    {
    return settings.gestures_exclude;
    }

inline
void Module::set_daemon_disabled( bool disabled_P )
    {
    settings.daemon_disabled = disabled_P;
    }

inline
bool Module::daemon_disabled() const
    {
    return settings.daemon_disabled;
    }


inline
void Module::set_voice_shortcut( const KShortcut& cut)
   {
    settings.voice_shortcut=cut;
   }

inline 
KShortcut Module::voice_shortcut() const
   {
	return settings.voice_shortcut;
   }


} // namespace KHotKeys

#endif