Salome HOME
2aa97f143ad1f27e1aabe1d0d3f92bf5d3cc9061
[modules/gui.git] / src / LightApp / LightApp_Preferences.h
1 // Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA 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.
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/
18 //
19 // File:      LightApp_Preferences.h
20 // Author:    Sergey TELKOV
21
22 #ifndef LIGHTAPP_PREFERENCES_H
23 #define LIGHTAPP_PREFERENCES_H
24
25 #include <LightApp.h>
26
27 #include <QtxDialog.h>
28 #include <QtxListResourceEdit.h>
29
30 #include <qmap.h>
31
32 class QtxResourceMgr;
33
34 class LIGHTAPP_EXPORT LightApp_Preferences : public QtxListResourceEdit
35 {
36   Q_OBJECT
37
38 public:
39   LightApp_Preferences( QtxResourceMgr*, QWidget* = 0 );
40   virtual ~LightApp_Preferences();
41
42   int                  addPreference( const QString& label, const int pId = -1, const int = -1,
43                                       const QString& section = QString::null, const QString& param = QString::null );
44   int                  addPreference( const QString& modName, const QString& label, const int pId = -1, const int = -1,
45                                       const QString& section = QString::null, const QString& param = QString::null );
46
47   bool                 hasModule( const QString& ) const;
48
49 signals:
50   void                 preferenceChanged( QString&, QString&, QString& );
51
52 private slots:
53   void                 onHelp();
54   void                 onApply();
55   virtual void         changedResources( const QMap<Item*, QString>& );
56
57 private:
58   QString              module( const int ) const;
59
60 private:
61   typedef QMap<int, QString> PrefModuleMap;
62
63 private:
64   PrefModuleMap        myPrefMod;
65 };
66
67 #endif