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_Tools.h
23 // Author : Natalia Ermolaeva, Open CASCADE S.A.S.
30 #include <QPainterPath>
36 // This class is private for Style package.
37 // Normally it should not be exported.
39 class STYLE_SALOME_EXPORT Style_Tools
42 //! Rounding operation type
44 None = 0x00000000, //!< No rounding required
45 All = 0x00000001, //!< All corners
46 Right = 0x00000002, //!< Right corners
47 Left = 0x00000004, //!< Left corners
48 TopLeft = 0x00000008, //!< Top-left corner
49 TopRight = 0x00000010, //!< Top-right corner
50 BottomLeft = 0x00000020, //!< Bottom-left corner
51 BottomRight = 0x00000040 //!< Bottom-right corner
56 WholePath, //!< Whole path
57 BottomPath, //!< Bottom path
63 SlUp, //!< Up-to-down gradient
64 SlDown, //!< Down-to-up gradient
65 SlLeft, //!< Left-to-right gradient
66 SlRight, //!< Right-to-left gradient
67 SlNone //!< No gradient
70 static QPainterPath painterPath( const QRect& );
71 static QPainterPath substractPath( const QPainterPath&, const QPainterPath& );
73 static QPainterPath roundRect( const QRect&, const double, int = 0, int = 0 );
75 static void roundRect( QPainter*, const QRect&, const double, const int,
76 const QColor&, const QColor&, bool = true, bool = true );
78 static void shadowRect( QPainter*, const QRect&, const double,
79 const double, const int, int,
80 const QColor&, const QColor&, const QColor&,
81 const QColor&, const bool, const bool,
82 const bool = false, const bool = true );
83 static void shadowCheck( QPainter*, const QRect&, const double, const int,
84 const QColor&, const QColor&,
85 const QColor&, const QColor& );
86 static void arrowRect( QPainter*, const QRect&, const QColor&,
87 const QColor&, const QColor& );
88 static void fillRect( QPainter*, const QRect&, const QColor&,
89 const QColor&, const int = 255 );
90 static void drawArrow( QStyle::PrimitiveElement, QPainter*, const QRect&,
91 const QColor&, const QColor& );
92 static void drawSign( QStyle::PrimitiveElement, QPainter*, const QRect&,
93 const QColor&, const QColor& );
94 static QPainterPath tabRect( QPainter*, const QRect&, const int, const double,
95 const double, const QColor&, const QColor&,
96 const QColor&, const QColor&,
97 const bool, const bool, const bool,
98 const bool = false, const bool = true );
99 static void drawFocus( QPainter*, const QRect&, const double, const int,
101 static void drawFocus( QPainter*, const QPainterPath&, const QColor&,
103 static void drawSlider( QPainter*, const QRect&, const double,
104 SliderType, const QColor&, const QColor&,
105 const QColor&, const QColor& );
106 static void highlightRect( QPainter*, const QRect&, const double, const int,
107 const double, const QColor&, const QColor&,
109 static int getMinDelta( const QRect&, const QSize&, const int );
110 static int getMaxRect( const QRect&, const int );
113 #endif // STYLE_TOOLS_H