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_PAGEDCONTAINER_H_
21 #define MODULEBASE_PAGEDCONTAINER_H_
23 #include <ModuleBase.h>
24 #include <ModuleBase_ModelWidget.h>
26 class ModuleBase_PageBase;
30 * This is an abstract interface to be used for not model container widget such as switch or tool box.
32 class MODULEBASE_EXPORT ModuleBase_PagedContainer : public ModuleBase_ModelWidget
37 /// \param theParent a parent widget
38 /// \param theData a data of the widget
39 ModuleBase_PagedContainer(QWidget* theParent, const Config_WidgetAPI* theData);
40 virtual ~ModuleBase_PagedContainer();
43 /// \param theWidget a page object
44 /// \param theName a name of the page
45 /// \param theCaseId an Id of the page
46 /// \param theIcon aqn Icon of the page
47 virtual int addPage( ModuleBase_PageBase* theWidget,
48 const QString& theName,
49 const QString& theCaseId,
50 const QPixmap& theIcon,
51 const QString& theTooltip);
53 /// Redefinition of virtual function
54 virtual QList<QWidget*> getControls() const;
56 /// Redefinition of virtual function
57 virtual bool focusTo();
59 /// Redefinition of virtual function
60 virtual void setHighlighted(bool isHighlighted);
62 /// Redefinition of virtual function
63 virtual void enableFocusProcessing();
65 /// The slot is called when user press Ok or OkPlus buttons in the parent property panel
66 virtual void onFeatureAccepted();
69 /// Returns index of current page
70 virtual int currentPageIndex() const = 0;
72 /// Set current page by index
73 virtual void setCurrentPageIndex(int ) = 0;
75 /// Redefinition of virtual function
76 virtual void activateCustom();
78 /// Redefinition of virtual function
79 virtual bool storeValueCustom();
81 /// Redefinition of virtual function
82 virtual bool restoreValueCustom();
84 // A flag which let to remeber last user choice and restore it on next launch
88 /// A slot called on page change
92 bool myIsFocusOnCurrentPage;
93 QStringList myCaseIds;
94 QList<ModuleBase_PageBase*> myPages;
96 std::string myDefValue;
99 #endif /* MODULEBASE_PAGEDCONTAINER_H_ */