| 1 | /**************************************************************************** | 
|---|
| 2 | ** $Id: wood.h 2 2005-11-16 15:49:26Z dmik $ | 
|---|
| 3 | ** | 
|---|
| 4 | ** Definition of something or other | 
|---|
| 5 | ** | 
|---|
| 6 | ** Created : 979899 | 
|---|
| 7 | ** | 
|---|
| 8 | ** Copyright (C) 1997 by Trolltech AS.  All rights reserved. | 
|---|
| 9 | ** | 
|---|
| 10 | ** This file is part of an example program for Qt.  This example | 
|---|
| 11 | ** program may be used, distributed and modified without limitation. | 
|---|
| 12 | ** | 
|---|
| 13 | *****************************************************************************/ | 
|---|
| 14 |  | 
|---|
| 15 | #ifndef WOOD_H | 
|---|
| 16 | #define WOOD_H | 
|---|
| 17 |  | 
|---|
| 18 |  | 
|---|
| 19 | #include <qpalette.h> | 
|---|
| 20 |  | 
|---|
| 21 | #ifndef QT_NO_STYLE_WINDOWS | 
|---|
| 22 |  | 
|---|
| 23 | #include <qwindowsstyle.h> | 
|---|
| 24 |  | 
|---|
| 25 |  | 
|---|
| 26 | class NorwegianWoodStyle : public QWindowsStyle | 
|---|
| 27 | { | 
|---|
| 28 | public: | 
|---|
| 29 | NorwegianWoodStyle(); | 
|---|
| 30 | void polish( QApplication*); | 
|---|
| 31 | void polish( QWidget* ); | 
|---|
| 32 | void unPolish( QWidget* ); | 
|---|
| 33 | void unPolish( QApplication*); | 
|---|
| 34 |  | 
|---|
| 35 | void drawPrimitive( PrimitiveElement pe, | 
|---|
| 36 | QPainter *p, | 
|---|
| 37 | const QRect &r, | 
|---|
| 38 | const QColorGroup &cg, | 
|---|
| 39 | SFlags flags = Style_Default, | 
|---|
| 40 | const QStyleOption& = QStyleOption::Default ) const; | 
|---|
| 41 |  | 
|---|
| 42 | void drawControl( ControlElement element, | 
|---|
| 43 | QPainter *p, | 
|---|
| 44 | const QWidget *widget, | 
|---|
| 45 | const QRect &r, | 
|---|
| 46 | const QColorGroup &cg, | 
|---|
| 47 | SFlags how = Style_Default, | 
|---|
| 48 | const QStyleOption& = QStyleOption::Default ) const; | 
|---|
| 49 |  | 
|---|
| 50 | void drawControlMask( ControlElement element, | 
|---|
| 51 | QPainter *p, | 
|---|
| 52 | const QWidget *widget, | 
|---|
| 53 | const QRect &r, | 
|---|
| 54 | const QStyleOption& = QStyleOption::Default ) const; | 
|---|
| 55 |  | 
|---|
| 56 | void drawComplexControl( ComplexControl cc, | 
|---|
| 57 | QPainter *p, | 
|---|
| 58 | const QWidget *widget, | 
|---|
| 59 | const QRect &r, | 
|---|
| 60 | const QColorGroup &cg, | 
|---|
| 61 | SFlags how = Style_Default, | 
|---|
| 62 | SCFlags sub = SC_All, | 
|---|
| 63 | SCFlags subActive = SC_None, | 
|---|
| 64 | const QStyleOption& = QStyleOption::Default ) const; | 
|---|
| 65 |  | 
|---|
| 66 | void drawComplexControlMask( ComplexControl control, | 
|---|
| 67 | QPainter *p, | 
|---|
| 68 | const QWidget *widget, | 
|---|
| 69 | const QRect &r, | 
|---|
| 70 | const QStyleOption& = QStyleOption::Default ) const; | 
|---|
| 71 |  | 
|---|
| 72 | QRect querySubControlMetrics( ComplexControl control, | 
|---|
| 73 | const QWidget *widget, | 
|---|
| 74 | SubControl sc, | 
|---|
| 75 | const QStyleOption& = QStyleOption::Default ) const; | 
|---|
| 76 |  | 
|---|
| 77 | QRect subRect( SubRect r, const QWidget *widget ) const; | 
|---|
| 78 |  | 
|---|
| 79 |  | 
|---|
| 80 | private: | 
|---|
| 81 | void drawSemicircleButton(QPainter *p, const QRect &r, int dir, | 
|---|
| 82 | bool sunken, const QColorGroup &g ) const; | 
|---|
| 83 | QPalette oldPalette; | 
|---|
| 84 | QPixmap *sunkenDark; | 
|---|
| 85 | QPixmap *sunkenLight; | 
|---|
| 86 |  | 
|---|
| 87 | }; | 
|---|
| 88 |  | 
|---|
| 89 | #endif | 
|---|
| 90 |  | 
|---|
| 91 | #endif | 
|---|