00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef QPESTYLE_H
00022 #define QPESTYLE_H
00023
00024 #ifndef QT_H
00025 #include "qwindowsstyle.h"
00026 #endif // QT_H
00027
00028 #if QT_VERSION >= 300
00029
00030 class Q_EXPORT QPEStyle : public QWindowsStyle
00031 {
00032 public:
00033 QPEStyle();
00034 virtual ~QPEStyle();
00035
00036 virtual void drawPrimitive( PrimitiveElement pe, QPainter *p, const QRect &r, const QColorGroup &cg, SFlags flags=Style_Default, const QStyleOption & = QStyleOption::Default) const;
00037 virtual void drawControl( ControlElement ce, QPainter *p, const QWidget *widget, const QRect &r, const QColorGroup &cg, SFlags how=Style_Default, const QStyleOption & = QStyleOption::Default) const;
00038 virtual void drawComplexControl( ComplexControl control, QPainter *p, const QWidget *widget, const QRect &r, const QColorGroup &cg, SFlags how=Style_Default, SCFlags sub=SC_All, SCFlags subActive=SC_None, const QStyleOption & = QStyleOption::Default) const;
00039 virtual int pixelMetric( PixelMetric metric, const QWidget *widget=0 ) const;
00040 virtual QSize sizeFromContents( ContentsType contents, const QWidget *widget, const QSize &contentsSize, const QStyleOption & = QStyleOption::Default) const;
00041 };
00042
00043 #else
00044
00045 class Q_EXPORT QPEStyle : public QWindowsStyle
00046 {
00047 public:
00048 QPEStyle();
00049 virtual ~QPEStyle();
00050 virtual void polish( QPalette &p );
00051 virtual void polish( QWidget *w );
00052 virtual void unPolish( QWidget *w );
00053
00054 int defaultFrameWidth () const;
00055 void drawPanel ( QPainter * p, int x, int y, int w, int h,
00056 const QColorGroup &, bool sunken=FALSE, int lineWidth = 1, const QBrush * fill = 0 );
00057 void drawButton( QPainter *p, int x, int y, int w, int h,
00058 const QColorGroup &g, bool sunken, const QBrush* fill );
00059 void drawButtonMask ( QPainter * p, int x, int y, int w, int h );
00060 void drawBevelButton( QPainter *p, int x, int y, int w, int h,
00061 const QColorGroup &g, bool sunken=FALSE, const QBrush* fill=0 );
00062 QRect comboButtonRect( int x, int y, int w, int h);
00063 QRect comboButtonFocusRect( int x, int y, int w, int h);
00064 void drawComboButton( QPainter *p, int x, int y, int w, int h,
00065 const QColorGroup &g, bool sunken, bool, bool enabled,
00066 const QBrush *fill );
00067 void drawExclusiveIndicator ( QPainter * p, int x, int y, int w, int h,
00068 const QColorGroup & g, bool on, bool down = FALSE, bool enabled = TRUE );
00069 void drawIndicator ( QPainter * p, int x, int y, int w, int h,
00070 const QColorGroup & g, int state, bool down = FALSE, bool enabled = TRUE );
00071 void scrollBarMetrics( const QScrollBar*, int&, int&, int&, int&);
00072 void drawScrollBarControls( QPainter*, const QScrollBar*, int sliderStart, uint controls, uint activeControl );
00073 ScrollControl scrollBarPointOver( const QScrollBar* sb, int sliderStart, const QPoint& p );
00074 void drawRiffles( QPainter* p, int x, int y, int w, int h,
00075 const QColorGroup &g, bool horizontal );
00076 int sliderLength() const;
00077 void drawSlider( QPainter *p, int x, int y, int w, int h,
00078 const QColorGroup &g, Orientation, bool tickAbove, bool tickBelow );
00079 void drawSliderMask( QPainter *p, int x, int y, int w, int h,
00080 Orientation, bool tickAbove, bool tickBelow );
00081 void drawSliderGrooveMask( QPainter *p, int x, int y, int w, int h,
00082 const QColorGroup& , QCOORD c, Orientation orient );
00083 void drawTab( QPainter *, const QTabBar *, QTab *, bool selected );
00084 int extraPopupMenuItemWidth( bool checkable, int maxpmw, QMenuItem*, const QFontMetrics& );
00085 int popupMenuItemHeight( bool checkable, QMenuItem*, const QFontMetrics& );
00086 void drawPopupMenuItem( QPainter* p, bool checkable, int maxpmw, int tab, QMenuItem* mi,
00087 const QPalette& pal,
00088 bool act, bool enabled, int x, int y, int w, int h);
00089
00090 int buttonMargin() const;
00091 QSize scrollBarExtent() const;
00092
00093 private:
00094 #if defined(Q_DISABLE_COPY)
00095 QPEStyle( const QPEStyle & );
00096 QPEStyle& operator=( const QPEStyle & );
00097 #endif
00098 };
00099
00100 #endif
00101
00102 #endif // QPESTYLE_H