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

« back to all changes in this revision

Viewing changes to kstyles/web/webstyle.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) 2001 Rik Hemsley (rikkus) <rik@kde.org>
 
3
 *
 
4
 *  This library is free software; you can redistribute it and/or
 
5
 *  modify it under the terms of the GNU Library General Public
 
6
 *  License as published by the Free Software Foundation; either
 
7
 *  version 2 of the License, or (at your option) any later version.
 
8
 *
 
9
 *  This library 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 GNU
 
12
 *  Library General Public License for more details.
 
13
 *
 
14
 *  You should have received a copy of the GNU Library General Public License
 
15
 *  along with this library; see the file COPYING.LIB.  If not, write to
 
16
 *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
17
 *  Boston, MA 02110-1301, USA.
 
18
 */
 
19
 
 
20
#ifndef WEB_STYLE_H
 
21
#define WEB_STYLE_H
 
22
 
 
23
#include <kstyle.h>
 
24
#include <QtGui/QPalette>
 
25
 
 
26
class QPainter;
 
27
class QScrollBar;
 
28
class QPushButton;
 
29
class QWidget;
 
30
 
 
31
class WebStyle : public KStyle
 
32
{
 
33
  public:
 
34
 
 
35
    WebStyle();
 
36
 
 
37
    ~WebStyle();
 
38
 
 
39
    void polish(QApplication *);
 
40
 
 
41
    void unPolish(QWidget *);
 
42
 
 
43
    void polish(QWidget *);
 
44
 
 
45
    void polish(QPalette &);
 
46
 
 
47
    void unPolish(QApplication *);
 
48
 
 
49
    void drawButton
 
50
      (
 
51
       QPainter * p,
 
52
       int x,
 
53
       int y,
 
54
       int w,
 
55
       int h,
 
56
       const QColorGroup & g,
 
57
       bool sunken = false,
 
58
       const QBrush * fill = 0
 
59
      );
 
60
 
 
61
    QRect buttonRect(int x, int y, int w, int h);
 
62
 
 
63
    void drawBevelButton
 
64
      (
 
65
       QPainter *,
 
66
       int x,
 
67
       int y,
 
68
       int w,
 
69
       int h,
 
70
       const QColorGroup &,
 
71
       bool sunken = false,
 
72
       const QBrush * fill = 0
 
73
      );
 
74
 
 
75
    void drawPushButton(QPushButton *, QPainter *);
 
76
 
 
77
    virtual void drawPushButtonLabel(QPushButton *, QPainter *);
 
78
 
 
79
    void drawScrollBarControls
 
80
      (
 
81
       QPainter *,
 
82
       const QScrollBar *,
 
83
       int sliderStart,
 
84
       uint controls,
 
85
       uint activeControl
 
86
      );
 
87
 
 
88
    QStyle::ScrollControl scrollBarPointOver
 
89
      (
 
90
       const QScrollBar *,
 
91
       int sliderStart,
 
92
       const QPoint &
 
93
      );
 
94
 
 
95
    void scrollBarMetrics
 
96
      (
 
97
       const QScrollBar *,
 
98
       int & sliderMin,
 
99
       int & sliderMax,
 
100
       int & sliderLength,
 
101
       int & buttonDim
 
102
      );
 
103
 
 
104
    QSize indicatorSize() const;
 
105
 
 
106
    void drawIndicator
 
107
      (
 
108
       QPainter *,
 
109
       int x,
 
110
       int y,
 
111
       int w,
 
112
       int h,
 
113
       const QColorGroup &,
 
114
       int state,
 
115
       bool down = false,
 
116
       bool enabled = true
 
117
      );
 
118
 
 
119
    QSize exclusiveIndicatorSize() const;
 
120
 
 
121
    void drawExclusiveIndicator
 
122
      (
 
123
       QPainter *,
 
124
       int x,
 
125
       int y,
 
126
       int w,
 
127
       int h,
 
128
       const QColorGroup &,
 
129
       bool on,
 
130
       bool down = false,
 
131
       bool enabled = true
 
132
      );
 
133
 
 
134
    void drawIndicatorMask
 
135
      (
 
136
       QPainter *,
 
137
       int x,
 
138
       int y,
 
139
       int w,
 
140
       int h,
 
141
       int state
 
142
      );
 
143
 
 
144
    void drawExclusiveIndicatorMask
 
145
      (
 
146
       QPainter *,
 
147
       int x,
 
148
       int y,
 
149
       int w,
 
150
       int h,
 
151
       bool on
 
152
      );
 
153
 
 
154
    void drawComboButton
 
155
      (
 
156
       QPainter *,
 
157
       int x,
 
158
       int y,
 
159
       int w,
 
160
       int h,
 
161
       const QColorGroup &,
 
162
       bool sunken = false,
 
163
       bool editable = false,
 
164
       bool enabled = true,
 
165
       const QBrush * fill = 0
 
166
      );
 
167
 
 
168
    QRect comboButtonRect(int x, int y, int w, int h);
 
169
 
 
170
    QRect comboButtonFocusRect(int x, int y, int w, int h);
 
171
 
 
172
    int sliderLength() const;
 
173
 
 
174
    void drawSliderGroove
 
175
      (
 
176
       QPainter *,
 
177
       int x,
 
178
       int y,
 
179
       int w,
 
180
       int h,
 
181
       const QColorGroup &,
 
182
       QCOORD,
 
183
       Qt::Orientation
 
184
      );
 
185
 
 
186
    void drawArrow
 
187
      (
 
188
       QPainter *,
 
189
       Qt::ArrowType,
 
190
       bool down,
 
191
       int x,
 
192
       int y,
 
193
       int w,
 
194
       int h,
 
195
       const QColorGroup &,
 
196
       bool enabled = true,
 
197
       const QBrush * fill = 0
 
198
      );
 
199
 
 
200
    void drawSlider
 
201
      (
 
202
       QPainter *,
 
203
       int x,
 
204
       int y,
 
205
       int w,
 
206
       int h,
 
207
       const QColorGroup &,
 
208
       Qt::Orientation,
 
209
       bool tickAbove,
 
210
       bool tickBelow
 
211
      );
 
212
 
 
213
    void drawKToolBar
 
214
      (
 
215
       QPainter *,
 
216
       int x,
 
217
       int y,
 
218
       int w,
 
219
       int h,
 
220
       const QColorGroup &,
 
221
       KToolBarPos,
 
222
       QBrush * fill = 0
 
223
      );
 
224
 
 
225
    void drawKBarHandle
 
226
      (
 
227
       QPainter *,
 
228
       int x,
 
229
       int y,
 
230
       int w,
 
231
       int h,
 
232
       const QColorGroup &,
 
233
       KToolBarPos,
 
234
       QBrush * fill = 0
 
235
      );
 
236
 
 
237
    void drawKMenuBar
 
238
      (
 
239
       QPainter *,
 
240
       int x,
 
241
       int y,
 
242
       int w,
 
243
       int h,
 
244
       const QColorGroup &,
 
245
       bool macMode,
 
246
       QBrush * fill = 0
 
247
      );
 
248
 
 
249
    void drawKToolBarButton
 
250
      (
 
251
       QPainter * p,
 
252
       int x,
 
253
       int y,
 
254
       int w,
 
255
       int h,
 
256
       const QColorGroup & g,
 
257
       bool sunken = false,
 
258
       bool raised = true,
 
259
       bool enabled = true,
 
260
       bool popup = false,
 
261
       KToolButtonType = Icon,
 
262
       const QString & btext = QString(),
 
263
       const QPixmap * = 0,
 
264
       QFont * = 0,
 
265
       QWidget * button = 0
 
266
      );
 
267
 
 
268
    void drawKMenuItem
 
269
      (
 
270
       QPainter *,
 
271
       int x,
 
272
       int y,
 
273
       int w,
 
274
       int h,
 
275
       const QColorGroup &,
 
276
       bool active,
 
277
       QMenuItem *,
 
278
       QBrush * fill = 0
 
279
      );
 
280
 
 
281
    void drawPopupMenuItem
 
282
      (
 
283
       QPainter *,
 
284
       bool checkable,
 
285
       int maxpmw,
 
286
       int tab,
 
287
       QMenuItem *,
 
288
       const QPalette &,
 
289
       bool act,
 
290
       bool enabled,
 
291
       int x,
 
292
       int y,
 
293
       int w,
 
294
       int h
 
295
      );
 
296
 
 
297
    void drawKProgressBlock
 
298
      (
 
299
       QPainter *,
 
300
       int x,
 
301
       int y,
 
302
       int w,
 
303
       int h,
 
304
       const QColorGroup &,
 
305
       QBrush * fill
 
306
      );
 
307
 
 
308
    void drawFocusRect
 
309
      (
 
310
       QPainter *,
 
311
       const QRect &,
 
312
       const QColorGroup &,
 
313
       const QColor * pen,
 
314
       bool atBorder
 
315
      );
 
316
 
 
317
    void drawPanel
 
318
      (
 
319
       QPainter *,
 
320
       int x,
 
321
       int y,
 
322
       int w,
 
323
       int h,
 
324
       const QColorGroup &,
 
325
       bool sunken,
 
326
       int lineWidth = 1,
 
327
       const QBrush * = 0
 
328
      );
 
329
 
 
330
    void drawPopupPanel
 
331
      (
 
332
       QPainter *,
 
333
       int x,
 
334
       int y,
 
335
       int w,
 
336
       int h,
 
337
       const QColorGroup &,
 
338
       int lineWidth = 2,
 
339
       const QBrush * = 0
 
340
      );
 
341
 
 
342
    void drawSeparator
 
343
      (
 
344
       QPainter *,
 
345
       int x,
 
346
       int y,
 
347
       int w,
 
348
       int h,
 
349
       const QColorGroup &,
 
350
       bool sunken = true,
 
351
       int lineWidth = 1,
 
352
       int midLineWidth = 0
 
353
      );
 
354
 
 
355
    void drawTab
 
356
      (
 
357
       QPainter * p,
 
358
       const QTabBar * tabBar,
 
359
       QTab * tab,
 
360
       bool selected
 
361
      );
 
362
 
 
363
    void drawTabMask
 
364
      (
 
365
       QPainter * p,
 
366
       const QTabBar *,
 
367
       QTab * tab,
 
368
       bool
 
369
      );
 
370
 
 
371
    void drawKickerHandle
 
372
      (
 
373
       QPainter * p,
 
374
       int x,
 
375
       int y,
 
376
       int w,
 
377
       int h,
 
378
       const QColorGroup & g,
 
379
       QBrush *
 
380
      );
 
381
 
 
382
    void drawKickerAppletHandle
 
383
      (
 
384
       QPainter * p,
 
385
       int x,
 
386
       int y,
 
387
       int w,
 
388
       int h,
 
389
       const QColorGroup & g,
 
390
       QBrush *
 
391
      );
 
392
 
 
393
    void drawKickerTaskButton
 
394
      (
 
395
       QPainter * p,
 
396
       int x,
 
397
       int y,
 
398
       int w,
 
399
       int h,
 
400
       const QColorGroup & g,
 
401
       const QString & title,
 
402
       bool active,
 
403
       QPixmap * icon,
 
404
       QBrush *
 
405
      );
 
406
 
 
407
    int popupMenuItemHeight(bool, QMenuItem *, const QFontMetrics &);
 
408
 
 
409
    Qt::GUIStyle guiStyle() const { return Qt::MotifStyle; }
 
410
 
 
411
    bool eventFilter(QObject *, QEvent *);
 
412
};
 
413
 
 
414
#endif