00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef LIGHTSTYLE_H
00021 #define LIGHTSTYLE_H
00022
00023
00024 #ifndef QT_H
00025 #include <qstyle.h>
00026 #include <qwindowsstyle.h>
00027 #endif // QT_H
00028
00029 #if QT_VERSION < 300
00030
00031 #ifdef QT_PLUGIN_STYLE_LIGHT
00032 # define Q_EXPORT_STYLE_LIGHT
00033 #else
00034 # define Q_EXPORT_STYLE_LIGHT Q_EXPORT
00035 #endif // QT_PLUGIN_STYLE_LIGHT
00036
00037
00038 class Q_EXPORT_STYLE_LIGHT LightStyle : public QWindowsStyle
00039 {
00040 public:
00041 LightStyle();
00042 virtual ~LightStyle();
00043
00044 void polish(QWidget *widget);
00045 void unPolish(QWidget*widget);
00046
00047 void polish(QApplication *app);
00048 void unPolish(QApplication *app);
00049
00050 void polishPopupMenu(QPopupMenu *menu);
00051
00052 void drawPushButton(QPushButton *button, QPainter *p);
00053 void drawButton(QPainter *p, int x, int y, int w, int h,
00054 const QColorGroup &g, bool sunken = FALSE,
00055 const QBrush *fill = 0);
00056 void drawBevelButton(QPainter *p, int x, int y, int w, int h,
00057 const QColorGroup &g, bool sunken = FALSE,
00058 const QBrush *fill = 0);
00059 void getButtonShift(int &x, int &y) const;
00060
00061 void drawComboButton(QPainter *p, int x, int y, int w, int h,
00062 const QColorGroup &g, bool sunken = FALSE,
00063 bool editable = FALSE, bool = TRUE,
00064 const QBrush *fill = 0);
00065 QRect comboButtonRect(int x, int y, int w, int h) const;
00066 QRect comboButtonFocusRect(int x, int y, int w, int h) const;
00067
00068 void drawIndicator(QPainter *p, int x, int y ,int w, int h,
00069 const QColorGroup &g, int state,
00070 bool = FALSE, bool = TRUE);
00071 QSize indicatorSize() const;
00072
00073 void drawExclusiveIndicator(QPainter *p, int x, int y ,int w, int h,
00074 const QColorGroup &g, bool on,
00075 bool = FALSE, bool = TRUE);
00076 QSize exclusiveIndicatorSize() const;
00077
00078 void drawPanel(QPainter * p, int x, int y, int w, int h,
00079 const QColorGroup &g, bool sunken = FALSE,
00080 int = 1, const QBrush * = 0);
00081
00082 void scrollBarMetrics( const QScrollBar *,
00083 int &, int &, int &, int & ) const;
00084 void drawScrollBarControls(QPainter* p, const QScrollBar* sb,
00085 int sliderStart, uint controls,
00086 uint activeControl);
00087 QStyle::ScrollControl scrollBarPointOver(const QScrollBar *, int, const QPoint& p);
00088
00089 void drawTab(QPainter *p, const QTabBar *tabbar, QTab *tab, bool selected);
00090
00091 void drawSlider(QPainter *p, int x, int y, int w, int h,
00092 const QColorGroup &g, Qt::Orientation orientation,
00093 bool, bool);
00094 void drawSliderGroove(QPainter *p, int x, int y, int w, int h,
00095 const QColorGroup& g, QCOORD,
00096 Qt::Orientation );
00097
00098 void drawToolBarHandle(QPainter *, const QRect &, Qt::Orientation,
00099 bool, const QColorGroup &, bool = FALSE );
00100
00101 QSize scrollBarExtent() const;
00102 int buttonDefaultIndicatorWidth() const;
00103 int buttonMargin() const;
00104 int sliderThickness() const;
00105 int sliderLength() const;
00106 int defaultFrameWidth() const;
00107
00108 int extraPopupMenuItemWidth( bool checkable, int maxpmw, QMenuItem*, const QFontMetrics& );
00109 int popupMenuItemHeight( bool checkable, QMenuItem*, const QFontMetrics& );
00110 void drawPopupMenuItem( QPainter* p, bool checkable, int maxpmw, int tab, QMenuItem* mi,
00111 const QPalette& pal,
00112 bool act, bool enabled, int x, int y, int w, int h);
00113
00114 protected:
00115 bool eventFilter(QObject *, QEvent *);
00116 };
00117
00118 #endif
00119
00120 #endif // LIGHTSTYLE_H