summaryrefslogtreecommitdiffstats
path: root/plugin/simplestyle.h
blob: 0b302dea9421cad11afc0efb9d3ad489f2a6d0d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/****************************************************************************
**
** Copyright (C) 2012 Timothy Pearson.  All rights reserved.
**
** This file is part of the TDE Qt4 style interface
**
** This file may be used under the terms of the GNU General
** Public License versions 2.0 or 3.0 as published by the Free
** Software Foundation and appearing in the files LICENSE.GPL2
** and LICENSE.GPL3 included in the packaging of this file.
**
** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
** herein.
**
**********************************************************************/

#ifndef SIMPLESTYLE_H
#define SIMPLESTYLE_H

#include <QtGui/QWindowsStyle>
#include <QFileDialog>

QT_BEGIN_NAMESPACE
class QPalette;
QT_END_NAMESPACE

class TQWidget;
class TQTabBar;
class TQRadioButton;
class TQCheckBox;
class TQProgressBar;
class TQPopupMenu;
class TQComboBox;
class TQSlider;
class TQScrollBar;
class TQSpinBox;
class TQSpinWidget;
class TQTitleBar;
class TQMenuBar;
class TQToolBox;
class TQToolButton;

class KAboutData;
class TQPixmapCache;

enum TQt3WidgetType {
	TQT3WT_NONE,
	TQT3WT_TQProgressBar,
	TQT3WT_TQTabBar,
	TQT3WT_TQRadioButton,
	TQT3WT_TQCheckBox,
	TQT3WT_TQPopupMenu,
	TQT3WT_TQComboBox,
	TQT3WT_TQSlider,
	TQT3WT_TQScrollBar,
	TQT3WT_TQSpinBox,
	TQT3WT_TQSpinWidget,
	TQT3WT_TQTitleBar,
	TQT3WT_TQMenuBar,
	TQT3WT_TQToolBox,
	TQT3WT_TQToolButton
};

class Qt4TDEStyle : public QWindowsStyle
{
    Q_OBJECT

public:
    Qt4TDEStyle();
    ~Qt4TDEStyle();

    void polish(QPalette &palette);
    void polish(QWidget *widget);
    void unpolish(QWidget *widget);
    bool eventFilter(QObject *obj, QEvent *ev);

    void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w = 0) const;
    void drawControl(ControlElement element, const QStyleOption * option, QPainter * painter, const QWidget * widget = 0) const;
    void drawComplexControl(ComplexControl control, const QStyleOptionComplex * option, QPainter * painter, const QWidget * widget = 0) const;
    QRect subElementRect(SubElement element, const QStyleOption * option, const QWidget * widget = 0) const;

    int pixelMetric(PixelMetric metric, const QStyleOption * option = 0, const QWidget * widget = 0) const;
    int styleHint(StyleHint hint, const QStyleOption * option = 0, const QWidget * widget = 0, QStyleHintReturn * returnData = 0) const;
    QSize sizeFromContents(ContentsType type, const QStyleOption * option, const QSize & contentsSize, const QWidget * widget = 0) const;

public slots:
    QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption * option = 0, const QWidget * widget = 0) const;

private:
    TQWidget* initializeInterfaceWidget(TQt3WidgetType wt, const QWidget * widget, const QStyleOption* qt4styleoptions = 0) const;

    TQWidget* m_tqt3parent_widget;
    TQWidget* m_tqt3generic_widget;
    TQTabBar* m_tqt3tabbar_widget;
    TQRadioButton* m_tqt3radiobutton_widget;
    TQCheckBox* m_tqt3checkbox_widget;
    TQProgressBar* m_tqt3progressbar_widget;
    TQPopupMenu* m_tqt3popupmenu_widget;
    TQComboBox* m_tqt3combobox_widget;
    TQSlider* m_tqt3slider_widget;
    TQScrollBar* m_tqt3scrollbar_widget;
    TQSpinBox* m_tqt3spinbox_widget;
    TQSpinWidget* m_tqt3spinwidget_widget;
    TQWidget* m_tqt3window_widget;
    TQTitleBar* m_tqt3titlebar_widget;
    TQMenuBar* m_tqt3menubar_widget;
    TQToolBox* m_tqt3toolbox_widget;
    TQToolButton* m_tqt3toolbutton_widget;

    int m_tqt3IconSize_NoGroup;
    int m_tqt3IconSize_Desktop;
    int m_tqt3IconSize_FirstGroup;
    int m_tqt3IconSize_Toolbar;
    int m_tqt3IconSize_Tabbar;
    int m_tqt3IconSize_MainToolbar;
    int m_tqt3IconSize_Small;
    int m_tqt3IconSize_Panel;
    int m_tqt3IconSize_LastGroup;
    int m_tqt3IconSize_User;
    int m_tqt3IconSize_MenuItem;
    int m_tqt3IconSize_Large;
    int m_tqt3IconSize_Listview;
    int m_tqt3IconSize_Button;
    int m_tqt3DialogButtons_ShowIcons;

    mutable const QWidget* m_previousQt4InterfaceWidget;
    mutable TQWidget* m_previousTQt3InterfaceWidget;

    KAboutData* m_aboutData;

    TQPixmapCache* m_internalTQt3PixmapCache;
};

#endif