1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File : Style_Salome.h
21 // Author : Natalia Ermolaeva, Open CASCADE S.A.S.
23 #ifndef STYLE_SALOME_H
24 #define STYLE_SALOME_H
28 #include <QWindowsStyle>
37 class STYLE_SALOME_EXPORT Style_Salome : public QWindowsStyle
45 virtual ~Style_Salome();
47 static void initialize( QtxResourceMgr* = 0, const QString& = QString() );
49 static void restore();
51 static bool isActive();
53 static Style_Model* model();
57 virtual void polish( QApplication* );
58 virtual void polish( QWidget* );
59 virtual void unpolish( QWidget* );
60 virtual void drawComplexControl( ComplexControl, const QStyleOptionComplex*,
61 QPainter*, const QWidget* = 0 ) const;
63 virtual void drawControl( ControlElement, const QStyleOption*, QPainter*, const QWidget* ) const;
64 virtual void drawPrimitive( PrimitiveElement, const QStyleOption*,
65 QPainter*, const QWidget* = 0 ) const;
66 virtual int pixelMetric( PixelMetric, const QStyleOption* = 0,
67 const QWidget* = 0 ) const;
68 virtual QSize sizeFromContents ( ContentsType, const QStyleOption*,
69 const QSize&, const QWidget* = 0 ) const;
70 virtual QPixmap standardPixmap( StandardPixmap, const QStyleOption*,
71 const QWidget* = 0) const;
72 virtual int styleHint( StyleHint, const QStyleOption* = 0,
73 const QWidget* = 0, QStyleHintReturn* = 0 ) const;
74 virtual QRect subControlRect( ComplexControl, const QStyleOptionComplex*,
75 SubControl, const QWidget* = 0 ) const;
76 virtual QRect subElementRect( SubElement, const QStyleOption*, const QWidget* = 0 ) const;
79 QIcon standardIconImplementation( StandardPixmap, const QStyleOption* = 0,
80 const QWidget* = 0 ) const;
82 void updatePaletteColors();
83 void updateAllWidgets( QApplication* );
84 bool hasHover() const;
85 void drawHoverRect( QPainter*, const QRect&, const QColor&, const double,
86 const int, const bool ) const;
87 void drawHandle( QPainter*, const QRect&, bool, bool = true ) const;
88 void drawBackground( QPainter*, const QRect&, const QColor&, const bool,
89 const bool = false, const bool = true ) const;
90 void drawBorder( QPainter*, const QRect&, bool ) const;
92 QString titleText( const QString&, const int, const int, QFont& ) const;
95 static Style_Model* myModel;
98 #endif // STYLE_SALOME_H