Salome HOME
Issue #1834: Fix length of lines
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetToolbox.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2 /*
3  * ModuleBase_WidgetToolbox.h
4  *
5  *  Created on: Feb 27, 2015
6  *      Author: sbh
7  */
8
9 #ifndef MODULEBASE_WIDGETTOOLBOX_H_
10 #define MODULEBASE_WIDGETTOOLBOX_H_
11
12 #include <ModuleBase.h>
13 #include <ModuleBase_PagedContainer.h>
14
15 class ModuleBase_PageBase;
16 class ModuleBase_ToolBox;
17
18 /**
19 * \ingroup GUI
20 * Implements a model widget for switch as a container widget. It can be defined in XML with "toolbox" keyword
21 */
22 class MODULEBASE_EXPORT ModuleBase_WidgetToolbox : public ModuleBase_PagedContainer
23 {
24   Q_OBJECT
25  public:
26   /// Constructor
27   /// \param theParent the parent object
28   /// \param theData the widget configuration. The attribute of the model widget is obtained from
29   ModuleBase_WidgetToolbox(QWidget* theParent, const Config_WidgetAPI* theData);
30   virtual ~ModuleBase_WidgetToolbox();
31
32   /// Defines if it is supported to set the value in this widget
33   /// \return false because this is an info widget
34   virtual bool canAcceptFocus() const { return false; };
35
36   /// Add a page to the widget
37   /// \param theWidget a page widget
38   /// \param theName a name of page
39   /// \param theCaseId an Id of the page
40   /// \param theIcon an icon of the page
41   virtual int addPage( ModuleBase_PageBase* theWidget,
42                        const QString& theName,
43                        const QString& theCaseId,
44                        const QPixmap& theIcon );
45
46  protected:
47   /// Implements ModuleBase_PagedContainer
48   virtual int currentPageIndex() const;
49
50   /// Implements ModuleBase_PagedContainer
51   virtual void setCurrentPageIndex(int);
52
53  private:
54   ModuleBase_ToolBox* myToolBox;
55 };
56
57 #endif /* MODULEBASE_WIDGETTOOLBOX_H_ */