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

« back to all changes in this revision

Viewing changes to kcontrol/style/kcmstyle.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
 * KCMStyle
 
3
 * Copyright (C) 2002 Karol Szwed <gallium@kde.org>
 
4
 * Copyright (C) 2002 Daniel Molkentin <molkentin@kde.org>
 
5
 * Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org>
 
6
 *
 
7
 * Portions Copyright (C) TrollTech AS.
 
8
 *
 
9
 * Based on kcmdisplay
 
10
 * Copyright (C) 1997-2002 kcmdisplay Authors.
 
11
 * (see Help -> About Style Settings)
 
12
 *
 
13
 * This program is free software; you can redistribute it and/or
 
14
 * modify it under the terms of the GNU General Public
 
15
 * License version 2 as published by the Free Software Foundation.
 
16
 *
 
17
 * This program is distributed in the hope that it will be useful,
 
18
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
20
 * General Public License for more details.
 
21
 *
 
22
 * You should have received a copy of the GNU General Public License
 
23
 * along with this program; see the file COPYING.  If not, write to
 
24
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
25
 * Boston, MA 02110-1301, USA.
 
26
 */
 
27
 
 
28
#ifndef KCMSTYLE_H
 
29
#define KCMSTYLE_H
 
30
 
 
31
#include <QHash>
 
32
#include <QLayout>
 
33
#include <QMap>
 
34
 
 
35
#include <kcmodule.h>
 
36
#include <kvbox.h>
 
37
 
 
38
#include "ui_finetuning.h"
 
39
 
 
40
class KComboBox;
 
41
class KConfig;
 
42
class QCheckBox;
 
43
class QComboBox;
 
44
class QLabel;
 
45
class QPushButton;
 
46
class StylePreview;
 
47
class QTabWidget;
 
48
 
 
49
struct StyleEntry {
 
50
    QString name;
 
51
    QString desc;
 
52
    QString configPage;
 
53
    bool hidden;
 
54
};
 
55
 
 
56
class KCMStyle : public KCModule
 
57
{
 
58
    Q_OBJECT
 
59
 
 
60
public:
 
61
    KCMStyle( QWidget* parent, const QVariantList& );
 
62
    ~KCMStyle();
 
63
 
 
64
    virtual void load();
 
65
    virtual void save();
 
66
    virtual void defaults();
 
67
 
 
68
protected:
 
69
    bool findStyle( const QString& str, int& combobox_item );
 
70
    void switchStyle(const QString& styleName, bool force = false);
 
71
    void setStyleRecursive(QWidget* w, QStyle* s);
 
72
 
 
73
    void loadStyle( KConfig& config );
 
74
    void loadEffects( KConfig& config );
 
75
    void addWhatsThis();
 
76
 
 
77
    virtual void changeEvent( QEvent *event );
 
78
 
 
79
protected Q_SLOTS:
 
80
    void styleSpecificConfig();
 
81
    void updateConfigButton();
 
82
 
 
83
    void setStyleDirty();
 
84
    void setEffectsDirty();
 
85
 
 
86
    void styleChanged();
 
87
 
 
88
private:
 
89
    QString currentStyle();
 
90
    static QString toolbarButtonText(int index);
 
91
    static int toolbarButtonIndex(const QString &text);
 
92
 
 
93
    bool m_bStyleDirty, m_bEffectsDirty;
 
94
    QHash <QString,StyleEntry*> styleEntries;
 
95
    QMap  <QString,QString>     nameToStyleKey;
 
96
 
 
97
    QVBoxLayout* mainLayout;
 
98
    QTabWidget* tabWidget;
 
99
    QWidget *page0, *page1, *page2;
 
100
    QVBoxLayout* page1Layout;
 
101
 
 
102
    // Page1 widgets
 
103
    QVBoxLayout* gbWidgetStyleLayout;
 
104
    QHBoxLayout* hbLayout;
 
105
    KComboBox* cbStyle;
 
106
    QPushButton* pbConfigStyle;
 
107
    QLabel* lblStyleDesc;
 
108
    StylePreview* stylePreview;
 
109
    QStyle* appliedStyle;
 
110
    QPalette palette;
 
111
 
 
112
    // Page2 widgets
 
113
    Ui::FineTuning fineTuningUi;
 
114
};
 
115
 
 
116
#endif // __KCMSTYLE_H
 
117
 
 
118
// vim: set noet ts=4: