00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef STYLE_SALOME_H
00024 #define STYLE_SALOME_H
00025
00026 #include "Style.h"
00027
00028 #include <QWindowsStyle>
00029
00030 class Style_Model;
00031
00032 class QApplication;
00033 class QWidget;
00034 class QPainter;
00035 class QtxResourceMgr;
00036
00037 class STYLE_SALOME_EXPORT Style_Salome : public QWindowsStyle
00038 {
00039 Q_OBJECT
00040
00041 private:
00042 Style_Salome();
00043
00044 public:
00045 virtual ~Style_Salome();
00046
00047 static void initialize( QtxResourceMgr* = 0, const QString& = QString() );
00048 static void apply();
00049 static void restore();
00050
00051 static bool isActive();
00052
00053 static Style_Model* model();
00054
00055 static void update();
00056
00057 virtual void polish( QApplication* );
00058 virtual void polish( QWidget* );
00059 virtual void unpolish( QWidget* );
00060 virtual void drawComplexControl( ComplexControl, const QStyleOptionComplex*,
00061 QPainter*, const QWidget* = 0 ) const;
00062
00063 virtual void drawControl( ControlElement, const QStyleOption*, QPainter*, const QWidget* ) const;
00064 virtual void drawPrimitive( PrimitiveElement, const QStyleOption*,
00065 QPainter*, const QWidget* = 0 ) const;
00066 virtual int pixelMetric( PixelMetric, const QStyleOption* = 0,
00067 const QWidget* = 0 ) const;
00068 virtual QSize sizeFromContents ( ContentsType, const QStyleOption*,
00069 const QSize&, const QWidget* = 0 ) const;
00070 virtual QPixmap standardPixmap( StandardPixmap, const QStyleOption*,
00071 const QWidget* = 0) const;
00072 virtual int styleHint( StyleHint, const QStyleOption* = 0,
00073 const QWidget* = 0, QStyleHintReturn* = 0 ) const;
00074 virtual QRect subControlRect( ComplexControl, const QStyleOptionComplex*,
00075 SubControl, const QWidget* = 0 ) const;
00076 virtual QRect subElementRect( SubElement, const QStyleOption*, const QWidget* = 0 ) const;
00077
00078 protected slots:
00079 QIcon standardIconImplementation( StandardPixmap, const QStyleOption* = 0,
00080 const QWidget* = 0 ) const;
00081 private:
00082 void updatePaletteColors();
00083 void updateAllWidgets( QApplication* );
00084 bool hasHover() const;
00085 void drawHoverRect( QPainter*, const QRect&, const QColor&, const double,
00086 const int, const bool ) const;
00087 void drawHandle( QPainter*, const QRect&, bool, bool = true ) const;
00088 void drawBackground( QPainter*, const QRect&, const QColor&, const bool,
00089 const bool = false, const bool = true ) const;
00090 void drawBorder( QPainter*, const QRect&, bool ) const;
00091
00092 QString titleText( const QString&, const int, const int, QFont& ) const;
00093
00094 private:
00095 static Style_Model* myModel;
00096 };
00097
00098 #endif // STYLE_SALOME_H