kresources
managerimpl.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef KRESOURCES_MANAGERIMPL_H
00024 #define KRESOURCES_MANAGERIMPL_H
00025
00026 #include <QtCore/QString>
00027
00028 #include "resource.h"
00029
00030 class KConfig;
00031
00032 namespace KRES {
00033
00034 class Resource;
00035 class ManagerNotifier;
00036
00042 class KRESOURCES_EXPORT ManagerImpl : public QObject
00043 {
00044 Q_OBJECT
00045 public:
00046 ManagerImpl( ManagerNotifier *, const QString &family );
00047 ~ManagerImpl();
00048
00049 void readConfig( KConfig * );
00050 void writeConfig( KConfig * );
00051
00052 void add( Resource *resource );
00053 void remove( Resource *resource );
00054 void change( Resource *resource );
00055
00056 Resource *standardResource();
00057 void setStandardResource( Resource *resource );
00058
00059 void setActive( Resource *resource, bool active );
00060
00061 Resource::List *resourceList();
00062
00063 QList<Resource *> resources();
00064
00065
00066 QList<Resource *> resources( bool active );
00067
00068 QStringList resourceNames();
00069
00070 static QString defaultConfigFile( const QString &family );
00071
00072 Q_SIGNALS:
00073 void signalKResourceAdded( QString managerId, QString resourceId );
00074 void signalKResourceModified( QString managerId, QString resourceId );
00075 void signalKResourceDeleted( QString managerId, QString resourceId );
00076
00077 private Q_SLOTS:
00078
00079 void dbusKResourceAdded( const QString& managerId,
00080 const QString& resourceId );
00081 void dbusKResourceModified( const QString& managerId,
00082 const QString& resourceId );
00083 void dbusKResourceDeleted( const QString& managerId,
00084 const QString& resourceId );
00085
00086 private:
00087 void createStandardConfig();
00088
00089 Resource *readResourceConfig( const QString& identifier, bool checkActive );
00090 void writeResourceConfig( Resource *resource, bool checkActive );
00091
00092 void removeResource( Resource *resource );
00093 Resource *getResource( Resource *resource );
00094 Resource *getResource( const QString& identifier );
00095
00096 class ManagerImplPrivate;
00097 ManagerImplPrivate *const d;
00098 };
00099
00100 }
00101
00102 #endif