summaryrefslogtreecommitdiffabout
path: root/microkde/kresources/managerimpl.h
Unidiff
Diffstat (limited to 'microkde/kresources/managerimpl.h') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kresources/managerimpl.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/microkde/kresources/managerimpl.h b/microkde/kresources/managerimpl.h
index a049bcc..0425279 100644
--- a/microkde/kresources/managerimpl.h
+++ b/microkde/kresources/managerimpl.h
@@ -12,24 +12,31 @@
12 12
13 This library is distributed in the hope that it will be useful, 13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Library General Public License for more details. 16 Library General Public License for more details.
17 17
18 You should have received a copy of the GNU Library General Public License 18 You should have received a copy of the GNU Library General Public License
19 along with this library; see the file COPYING.LIB. If not, write to 19 along with this library; see the file COPYING.LIB. If not, write to
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. 21 Boston, MA 02111-1307, USA.
22*/ 22*/
23 23
24/*
25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk
27
28$Id$
29*/
30
24#ifndef KRESOURCES_MANAGERIMPL_H 31#ifndef KRESOURCES_MANAGERIMPL_H
25#define KRESOURCES_MANAGERIMPL_H 32#define KRESOURCES_MANAGERIMPL_H
26 33
27#include <qstring.h> 34#include <qstring.h>
28#include <qptrlist.h> 35#include <qptrlist.h>
29#include <qdict.h> 36#include <qdict.h>
30//US 37//US
31#include <qobject.h> 38#include <qobject.h>
32 39
33#include "resource.h" 40#include "resource.h"
34 41
35 42
@@ -49,65 +56,71 @@ class ManagerImplListener
49}; 56};
50 57
51 58
52/** 59/**
53 @internal 60 @internal
54 61
55 Do not use this class directly. Use ResourceManager instead 62 Do not use this class directly. Use ResourceManager instead
56*/ 63*/
57class ManagerImpl : public QObject 64class ManagerImpl : public QObject
58{ 65{
59 Q_OBJECT 66 Q_OBJECT
60 public: 67 public:
61 ManagerImpl( const QString &family ); 68 ManagerImpl( const QString &family, bool syncable);
62 ~ManagerImpl(); 69 ~ManagerImpl();
63 70
64 void readConfig( KConfig * ); 71 void readConfig( KConfig * );
65 void writeConfig( KConfig * ); 72 void writeConfig( KConfig * );
66 73
67 void add( Resource *resource, bool useDCOP = true ); 74 void add( Resource *resource, bool useDCOP = true );
68 void remove( Resource *resource, bool useDCOP = true ); 75 void remove( Resource *resource, bool useDCOP = true );
69 76
70 Resource *standardResource(); 77 Resource *standardResource();
71 void setStandardResource( Resource *resource ); 78 void setStandardResource( Resource *resource );
72 79
73 void setActive( Resource *resource, bool active ); 80 void setActive( Resource *resource, bool active );
74 81
75 Resource::List *resourceList(); 82 Resource::List *resourceList();
76 83
77 QPtrList<Resource> resources(); 84 QPtrList<Resource> resources();
78 85
79 // Get only active or passive resources 86 // Get only active or passive resources
80 QPtrList<Resource> resources( bool active ); 87 QPtrList<Resource> resources( bool active );
81 88
82 QStringList resourceNames(); 89 QStringList resourceNames();
83 90
84 void setListener( ManagerImplListener *listener ); 91 void setListener( ManagerImplListener *listener );
85 92
93 /**
94 Return true, if the manager manages syncable resources.
95 */
96 bool manageSyncable() const;
97
86 public slots: 98 public slots:
87 void resourceChanged( Resource *resource ); 99 void resourceChanged( Resource *resource );
88 100
89 private: 101 private:
90 // dcop calls 102 // dcop calls
91 103
92 private: 104 private:
93 void createStandardConfig(); 105 void createStandardConfig();
94 106
95 Resource *readResourceConfig( const QString& identifier, bool checkActive ); 107 Resource *readResourceConfig( const QString& identifier, bool checkActive );
96 void writeResourceConfig( Resource *resource, bool checkActive ); 108 void writeResourceConfig( Resource *resource, bool checkActive );
97 109
98 void removeResource( Resource *resource ); 110 void removeResource( Resource *resource );
99 Resource *getResource( Resource *resource ); 111 Resource *getResource( Resource *resource );
100 Resource *getResource( const QString& identifier ); 112 Resource *getResource( const QString& identifier );
101 113
102 QString mFamily; 114 QString mFamily;
115 bool mSyncable;
103 KConfig *mConfig; 116 KConfig *mConfig;
104 KConfig *mStdConfig; 117 KConfig *mStdConfig;
105 Resource *mStandard; 118 Resource *mStandard;
106 Factory *mFactory; 119 Factory *mFactory;
107 Resource::List mResources; 120 Resource::List mResources;
108 ManagerImplListener *mListener; 121 ManagerImplListener *mListener;
109}; 122};
110 123
111} 124}
112 125
113#endif 126#endif