Salome HOME
Merge branch 'Dev_0.7.1' of newgeom:newgeom.git into Dev_0.7.1
[modules/shaper.git] / src / ModuleBase / ModuleBase_Tools.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModuleBase_Tools.h
4 // Created:     11 July 2014
5 // Author:      Vitaly Smetannikov
6
7 #ifndef ModuleBase_Tools_H
8 #define ModuleBase_Tools_H
9
10 #include "ModuleBase.h"
11
12 #include <QPixmap>
13
14 class QWidget;
15 class QLayout;
16
17 namespace ModuleBase_Tools {
18
19 /*
20  * Methods to adjust margins and spacings.
21  */
22 MODULEBASE_EXPORT void adjustMargins(QWidget* theWidget);
23 MODULEBASE_EXPORT void adjustMargins(QLayout* theLayout);
24
25 MODULEBASE_EXPORT void zeroMargins(QWidget* theWidget);
26 MODULEBASE_EXPORT void zeroMargins(QLayout* theLayout);
27
28
29 /**
30  * \ingroup GUI
31  * Methods to modify a resource pixmap
32  */
33
34 //! Create composite pixmap. 
35 //! Pixmap \a theAdditionalIcon is drawn over pixmap \a dest with coordinates
36 //! specified relatively to the upper left corner of \a theIcon.
37
38 //! \param theAdditionalIcon resource text of the additional pixmap
39 //! \param theIcon resource text of the background pixmap
40 //! \return resulting pixmap
41 MODULEBASE_EXPORT QPixmap composite(const QString& theAdditionalIcon, const QString& theIcon);
42
43 //! Generates the pixmap lighter than the resources pixmap. 
44 //! Pixmap \a theIcon is lighted according to the given value.
45 //! If the lighter value is greater than 100, this functions returns a lighter pixmap.
46 //! Setting lighter value to 150 returns a color that is 50% brighter. If the factor is less than 100,
47 //! the return pixmap is darker. If the factor is 0 or negative, the return pixmap is unspecified.
48
49 //! \param resource text of the pixmap
50 //! \param theLighterValue a lighter factor
51 //! \return resulting pixmap
52 MODULEBASE_EXPORT QPixmap lighter(const QString& theIcon, const int theLighterValue = 200);
53 }
54
55 #endif