Salome HOME
Issue #2278 Cannot validate a Sketch. Feature should be stored in cache, not result...
[modules/shaper.git] / src / PartSet / PartSet_WidgetFileSelector.h
1 // Copyright (C) 2014-2017  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #ifndef PARTSET_WIDGETFILESELECTOR_H_
22 #define PARTSET_WIDGETFILESELECTOR_H_
23
24 #include "PartSet.h"
25
26 #include <ModuleBase_WidgetFileSelector.h>
27
28 class ModuleBase_IWorkshop;
29
30 /**
31 * \ingroup Modules
32 * Customization of ModuleBase_WidgetFileSelector in order to write
33 * format of exported file.
34 */
35 class PARTSET_EXPORT PartSet_WidgetFileSelector : public ModuleBase_WidgetFileSelector
36 {
37   Q_OBJECT
38 public:
39   /// Constructor
40   /// \param theParent the parent object
41   /// \param theWorkshop instance of workshop interface
42   /// \param theData the widget configuration. The attribute of the model widget is obtained from
43   PartSet_WidgetFileSelector(QWidget* theParent,
44                              ModuleBase_IWorkshop* theWorkshop,
45                              const Config_WidgetAPI* theData);
46
47   virtual ~PartSet_WidgetFileSelector() {}
48
49 protected:
50   /// Reimplemented from ModuleBase_WidgetFileSelector::storeValueCustom()
51   virtual bool storeValueCustom();
52
53   /// Reimplemented from ModuleBase_WidgetFileSelector::restoreValue()
54   virtual bool restoreValueCustom();
55
56   /// Returns a full format string for the short format
57   QString shortFormatToFullFormat( const QString & theShortFormat ) const;
58
59 private:
60   ModuleBase_IWorkshop* myWorkshop; // the current workshop
61 };
62
63 #endif /* PARTSET_WIDGETFILESELECTOR_H_ */