Salome HOME
Fix for the issue #1766 : treat face as equal with different orientation to find...
[modules/shaper.git] / src / ModuleBase / ModuleBase_PageBase.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2 /*
3  * ModuleBase_PageBase.h
4  *
5  *  Created on: Mar 4, 2015
6  *      Author: sbh
7  */
8
9 #ifndef MODULEBASE_PAGEBASE_H_
10 #define MODULEBASE_PAGEBASE_H_
11
12 #include <ModuleBase.h>
13 #include <ModuleBase_Tools.h>
14
15 class ModuleBase_ModelWidget;
16 class QLayout;
17 class QWidget;
18
19 /*!
20  * Represent a property panel's list of ModuleBase_ModelWidgets
21  * or other pages widgets derived from ModuleBase_PageBase.
22  */
23 class MODULEBASE_EXPORT ModuleBase_PageBase
24 {
25  public:
26   /// Base constructor.
27   ModuleBase_PageBase();
28   /// Base virtual destructor.
29   virtual ~ModuleBase_PageBase();
30   /// Cast the page to regular QWidget
31   QWidget* pageWidget();
32   /// Adds the given ModuleBase_ModelWidget to the page
33   void addModelWidget(ModuleBase_ModelWidget* theWidget);
34   /// Adds the given ModuleBase_PageBase to the page
35   void addPageWidget(ModuleBase_PageBase* theWidget);
36   /// Adds the given widget to the page
37   void addWidget(QWidget* theWidget);
38   /// Removes all items from page's layout
39   void clearPage();
40   /// Passes focus from page to the first ModuleBase_ModelWidget contained on the page
41   bool takeFocus();
42   /// Returns list of ModuleBase_ModelWidgets contained on the page
43   QList<ModuleBase_ModelWidget*> modelWidgets() const;
44   /// Aligns top all widgets on page
45   void alignToTop();
46
47  protected:
48   /// Pure Virtual. Allows to derived class to lay out the widget properly;
49   virtual void placeModelWidget(ModuleBase_ModelWidget* theWidget) = 0;
50   /// Pure Virtual. Allows to derived class to lay out the page properly;
51   virtual void placePageWidget(ModuleBase_PageBase* theWidget);
52   /// Pure Virtual. Allows to derived class to lay out the page properly;
53   virtual void placeWidget(QWidget* theWidget) = 0;
54   /// Pure Virtual. Returns layout of the page.
55   virtual QLayout* pageLayout() = 0;
56   /// Pure Virtual. Allows to derived class to insert page stretch properly.
57   virtual void addPageStretch() = 0;
58
59  private:
60   QList<ModuleBase_ModelWidget*> myWidgetList; ///< list of widgets contained on the page
61
62 };
63
64 #endif /* MODULEBASE_PAGEBASE_H_ */