Salome HOME
Issue #273: Add copyright string
[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  * Methods to modify a resource pixmap
31  */
32 //! Create composite pixmap. 
33 //! Pixmap \a theAdditionalIcon is drawn over pixmap \a dest with coordinates
34 //! specified relatively to the upper left corner of \a theIcon.
35
36 //! \param theAdditionalIcon resource text of the additional pixmap
37 //! \param theIcon resource text of the background pixmap
38 //! \return resulting pixmap
39 MODULEBASE_EXPORT QPixmap composite(const QString& theAdditionalIcon, const QString& theIcon);
40
41 //! Generates the pixmap lighter than the resources pixmap. 
42 //! Pixmap \a theIcon is lighted according to the given value.
43 //! If the lighter value is greater than 100, this functions returns a lighter pixmap.
44 //! Setting lighter value to 150 returns a color that is 50% brighter. If the factor is less than 100,
45 //! the return pixmap is darker. If the factor is 0 or negative, the return pixmap is unspecified.
46
47 //! \param resource text of the pixmap
48 //! \param theLighterValue a lighter factor
49 //! \return resulting pixmap
50 MODULEBASE_EXPORT QPixmap lighter(const QString& theIcon, const int theLighterValue = 200);
51 }
52
53 #endif