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 );
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();
66 /// Returns index of current page
67 virtual int currentPageIndex() const = 0;
69 /// Set current page by index
70 virtual void setCurrentPageIndex(int ) = 0;
72 /// Redefinition of virtual function
73 virtual void activateCustom();
75 /// Redefinition of virtual function
76 virtual bool storeValueCustom();
78 /// Redefinition of virtual function
79 virtual bool restoreValueCustom();
82 /// A slot called on page change
86 bool myIsFocusOnCurrentPage;
87 QStringList myCaseIds;
88 QList<ModuleBase_PageBase*> myPages;
92 #endif /* MODULEBASE_PAGEDCONTAINER_H_ */