00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef STYLE_TOOLS_H
00024 #define STYLE_TOOLS_H
00025
00026 #include "Style.h"
00027
00028 #include <QPainterPath>
00029 #include <QRect>
00030 #include <QColor>
00031 #include <QStyle>
00032
00033
00034
00035
00036
00037 class STYLE_SALOME_EXPORT Style_Tools
00038 {
00039 public:
00041 typedef enum {
00042 None = 0x00000000,
00043 All = 0x00000001,
00044 Right = 0x00000002,
00045 Left = 0x00000004,
00046 TopLeft = 0x00000008,
00047 TopRight = 0x00000010,
00048 BottomLeft = 0x00000020,
00049 BottomRight = 0x00000040
00050 } RoundType;
00051
00053 typedef enum {
00054 WholePath,
00055 BottomPath,
00056 TopPath
00057 } ShadowType;
00058
00060 typedef enum {
00061 SlUp,
00062 SlDown,
00063 SlLeft,
00064 SlRight,
00065 SlNone
00066 } SliderType;
00067
00068 static QPainterPath painterPath( const QRect& );
00069 static QPainterPath substractPath( const QPainterPath&, const QPainterPath& );
00070
00071 static QPainterPath roundRect( const QRect&, const double, int = 0, int = 0 );
00072
00073 static void roundRect( QPainter*, const QRect&, const double, const int,
00074 const QColor&, const QColor&, bool = true, bool = true );
00075
00076 static void shadowRect( QPainter*, const QRect&, const double,
00077 const double, const int, int,
00078 const QColor&, const QColor&, const QColor&,
00079 const QColor&, const bool, const bool,
00080 const bool = false, const bool = true );
00081 static void shadowCheck( QPainter*, const QRect&, const double, const int,
00082 const QColor&, const QColor&,
00083 const QColor&, const QColor& );
00084 static void arrowRect( QPainter*, const QRect&, const QColor&,
00085 const QColor&, const QColor& );
00086 static void fillRect( QPainter*, const QRect&, const QColor&,
00087 const QColor&, const int = 255 );
00088 static void drawArrow( QStyle::PrimitiveElement, QPainter*, const QRect&,
00089 const QColor&, const QColor& );
00090 static void drawSign( QStyle::PrimitiveElement, QPainter*, const QRect&,
00091 const QColor&, const QColor& );
00092 static QPainterPath tabRect( QPainter*, const QRect&, const int, const double,
00093 const double, const QColor&, const QColor&,
00094 const QColor&, const QColor&,
00095 const bool, const bool, const bool,
00096 const bool = false, const bool = true );
00097 static void drawFocus( QPainter*, const QRect&, const double, const int,
00098 const QColor& );
00099 static void drawFocus( QPainter*, const QPainterPath&, const QColor&,
00100 const bool = true );
00101 static void drawSlider( QPainter*, const QRect&, const double,
00102 SliderType, const QColor&, const QColor&,
00103 const QColor&, const QColor& );
00104 static void highlightRect( QPainter*, const QRect&, const double, const int,
00105 const double, const QColor&, const QColor&,
00106 const QColor& );
00107 static int getMinDelta( const QRect&, const QSize&, const int );
00108 static int getMaxRect( const QRect&, const int );
00109 };
00110
00111 #endif // STYLE_TOOLS_H