Back to index

salome-gui  6.5.0
Style_Tools.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 // File   : Style_Tools.h
00021 // Author : Natalia Ermolaeva, Open CASCADE S.A.S.
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 // This class is private for Style package.
00035 // Normally it should not be exported.
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