Salome HOME
Issue #529 : 4.07. Import IGES, export to BREP, STEP, IGES - Export IGES with versions
[modules/shaper.git] / src / PartSet / PartSet_WidgetFileSelector.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 /*
4  * PartSet_WidgetFileSelector.h
5  *
6  *  Created on: May 18, 2015
7  *      Author: spo
8  */
9
10 #ifndef PARTSET_WIDGETFILESELECTOR_H_
11 #define PARTSET_WIDGETFILESELECTOR_H_
12
13 #include "PartSet.h"
14
15 #include <ModuleBase_WidgetFileSelector.h>
16
17 class ModuleBase_IWorkshop;
18
19 /**
20 * \ingroup Modules
21 * Customization of ModuleBase_WidgetFileSelector in order to write
22 * format of exported file.
23 */
24 class PARTSET_EXPORT PartSet_WidgetFileSelector : public ModuleBase_WidgetFileSelector
25 {
26   Q_OBJECT
27 public:
28   /// Constructor
29   /// \param theParent the parent object
30   /// \param theWorkshop instance of workshop interface
31   /// \param theData the widget configuration. The attribute of the model widget is obtained from
32   /// \param theParentId is Id of a parent of the current attribute
33   PartSet_WidgetFileSelector(QWidget* theParent,
34                              ModuleBase_IWorkshop* theWorkshop,
35                              const Config_WidgetAPI* theData,
36                              const std::string& theParentId);
37
38   virtual ~PartSet_WidgetFileSelector() {}
39
40   /// Reimplemented from ModuleBase_WidgetFileSelector::restoreValue()
41   virtual bool restoreValue();
42
43 protected:
44   /// Reimplemented from ModuleBase_WidgetFileSelector::storeValueCustom()
45   virtual bool storeValueCustom() const;
46
47   /// Returns a short format string of theFilter string
48   static QString filterToShortFormat( const QString & theFilter );
49
50   /// Returns a full format string for the short format
51   QString shortFormatToFullFormat( const QString & theShortFormat ) const;
52
53 private:
54   ModuleBase_IWorkshop* myWorkshop; // the current workshop
55 };
56
57 #endif /* PARTSET_WIDGETFILESELECTOR_H_ */