1 // Copyright (C) 2007-2015 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, or (at your option) any later version.
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_Tools.h
21 // Author : Natalia Ermolaeva, Open CASCADE S.A.S.
28 #include <QPainterPath>
34 // This class is private for Style package.
35 // Normally it should not be exported.
37 class STYLE_SALOME_EXPORT Style_Tools
40 //! Rounding operation type
42 None = 0x00000000, //!< No rounding required
43 All = 0x00000001, //!< All corners
44 Right = 0x00000002, //!< Right corners
45 Left = 0x00000004, //!< Left corners
46 TopLeft = 0x00000008, //!< Top-left corner
47 TopRight = 0x00000010, //!< Top-right corner
48 BottomLeft = 0x00000020, //!< Bottom-left corner
49 BottomRight = 0x00000040 //!< Bottom-right corner
54 WholePath, //!< Whole path
55 BottomPath, //!< Bottom path
61 SlUp, //!< Up-to-down gradient
62 SlDown, //!< Down-to-up gradient
63 SlLeft, //!< Left-to-right gradient
64 SlRight, //!< Right-to-left gradient
65 SlNone //!< No gradient
68 static QPainterPath painterPath( const QRect& );
69 static QPainterPath substractPath( const QPainterPath&, const QPainterPath& );
71 static QPainterPath roundRect( const QRect&, const double, int = 0, int = 0 );
73 static void roundRect( QPainter*, const QRect&, const double, const int,
74 const QColor&, const QColor&, bool = true, bool = true );
76 static void shadowRect( QPainter*, const QRect&, const double,
77 const double, const int, int,
78 const QColor&, const QColor&, const QColor&,
79 const QColor&, const bool, const bool,
80 const bool = false, const bool = true );
81 static void shadowCheck( QPainter*, const QRect&, const double, const int,
82 const QColor&, const QColor&,
83 const QColor&, const QColor& );
84 static void arrowRect( QPainter*, const QRect&, const QColor&,
85 const QColor&, const QColor& );
86 static void fillRect( QPainter*, const QRect&, const QColor&,
87 const QColor&, const int = 255 );
88 static void drawArrow( QStyle::PrimitiveElement, QPainter*, const QRect&,
89 const QColor&, const QColor& );
90 static void drawSign( QStyle::PrimitiveElement, QPainter*, const QRect&,
91 const QColor&, const QColor& );
92 static QPainterPath tabRect( QPainter*, const QRect&, const int, const double,
93 const double, const QColor&, const QColor&,
94 const QColor&, const QColor&,
95 const bool, const bool, const bool,
96 const bool = false, const bool = true );
97 static void drawFocus( QPainter*, const QRect&, const double, const int,
99 static void drawFocus( QPainter*, const QPainterPath&, const QColor&,
101 static void drawSlider( QPainter*, const QRect&, const double,
102 SliderType, const QColor&, const QColor&,
103 const QColor&, const QColor& );
104 static void highlightRect( QPainter*, const QRect&, const double, const int,
105 const double, const QColor&, const QColor&,
107 static int getMinDelta( const QRect&, const QSize&, const int );
108 static int getMaxRect( const QRect&, const int );
111 #endif // STYLE_TOOLS_H