Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

phasestyle.h

Go to the documentation of this file.
00001 
00002 // phasestyle.h
00003 // -------------------
00004 // A style for KDE
00005 // -------------------
00006 // Copyright (c) 2004 David Johnson <david@usermode.org>
00007 //
00008 // Permission is hereby granted, free of charge, to any person obtaining a copy
00009 // of this software and associated documentation files (the "Software"), to
00010 // deal in the Software without restriction, including without limitation the
00011 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
00012 // sell copies of the Software, and to permit persons to whom the Software is
00013 // furnished to do so, subject to the following conditions:
00014 //
00015 // The above copyright notice and this permission notice shall be included in
00016 // all copies or substantial portions of the Software.
00017 //
00018 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00019 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00020 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
00021 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00022 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00023 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
00024 // IN THE SOFTWARE.
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     /* Menu Stuff */
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     /* RadioButton, CheckBox... */
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     /* spacing,dimensions */
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     /* popup drawing */
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     /* combo box */
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     /* tabbar */
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     /* tool button */
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     /* scrollbar */
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     /* slider drawing */
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

Generated on Sat Nov 5 16:17:59 2005 for OPIE by  doxygen 1.4.2