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