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 theParent the parent object
29 /// \param theData the widget configuration. The attribute of the model widget is obtained from
30 /// \param theParentId is Id of a parent of the current attribute
31 ModuleBase_WidgetSwitch(QWidget* theParent,
32 const Config_WidgetAPI* theData,
33 const std::string& theParentId);
34 virtual ~ModuleBase_WidgetSwitch();
36 /// Defines if it is supported to set the value in this widget
37 /// It returns false because this is an info widget
38 virtual bool canSetValue() const { return false; };
40 /// Add a page to the widget
41 /// \param theWidget a page widget
42 /// \param theName a name of page
43 /// \param theCaseId an Id of the page
44 /// \param theIcon an icon of the page
45 virtual int addPage( ModuleBase_PageBase* theWidget,
46 const QString& theName,
47 const QString& theCaseId,
48 const QPixmap& theIcon );
51 /// Returns index of the current page
52 virtual int currentPageIndex() const;
54 /// Set current page by index
55 /// \param index index of the page
56 virtual void setCurrentPageIndex(int index);
61 QStackedLayout* myPagesLayout;
64 #endif /* ModuleBase_WidgetSwitch_H_ */