~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to kcontrol/keyboard/keyboard_config.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright (C) 2010 Andriy Rysin (rysin@kde.org)
 
3
 *
 
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.
 
8
 *
 
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.
 
13
 *
 
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.
 
17
 */
 
18
 
 
19
 
 
20
#ifndef KEYBOARD_CONFIG_H_
 
21
#define KEYBOARD_CONFIG_H_
 
22
 
 
23
#include "x11_helper.h"
 
24
 
 
25
#include <QtCore/QString>
 
26
#include <QtCore/QStringList>
 
27
#include <QtCore/QList>
 
28
#include <QtCore/QMap>
 
29
#include <QtCore/QPair>
 
30
 
 
31
/**
 
32
 * This class provides configuration options for keyboard module
 
33
 */
 
34
class KeyboardConfig
 
35
{
 
36
public:
 
37
        static const int MAX_LABEL_LEN = 3;
 
38
        static const int NO_LOOPING; // = -1;
 
39
 
 
40
        enum SwitchingPolicy {
 
41
                SWITCH_POLICY_GLOBAL = 0,
 
42
                SWITCH_POLICY_DESKTOP = 1,
 
43
                SWITCH_POLICY_APPLICATION = 2,
 
44
                SWITCH_POLICY_WINDOW = 3
 
45
        };
 
46
 
 
47
        QString keyboardModel;
 
48
        // resetOldXkbOptions is now also "set xkb options"
 
49
        bool resetOldXkbOptions;
 
50
        QStringList xkbOptions;
 
51
 
 
52
        // init layouts options
 
53
        bool configureLayouts;
 
54
        QList<LayoutUnit> layouts;
 
55
        int layoutLoopCount;
 
56
 
 
57
        // switch cotrol options
 
58
        SwitchingPolicy switchingPolicy;
 
59
//      bool stickySwitching;
 
60
//      int stickySwitchingDepth;
 
61
 
 
62
        // display options
 
63
        bool showIndicator;
 
64
        bool showFlag;
 
65
        bool showSingle;
 
66
 
 
67
        bool isSpareLayoutsEnabled() const {
 
68
                return layoutLoopCount != KeyboardConfig::NO_LOOPING;
 
69
        }
 
70
        QList<LayoutUnit> getDefaultLayouts() const;
 
71
        QList<LayoutUnit> getExtraLayouts() const;
 
72
 
 
73
        void setDefaults();
 
74
        void load();
 
75
        void save();
 
76
 
 
77
        static QString getSwitchingPolicyString(SwitchingPolicy switchingPolicy);
 
78
};
 
79
 
 
80
#endif /* KEYBOARD_CONFIG_H_ */