1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
4 * ModuleBase_WidgetSwitch.h
6 * Created on: Apr 16, 2014
10 #ifndef MODULEBASE_WIDGETSWITCH_H_
11 #define MODULEBASE_WIDGETSWITCH_H_
13 #include <ModuleBase.h>
14 #include <ModuleBase_PagedContainer.h>
21 * Implements a model widget for switch as a container widget. It can be defined in XML with "switch" keyword
23 class MODULEBASE_EXPORT ModuleBase_WidgetSwitch : public ModuleBase_PagedContainer
28 /// \param parent a parent widget
29 ModuleBase_WidgetSwitch(QWidget* theParent,
30 const Config_WidgetAPI* theData,
31 const std::string& theParentId);
32 virtual ~ModuleBase_WidgetSwitch();
34 /// Defines if it is supported to set the value in this widget
35 /// It returns false because this is an info widget
36 virtual bool canSetValue() const { return false; };
38 /// Add a page to the widget
39 /// \param theWidget a page widget
40 /// \param theName a name of page
41 virtual int addPage(ModuleBase_PageBase* theWidget,
42 const QString& theName, const QString& theCaseId);
45 virtual int currentPageIndex() const;
46 /// Set current page by index
47 /// \param index index of the page
48 virtual void setCurrentPageIndex(int index);
53 QStackedLayout* myPagesLayout;
56 #endif /* ModuleBase_WidgetSwitch_H_ */