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 email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 * ModuleBase_PageBase.h
23 * Created on: Mar 4, 2015
27 #ifndef MODULEBASE_PAGEBASE_H_
28 #define MODULEBASE_PAGEBASE_H_
30 #include <ModuleBase.h>
31 #include <ModuleBase_Tools.h>
33 class ModuleBase_ModelWidget;
38 * Represent a property panel's list of ModuleBase_ModelWidgets
39 * or other pages widgets derived from ModuleBase_PageBase.
41 class MODULEBASE_EXPORT ModuleBase_PageBase
45 ModuleBase_PageBase();
46 /// Base virtual destructor.
47 virtual ~ModuleBase_PageBase();
48 /// Cast the page to regular QWidget
49 QWidget* pageWidget();
50 /// Adds the given ModuleBase_ModelWidget to the page
51 void addModelWidget(ModuleBase_ModelWidget* theWidget);
52 /// Adds the given ModuleBase_PageBase to the page
53 void addPageWidget(ModuleBase_PageBase* theWidget);
54 /// Adds the given widget to the page
55 void addWidget(QWidget* theWidget);
56 /// Removes all items from page's layout
58 /// Passes focus from page to the first ModuleBase_ModelWidget contained on the page
60 /// Returns list of ModuleBase_ModelWidgets contained on the page
61 QList<ModuleBase_ModelWidget*> modelWidgets() const;
62 /// Aligns top all widgets on page
66 /// Pure Virtual. Allows to derived class to lay out the widget properly;
67 virtual void placeModelWidget(ModuleBase_ModelWidget* theWidget) = 0;
68 /// Pure Virtual. Allows to derived class to lay out the page properly;
69 virtual void placePageWidget(ModuleBase_PageBase* theWidget);
70 /// Pure Virtual. Allows to derived class to lay out the page properly;
71 virtual void placeWidget(QWidget* theWidget) = 0;
72 /// Pure Virtual. Returns layout of the page.
73 virtual QLayout* pageLayout() = 0;
74 /// Pure Virtual. Allows to derived class to insert page stretch properly.
75 virtual void addPageStretch() = 0;
78 QList<ModuleBase_ModelWidget*> myWidgetList; ///< list of widgets contained on the page
82 #endif /* MODULEBASE_PAGEBASE_H_ */