1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef MODULEBASE_PAGEBASE_H_
22 #define MODULEBASE_PAGEBASE_H_
24 #include <ModuleBase.h>
25 #include <ModuleBase_Tools.h>
27 class ModuleBase_ModelWidget;
32 * Represent a property panel's list of ModuleBase_ModelWidgets
33 * or other pages widgets derived from ModuleBase_PageBase.
35 class MODULEBASE_EXPORT ModuleBase_PageBase
39 ModuleBase_PageBase();
40 /// Base virtual destructor.
41 virtual ~ModuleBase_PageBase();
42 /// Cast the page to regular QWidget
43 QWidget* pageWidget();
44 /// Adds the given ModuleBase_ModelWidget to the page
45 void addModelWidget(ModuleBase_ModelWidget* theWidget);
46 /// Adds the given ModuleBase_PageBase to the page
47 void addPageWidget(ModuleBase_PageBase* theWidget);
48 /// Adds the given widget to the page
49 void addWidget(QWidget* theWidget);
50 /// Removes all items from page's layout
52 /// Passes focus from page to the first ModuleBase_ModelWidget contained on the page
54 /// Returns list of ModuleBase_ModelWidgets contained on the page
55 QList<ModuleBase_ModelWidget*> modelWidgets() const;
56 /// Aligns top all widgets on page
60 /// Pure Virtual. Allows to derived class to lay out the widget properly;
61 virtual void placeModelWidget(ModuleBase_ModelWidget* theWidget) = 0;
62 /// Pure Virtual. Allows to derived class to lay out the page properly;
63 virtual void placePageWidget(ModuleBase_PageBase* theWidget);
64 /// Pure Virtual. Allows to derived class to lay out the page properly;
65 virtual void placeWidget(QWidget* theWidget) = 0;
66 /// Pure Virtual. Returns layout of the page.
67 virtual QLayout* pageLayout() = 0;
68 /// Pure Virtual. Allows to derived class to insert page stretch properly.
69 virtual void addPageStretch() = 0;
72 QList<ModuleBase_ModelWidget*> myWidgetList; ///< list of widgets contained on the page
76 #endif /* MODULEBASE_PAGEBASE_H_ */