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_PAGEDCONTAINER_H_
22 #define MODULEBASE_PAGEDCONTAINER_H_
24 #include <ModuleBase.h>
25 #include <ModuleBase_ModelWidget.h>
27 class ModuleBase_PageBase;
31 * This is an abstract interface to be used for not model container widget such as switch or tool box.
33 class MODULEBASE_EXPORT ModuleBase_PagedContainer : public ModuleBase_ModelWidget
38 /// \param theParent a parent widget
39 /// \param theData a data of the widget
40 ModuleBase_PagedContainer(QWidget* theParent, const Config_WidgetAPI* theData);
41 virtual ~ModuleBase_PagedContainer();
44 /// \param theWidget a page object
45 /// \param theName a name of the page
46 /// \param theCaseId an Id of the page
47 /// \param theIcon aqn Icon of the page
48 virtual int addPage( ModuleBase_PageBase* theWidget,
49 const QString& theName,
50 const QString& theCaseId,
51 const QPixmap& theIcon,
52 const QString& theTooltip);
54 /// Redefinition of virtual function
55 virtual QList<QWidget*> getControls() const;
57 /// Redefinition of virtual function
58 virtual bool focusTo();
60 /// Redefinition of virtual function
61 virtual void setHighlighted(bool isHighlighted);
63 /// Redefinition of virtual function
64 virtual void enableFocusProcessing();
66 /// The slot is called when user press Ok or OkPlus buttons in the parent property panel
67 virtual void onFeatureAccepted();
70 /// Returns index of current page
71 virtual int currentPageIndex() const = 0;
73 /// Set current page by index
74 virtual void setCurrentPageIndex(int ) = 0;
76 /// Redefinition of virtual function
77 virtual void activateCustom();
79 /// Redefinition of virtual function
80 virtual bool storeValueCustom();
82 /// Redefinition of virtual function
83 virtual bool restoreValueCustom();
85 // A flag which let to remeber last user choice and restore it on next launch
89 /// A slot called on page change
93 bool myIsFocusOnCurrentPage;
94 QStringList myCaseIds;
95 QList<ModuleBase_PageBase*> myPages;
97 std::string myDefValue;
100 #endif /* MODULEBASE_PAGEDCONTAINER_H_ */