Salome HOME
Fix SketcherSetEqual.test_length_equality
[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   ModuleBase_PagedContainer(QWidget* theParent, const Config_WidgetAPI* theData,
25                            const std::string& theParentId);
26   virtual ~ModuleBase_PagedContainer();
27
28   virtual int addPage( ModuleBase_PageBase* theWidget,
29                        const QString& theName,
30                        const QString& theCaseId,
31                        const QPixmap& theIcon );
32
33   // ModuleBase_ModelWidget
34   virtual QList<QWidget*> getControls() const;
35   virtual bool focusTo();
36   virtual void setHighlighted(bool isHighlighted);
37   virtual void enableFocusProcessing();
38
39  protected:
40   virtual int currentPageIndex() const = 0;
41   virtual void setCurrentPageIndex(int ) = 0;
42   // ModuleBase_ModelWidget
43   virtual void activateCustom();
44   virtual bool storeValueCustom() const;
45   virtual bool restoreValueCustom();
46
47  protected slots:
48   void onPageChanged();
49
50  private:
51   bool myIsFocusOnCurrentPage;
52   QStringList myCaseIds;
53   QList<ModuleBase_PageBase*> myPages;
54
55 };
56
57 #endif /* MODULEBASE_PAGEDCONTAINER_H_ */