Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Style_Tools.h
Go to the documentation of this file.
1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 // File : Style_Tools.h
21 // Author : Natalia Ermolaeva, Open CASCADE S.A.S.
22 //
23 #ifndef STYLE_TOOLS_H
24 #define STYLE_TOOLS_H
25 
26 #include "Style.h"
27 
28 #include <QPainterPath>
29 #include <QRect>
30 #include <QColor>
31 #include <QStyle>
32 
33 //
34 // This class is private for Style package.
35 // Normally it should not be exported.
36 //
38 {
39 public:
41  typedef enum {
42  None = 0x00000000,
43  All = 0x00000001,
44  Right = 0x00000002,
45  Left = 0x00000004,
46  TopLeft = 0x00000008,
47  TopRight = 0x00000010,
48  BottomLeft = 0x00000020,
49  BottomRight = 0x00000040
50  } RoundType;
51 
53  typedef enum {
56  TopPath
57  } ShadowType;
58 
60  typedef enum {
61  SlUp,
65  SlNone
66  } SliderType;
67 
68  static QPainterPath painterPath( const QRect& );
69  static QPainterPath substractPath( const QPainterPath&, const QPainterPath& );
70 
71  static QPainterPath roundRect( const QRect&, const double, int = 0, int = 0 );
72 
73  static void roundRect( QPainter*, const QRect&, const double, const int,
74  const QColor&, const QColor&, bool = true, bool = true );
75 
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,
98  const QColor& );
99  static void drawFocus( QPainter*, const QPainterPath&, const QColor&,
100  const bool = true );
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&,
106  const QColor& );
107  static int getMinDelta( const QRect&, const QSize&, const int );
108  static int getMaxRect( const QRect&, const int );
109 };
110 
111 #endif // STYLE_TOOLS_H