1 // Copyright (C) 2014-2019 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 email : webmaster.salome@opencascade.com
20 #ifndef MODULEBASE_PAGEBASE_H_
21 #define MODULEBASE_PAGEBASE_H_
23 #include <ModuleBase.h>
24 #include <ModuleBase_Tools.h>
26 class ModuleBase_ModelWidget;
31 * Represent a property panel's list of ModuleBase_ModelWidgets
32 * or other pages widgets derived from ModuleBase_PageBase.
34 class MODULEBASE_EXPORT ModuleBase_PageBase
38 ModuleBase_PageBase();
39 /// Base virtual destructor.
40 virtual ~ModuleBase_PageBase();
41 /// Cast the page to regular QWidget
42 QWidget* pageWidget();
43 /// Adds the given ModuleBase_ModelWidget to the page
44 void addModelWidget(ModuleBase_ModelWidget* theWidget);
45 /// Adds the given ModuleBase_PageBase to the page
46 void addPageWidget(ModuleBase_PageBase* theWidget);
47 /// Adds the given widget to the page
48 void addWidget(QWidget* theWidget);
49 /// Removes all items from page's layout
51 /// Passes focus from page to the first ModuleBase_ModelWidget contained on the page
53 /// Returns list of ModuleBase_ModelWidgets contained on the page
54 QList<ModuleBase_ModelWidget*> modelWidgets() const;
55 /// Aligns top all widgets on page
59 /// Pure Virtual. Allows to derived class to lay out the widget properly;
60 virtual void placeModelWidget(ModuleBase_ModelWidget* theWidget) = 0;
61 /// Pure Virtual. Allows to derived class to lay out the page properly;
62 virtual void placePageWidget(ModuleBase_PageBase* theWidget);
63 /// Pure Virtual. Allows to derived class to lay out the page properly;
64 virtual void placeWidget(QWidget* theWidget) = 0;
65 /// Pure Virtual. Returns layout of the page.
66 virtual QLayout* pageLayout() = 0;
67 /// Pure Virtual. Allows to derived class to insert page stretch properly.
68 virtual void addPageStretch() = 0;
71 QList<ModuleBase_ModelWidget*> myWidgetList; ///< list of widgets contained on the page
75 #endif /* MODULEBASE_PAGEBASE_H_ */