Salome HOME
Issue #1368: Creation of a Qt panel. Code improvement.
[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   PartSet_WidgetFileSelector(QWidget* theParent,
33                              ModuleBase_IWorkshop* theWorkshop,
34                              const Config_WidgetAPI* theData);
35
36   virtual ~PartSet_WidgetFileSelector() {}
37
38 protected:
39   /// Reimplemented from ModuleBase_WidgetFileSelector::storeValueCustom()
40   virtual bool storeValueCustom() const;
41
42   /// Reimplemented from ModuleBase_WidgetFileSelector::restoreValue()
43   virtual bool restoreValueCustom();
44
45   /// Returns a full format string for the short format
46   QString shortFormatToFullFormat( const QString & theShortFormat ) const;
47
48 private:
49   ModuleBase_IWorkshop* myWorkshop; // the current workshop
50 };
51
52 #endif /* PARTSET_WIDGETFILESELECTOR_H_ */