00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00026
00027 #ifndef PHASESTYLE_H
00028 #define PHASESTYLE_H
00029
00030 #include <qstyle.h>
00031 #include <qwindowsstyle.h>
00032 #include <qcolor.h>
00033
00034 class KPixmap;
00035
00036 class PhaseStyle : public QWindowsStyle
00037 {
00038 Q_OBJECT
00039 public:
00040 PhaseStyle();
00041 virtual ~PhaseStyle();
00042
00043 virtual void polish( QWidget * );
00044 virtual void polish( QPalette& );
00045 virtual void polish( QApplication* a);
00046 virtual void unPolish( QWidget * );
00047 virtual void unPolish(QApplication *a);
00048
00049
00050 void drawCheckMark ( QPainter * p, int x, int y, int w,
00051 int h, const QColorGroup & g,
00052 bool act, bool dis );
00053 void drawArrow(QPainter *p, Qt::ArrowType type, bool down,
00054 int x, int y, int w, int h, const QColorGroup &g,
00055 bool enabled=true, const QBrush *fill = 0);
00056
00057 void drawPushButton(QPushButton* btn, QPainter* p );
00058 void drawPushButtonLabel(QPushButton* btn, QPainter* p );
00059 void drawPanel(QPainter* p, int , int, int, int,
00060 const QColorGroup&, bool sunken = false,
00061 int lineWidth = 1, const QBrush *b = 0l );
00062 void drawButton( QPainter*, int x, int y, int w, int h,
00063 const QColorGroup&, bool sunken = false,
00064 const QBrush* fill = 0);
00065 void drawBevelButton(QPainter*, int, int, int, int,
00066 const QColorGroup&, bool sunken = false,
00067 const QBrush* fill = 0 );
00068 void drawFocusRect( QPainter* p, const QRect& r,
00069 const QColorGroup&, const QColor* = 0,
00070 bool atBorder = false );
00071 void drawButtonMask( QPainter* p, int x, int y,
00072 int w, int h );
00073
00074
00075
00076 void drawSeperator( QPainter* p, int x, int y, int w,
00077 int h, const QColorGroup& group, bool sunken = true,
00078 int lineWidth = 1, int midLineWidtth = 0 );
00079 void drawMenuBarItem(QPainter* p, int x, int y, int w, int h,
00080 QMenuItem *mi, QColorGroup& g, bool enabled,
00081 bool act);
00082
00083
00084 void drawIndicator(QPainter* p, int x, int y, int w, int h,
00085 const QColorGroup &g, int state, bool down = FALSE,
00086 bool enabled = TRUE );
00087 void drawExclusiveIndicator( QPainter*, int, int, int, int,
00088 const QColorGroup&, bool on,
00089 bool down = false,bool enabled = true );
00090 void drawExclusiveIndicatorMask (QPainter*, int, int, int, int, bool );
00091
00092
00093 int defaultFrameWidth () const;
00094 int popupMenuItemHeight ( bool checkable,
00095 QMenuItem * mi,
00096 const QFontMetrics & fm );
00097 int extraPopupMenuItemWidth(bool checkable, int maxpmw,
00098 QMenuItem* mi, const QFontMetrics& fm );
00099
00100 QSize indicatorSize()const;
00101 QSize exclusiveIndicatorSize()const;
00102 void getButtonShift( int &x, int &y );
00103
00104
00105 void drawPopupMenuItem ( QPainter * p, bool checkable, int maxpmw,
00106 int tab, QMenuItem * mi,
00107 const QPalette & pal, bool act,
00108 bool enabled, int x, int y,
00109 int w, int h );
00110
00111
00112 QRect comboButtonRect ( int x, int y, int w, int h );
00113 void drawComboButton( QPainter * p, int x, int y,
00114 int w, int h,
00115 const QColorGroup & g,
00116 bool sunken = FALSE,
00117 bool editable = FALSE,
00118 bool enabled = TRUE,
00119 const QBrush * fill = 0 );
00120
00121
00122 void drawTab(QPainter*, const QTabBar*, QTab*,
00123 bool selected );
00124 void drawTabMask( QPainter*, const QTabBar*, QTab*,
00125 bool );
00126 void tabbarMetrics( const QTabBar* t, int &hframe, int &vframe, int &overlap);
00127
00128
00129 void drawToolButton ( QPainter * p, int x, int y,
00130 int w, int h,
00131 const QColorGroup & g,
00132 bool sunken = FALSE,
00133 const QBrush * fill = 0 );
00134
00135
00136 void drawScrollBarControls ( QPainter *, const QScrollBar *,
00137 int sliderStart, uint controls,
00138 uint activeControl );
00139 void scrollBarMetrics( const QScrollBar*, int&, int&, int&, int& );
00140 QStyle::ScrollControl scrollBarPointOver( const QScrollBar*, int sliderStart,
00141 const QPoint& );
00142
00143
00144 void drawSlider ( QPainter * p, int x, int y, int w, int h,
00145 const QColorGroup & g, Orientation,
00146 bool tickAbove, bool tickBelow );
00147
00148 void drawSliderGroove ( QPainter * p, int x, int y, int w,
00149 int h, const QColorGroup & g,
00150 QCOORD c, Orientation );
00151 private:
00152 void drawPhaseGradient(QPainter* p,
00153 const QRect& rec,
00154 const QColor& col )const;
00155 static void scrollBarItemPositions( const QScrollBar *,
00156 const bool horizontal,
00157 int sliderStart,
00158 int sliderMax,
00159 int sliderLength,
00160 int buttomDim,
00161 QRect& sub,
00162 QRect& add,
00163 QRect& subPage,
00164 QRect& addPage,
00165 QRect& slider );
00166 };
00167
00168
00169 #endif