Salome HOME
1. Correction for perfomance problem by Apply button state update: do not listen...
[modules/shaper.git] / src / ModuleBase / ModuleBase_PagedContainer.h
1 /*
2  * ModuleBase_PagedContainer.h
3  *
4  *  Created on: Mar 13, 2015
5  *      Author: sbh
6  */
7
8 #ifndef MODULEBASE_PAGEDCONTAINER_H_
9 #define MODULEBASE_PAGEDCONTAINER_H_
10
11 #include <ModuleBase.h>
12 #include <ModuleBase_ModelWidget.h>
13
14 class ModuleBase_PageBase;
15
16 /**
17 * \ingroup GUI
18 * This is an abstract interface to be used for not model container widget such as switch or tool box.
19 */
20 class MODULEBASE_EXPORT ModuleBase_PagedContainer : public ModuleBase_ModelWidget
21 {
22   Q_OBJECT
23  public:
24    /// A constructor
25    /// \param theParent a parent widget
26    /// \param theData a data of the widget
27   ModuleBase_PagedContainer(QWidget* theParent, const Config_WidgetAPI* theData);
28   virtual ~ModuleBase_PagedContainer();
29
30   /// Add a new page
31   /// \param theWidget a page object
32   /// \param theName a name of the page
33   /// \param theCaseId an Id of the page
34   /// \param theIcon aqn Icon of the page
35   virtual int addPage( ModuleBase_PageBase* theWidget,
36                        const QString& theName,
37                        const QString& theCaseId,
38                        const QPixmap& theIcon );
39
40   /// Redefinition of virtual function
41   virtual QList<QWidget*> getControls() const;
42
43   /// Redefinition of virtual function
44   virtual bool focusTo();
45
46   /// Redefinition of virtual function
47   virtual void setHighlighted(bool isHighlighted);
48
49   /// Redefinition of virtual function
50   virtual void enableFocusProcessing();
51
52  protected:
53    /// Returns index of current page
54   virtual int currentPageIndex() const = 0;
55
56   /// Set current page by index
57   virtual void setCurrentPageIndex(int ) = 0;
58
59   /// Redefinition of virtual function
60   virtual void activateCustom();
61
62   /// Redefinition of virtual function
63   virtual bool storeValueCustom();
64
65   /// Redefinition of virtual function
66   virtual bool restoreValueCustom();
67
68  protected slots:
69    /// A slot called on page change
70   void onPageChanged();
71
72  private:
73   bool myIsFocusOnCurrentPage;
74   QStringList myCaseIds;
75   QList<ModuleBase_PageBase*> myPages;
76
77 };
78
79 #endif /* MODULEBASE_PAGEDCONTAINER_H_ */