2 * ModuleBase_WidgetMultiSelector.h
4 * Created on: Oct 8, 2014
8 #ifndef MODULEBASE_WIDGETMULTISELECTOR_H_
9 #define MODULEBASE_WIDGETMULTISELECTOR_H_
11 #include <ModuleBase.h>
12 #include <ModuleBase_ModelWidget.h>
14 #include <NCollection_List.hxx>
15 #include <TopoDS_Shape.hxx>
19 #include <QStringList>
24 class ModuleBase_IWorkshop;
26 class MODULEBASE_EXPORT ModuleBase_WidgetMultiSelector : public ModuleBase_ModelWidget
30 ModuleBase_WidgetMultiSelector(QWidget* theParent,
31 ModuleBase_IWorkshop* theWorkshop,
32 const Config_WidgetAPI* theData,
33 const std::string& theParentId);
34 virtual ~ModuleBase_WidgetMultiSelector();
36 /// Saves the internal parameters to the given feature
37 /// \param theObject a model feature to be changed
38 virtual bool storeValue() const;
40 virtual bool restoreValue();
42 /// Returns the internal parent wiget control, that can be shown anywhere
43 /// \returns the widget
44 QWidget* getControl() const;
46 /// Returns list of widget controls
47 /// \return a control list
48 virtual QList<QWidget*> getControls() const;
50 virtual bool eventFilter(QObject* theObj, QEvent* theEvent);
53 void activateSelection(bool toActivate);
54 void onSelectionTypeChanged();
55 void onSelectionChanged();
58 void filterShapes(const NCollection_List<TopoDS_Shape>& theShapesToFilter,
59 NCollection_List<TopoDS_Shape>& theResult);
62 QTextEdit* myListControl;
63 QComboBox* myTypeCombo;
64 QWidget* myMainWidget;
66 //TODO: Move into the base of selectors
67 ModuleBase_IWorkshop* myWorkshop;
69 /// If true then local selector has to be activated in context
70 QStringList myShapeTypes;
75 #endif /* MODULEBASE_WIDGETFILESELECTOR_H_ */