Salome HOME
Remove obsolete code
[modules/gui.git] / src / SalomeApp / SalomeApp_Preferences.h
1 // File:      SalomeApp_Preferences.h
2 // Author:    Sergey TELKOV
3
4 #ifndef SALOMEAPP_PREFERENCES_H
5 #define SALOMEAPP_PREFERENCES_H
6
7 #include <SalomeApp.h>
8
9 #include <QtxDialog.h>
10 #include <QtxListResourceEdit.h>
11
12 #include <qmap.h>
13
14 class QtxResourceMgr;
15
16 class SALOMEAPP_EXPORT SalomeApp_Preferences : public QtxListResourceEdit
17 {
18   Q_OBJECT
19
20 public:
21   enum { Space = QtxListResourceEdit::Space, Bool, Color, String, Selector, DblSpin, IntSpin, Double, Integer };
22
23 public:
24   SalomeApp_Preferences( QtxResourceMgr*, QWidget* = 0 );
25   virtual ~SalomeApp_Preferences();
26
27   int                  addPreference( const QString& label, const int pId = -1, const int = -1,
28                                       const QString& section = QString::null, const QString& param = QString::null );
29   int                  addPreference( const QString& modName, const QString& label, const int pId = -1, const int = -1,
30                                       const QString& section = QString::null, const QString& param = QString::null );
31
32   QVariant             property( const int, const QString& ) const;
33   virtual void         setProperty( const int, const QString&, const QVariant& );
34
35   bool                 hasModule( const QString& ) const;
36
37 signals:
38   void                 preferenceChanged( QString&, QString&, QString& );
39
40 private slots:
41   void                 onHelp();
42   void                 onApply();
43   virtual void         changedResources( const QMap<Item*, QString>& );
44
45 private:
46   QString              module( const int ) const;
47
48 private:
49   typedef QMap<int, QString> PrefModuleMap;
50
51 private:
52   PrefModuleMap        myPrefMod;
53 };
54
55 #endif