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
;
44 //typedef KxkbWidget* (*KxkbWidgetCreateFn(KxkbWidget*));
46 /* This is the main Kxkb class responsible for reading options
50 class KxkbCore
: public QObject
55 enum { KXKB_MAIN
=1, KXKB_COMPONENT
=2 };
57 KxkbCore(int mode
=KXKB_MAIN
);
60 virtual int newInstance();
61 bool setLayout(int layout
);
62 int getStatus() { return m_status
; }
63 bool x11EventFilter ( XEvent
* event
);
64 void setWidget(KxkbWidget
* kxkbWidet
);
66 const KShortcut
* getKDEShortcut();
70 bool setLayout(const QString
& layoutPair
);
71 QString
getCurrentLayout() { return m_kxkbConfig
.m_layouts
[m_currentLayout
].toPair(); }
72 QStringList
getLayoutsList() { return m_kxkbConfig
.getLayoutStringList(); }
76 void iconMenuTriggered(QAction
*);
77 void windowChanged(WId winId
);
78 void desktopChanged(int desktop
);
80 void settingsChanged(int category
);
93 KxkbConfig m_kxkbConfig
;
94 LayoutMap
* m_layoutOwnerMap
;
96 XKBExtension
*m_extension
;
99 KxkbWidget
*m_kxkbWidget
;
100 KActionCollection
*actionCollection
;
102 QWidget
* m_dummyWidget
;
104 void updateIndicator(int layout
, int res
);
106 void initKDEShortcut();
107 void stopKDEShortcut();
108 void initReactions();
109 void initLayoutGroups();
110 void initSwitchingPolicy();
111 int updateGroupsFromServer();