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