Salome HOME
The flushCreated/flushUpdated are obsolete and nobody uses them.
[modules/shaper.git] / src / ModuleBase / ModuleBase_Tools.h
index f326a9e5782211565f8dc80d358eca4eb9c2d4c9..1f55bec750a28fb7a9e5b04df2273543c3ff44e6 100644 (file)
@@ -1,25 +1,62 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
 // File:        ModuleBase_Tools.h
 // Created:     11 July 2014
 // Author:      Vitaly Smetannikov
 
-
 #ifndef ModuleBase_Tools_H
 #define ModuleBase_Tools_H
 
 #include "ModuleBase.h"
 
-#include <ModelAPI_Result.h>
+#include <QPixmap>
+
+class QWidget;
+class QLayout;
+class QDoubleSpinBox;
+
+namespace ModuleBase_Tools {
+
+/*
+ * Methods to adjust margins and spacings.
+ */
+MODULEBASE_EXPORT void adjustMargins(QWidget* theWidget);
+MODULEBASE_EXPORT void adjustMargins(QLayout* theLayout);
+
+MODULEBASE_EXPORT void zeroMargins(QWidget* theWidget);
+MODULEBASE_EXPORT void zeroMargins(QLayout* theLayout);
+
+
+/**
+ * \ingroup GUI
+ * Methods to modify a resource pixmap
+ */
+
+//! Create composite pixmap. 
+//! Pixmap \a theAdditionalIcon is drawn over pixmap \a dest with coordinates
+//! specified relatively to the upper left corner of \a theIcon.
+
+//! \param theAdditionalIcon resource text of the additional pixmap
+//! \param theIcon resource text of the background pixmap
+//! \return resulting pixmap
+MODULEBASE_EXPORT QPixmap composite(const QString& theAdditionalIcon, const QString& theIcon);
 
-class GeomAPI_Shape;
+//! Generates the pixmap lighter than the resources pixmap. 
+//! Pixmap \a theIcon is lighted according to the given value.
+//! If the lighter value is greater than 100, this functions returns a lighter pixmap.
+//! Setting lighter value to 150 returns a color that is 50% brighter. If the factor is less than 100,
+//! the return pixmap is darker. If the factor is 0 or negative, the return pixmap is unspecified.
 
-namespace ModuleBase_Tools 
-{
+//! \param resource text of the pixmap
+//! \param theLighterValue a lighter factor
+//! \return resulting pixmap
+MODULEBASE_EXPORT QPixmap lighter(const QString& theIcon, const int theLighterValue = 200);
 
-  /**
-  * Returns returns a shape if the result has a shape method. Otherwise returns NULL pointer
-  */
-  MODULEBASE_EXPORT boost::shared_ptr<GeomAPI_Shape> shape(ResultPtr theResult);
+/// Sets programmatically the value to the spin box without emitting any signals(e.g. valueChanged)
+/// \param theSpin an X or Y coordinate widget
+/// \param theValue a new value
+MODULEBASE_EXPORT void setSpinValue(QDoubleSpinBox* theSpin, double theValue);
 
-};
+}
 
-#endif
\ No newline at end of file
+#endif