not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / kcontrol / kxkb / rules.h
blob87f22d9d23c80910686ffe61e0ecadd0b0df7fbd
1 /*
2 * Copyright (C) 2003-2006 Andriy Rysin (rysin@kde.org)
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program 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
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #ifndef __RULES_H__
20 #define __RULES_H__
23 #include <QHash>
24 #include <QMap>
26 #include "x11helper.h"
28 class XkbRules
30 public:
32 XkbRules(bool layoutsOnly=false);
34 const QHash<QString, QString> &models() const { return m_models; }
35 const QHash<QString, QString> &layouts() const { return m_layouts; }
36 const QHash<QString, XkbOption> &options() const { return m_options; }
37 const QHash<QString, XkbOptionGroup> &optionGroups() const { return m_optionGroups; }
39 QList<XkbVariant> getAvailableVariants(const QString& layout);
40 unsigned int getDefaultGroup(const QString& layout, const QString& includeGroup);
42 bool isSingleGroup(const QString& layout);
44 private:
46 QHash<QString, QString> m_models;
47 QHash<QString, QString> m_layouts;
48 QHash<QString, XkbOptionGroup> m_optionGroups;
49 QHash<QString, XkbOption> m_options;
50 QHash<QString, QList<XkbVariant>*> m_varLists;
52 QString X11_DIR; // pseudo-constant
54 static bool m_layoutsClean;
56 #ifdef HAVE_XKLAVIER
57 void loadNewRules(bool layoutsOnly);
58 #else
59 void loadRules(const QString &filename, bool layoutsOnly=false);
60 void fixOptionGroups();
61 #endif
64 #endif