Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / workspace / kcontrol / kxkb / kcmlayout.h
blob9f616946afac39456e91f16031543a68c1e97e35
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 __KCM_LAYOUT_H__
20 #define __KCM_LAYOUT_H__
23 #include <QHash>
24 #include <kcmodule.h>
26 #include "kxkbconfig.h"
29 class QWidget;
30 class KActionCollection;
31 class Ui_LayoutConfigWidget;
32 class XkbRules;
34 class SrcLayoutModel;
35 class DstLayoutModel;
36 class XkbOptionsModel;
38 class LayoutConfig : public KCModule
40 Q_OBJECT
42 public:
43 LayoutConfig(QWidget *parent, const QVariantList &args);
44 virtual ~LayoutConfig();
46 void load();
47 void save();
48 void defaults();
49 void initUI();
51 protected:
52 QString createOptionString();
54 protected slots:
55 void moveUp();
56 void moveDown();
57 void variantChanged();
58 void showFlagChanged(bool on);
59 void xkbShortcutPressed();
60 void xkbShortcut3dPressed();
61 void clearXkbSequence();
62 void clearXkb3dSequence();
63 void updateShortcutsLabels();
64 void xkbOptionsChanged(const QModelIndex & topLeft, const QModelIndex & bottomRight);
65 void enableChanged();
66 void updateGroupsFromServer();
67 void displayNameChanged(const QString& name);
68 void layoutSelChanged();
69 void loadRules();
70 void refreshRulesUI();
71 void updateLayoutCommand();
72 void updateOptionsCommand();
73 void add();
74 void remove();
76 void changed();
78 private:
79 const QString DEFAULT_VARIANT_NAME;
80 Ui_LayoutConfigWidget* widget;
82 XkbRules *m_rules;
83 KxkbConfig m_kxkbConfig;
84 SrcLayoutModel* m_srcModel;
85 DstLayoutModel* m_dstModel;
86 XkbOptionsModel* m_xkbOptModel;
87 KActionCollection* actionCollection;
89 void makeOptionsTab();
90 void updateStickyLimit();
91 void updateAddButton();
92 void updateDisplayName();
93 void moveSelected(int shift);
94 int getSelectedDstLayout();
98 #endif