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 "resource.h"
00027 #include <QtCore/QString>
00028
00029 class KConfig;
00030
00031 namespace KRES {
00032
00033 class Resource;
00034 class ManagerNotifier;
00035
00041 class KRESOURCES_EXPORT ManagerImpl : public QObject
00042 {
00043 Q_OBJECT
00044 public:
00045 ManagerImpl( ManagerNotifier *, const QString &family );
00046 ~ManagerImpl();
00047
00048 void readConfig( KConfig * );
00049 void writeConfig( KConfig * );
00050
00051 void add( Resource *resource );
00052 void remove( Resource *resource );
00053 void change( Resource *resource );
00054
00055 Resource *standardResource();
00056 void setStandardResource( Resource *resource );
00057
00058 void setActive( Resource *resource, bool active );
00059
00060 Resource::List *resourceList();
00061
00062 QList<Resource *> resources();
00063
00064
00065 QList<Resource *> resources( bool active );
00066
00067 QStringList resourceNames();
00068
00069 static QString defaultConfigFile( const QString &family );
00070
00071 Q_SIGNALS:
00072 void signalKResourceAdded( QString managerId, QString resourceId );
00073 void signalKResourceModified( QString managerId, QString resourceId );
00074 void signalKResourceDeleted( QString managerId, QString resourceId );
00075
00076 private Q_SLOTS:
00077
00078 void dbusKResourceAdded( const QString &managerId,
00079 const QString &resourceId );
00080 void dbusKResourceModified( const QString &managerId,
00081 const QString &resourceId );
00082 void dbusKResourceDeleted( const QString &managerId,
00083 const QString &resourceId );
00084
00085 private:
00086 void createStandardConfig();
00087
00088 Resource *readResourceConfig( const QString &identifier, bool checkActive );
00089 void writeResourceConfig( Resource *resource, bool checkActive );
00090
00091 void removeResource( Resource *resource );
00092 Resource *getResource( Resource *resource );
00093 Resource *getResource( const QString &identifier );
00094
00095 class ManagerImplPrivate;
00096 ManagerImplPrivate *const d;
00097 };
00098
00099 }
00100
00101 #endif