2 Copyright (C) 2001, S.R.Haque <srhaque@iee.org>.
3 Copyright (C) 2006, Andriy Rysin <rysin@kde.org>. Derived from an
4 original by Matthias H�zer-Klpfel released under the QPL.
5 This file is part of the KDE project
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA.
24 KDE Keyboard Tool. Manages XKB keyboard mappings.
26 #ifndef __KXKBCORE_H__
27 #define __KXKBCORE_H__
33 #include "kxkbconfig.h"
38 class KActionCollection
;
43 //typedef KxkbWidget* (*KxkbWidgetCreateFn(KxkbWidget*));
45 /* This is the main Kxkb class responsible for reading options
49 class KxkbCore
: public QObject
54 enum { KXKB_MAIN
=1, KXKB_COMPONENT
=2 };
56 KxkbCore(int mode
=KXKB_MAIN
);
59 virtual int newInstance();
60 bool setLayout(int layout
);
61 int getStatus() { return m_status
; }
62 bool x11EventFilter ( XEvent
* event
);
63 void setWidget(KxkbWidget
* kxkbWidet
);
68 bool setLayout(const QString
& layoutPair
);
69 QString
getCurrentLayout() { return m_kxkbConfig
.m_layouts
[m_currentLayout
].toPair(); }
70 QStringList
getLayoutsList() { return m_kxkbConfig
.getLayoutStringList(); }
73 void iconMenuTriggered(QAction
*);
75 void windowChanged(WId winId
);
76 void desktopChanged(int desktop
);
78 void settingsChanged(int category
);
90 KxkbConfig m_kxkbConfig
;
91 LayoutMap
* m_layoutOwnerMap
;
93 XKBExtension
*m_extension
;
96 KxkbWidget
*m_kxkbWidget
;
97 KActionCollection
*actionCollection
;
99 QWidget
* m_dummyWidget
;
101 void updateIndicator(int layout
, int res
);
103 void initKDEShortcut();
104 void stopKDEShortcut();
105 void initReactions();
106 void initLayoutGroups();
107 void initSwitchingPolicy();
108 int updateGroupsFromServer();