Diffstat (limited to 'microkde/kresources/resource.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | microkde/kresources/resource.h | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/microkde/kresources/resource.h b/microkde/kresources/resource.h index 64e7424..c9202c9 100644 --- a/microkde/kresources/resource.h +++ b/microkde/kresources/resource.h @@ -39,8 +39,9 @@ class KConfig; namespace KRES { class ConfigWidget; +class SyncWidget; /** * @internal * @libdoc The KDE Resource library @@ -319,8 +320,13 @@ class Resource : public QObject * Returns the name of resource. */ virtual QString resourceName() const; + + + virtual bool isSyncable() const = 0; + + /** Sets, if the resource is active. */ void setActive( bool active ); @@ -337,8 +343,9 @@ class Resource : public QObject Print resource information as debug output. */ virtual void dump() const; + protected: /** * Open this resource. When called, the resource must be in * a closed state. @@ -366,33 +373,41 @@ class Resource : public QObject class PluginFactoryBase : public KLibFactory { public: - virtual Resource *resource( const KConfig *config ) = 0; + virtual Resource *resource( const KConfig *config, bool syncable ) = 0; virtual ConfigWidget *configWidget( QWidget *parent ) = 0; + virtual SyncWidget *syncWidget( QWidget *parent ) = 0; + protected: virtual QObject* createObject( QObject*, const char*, const char*, const QStringList & ) { return 0; } }; -template<class TR,class TC> +template<class TR,class TC, class TS> class PluginFactory : public PluginFactoryBase { public: - Resource *resource( const KConfig *config ) + Resource *resource( const KConfig *config, bool syncable ) { - return new TR( config ); + return new TR( config, syncable ); } - + ConfigWidget *configWidget( QWidget *parent ) { return new TC( parent ); } + + virtual SyncWidget *syncWidget( QWidget *parent ) + { + return new TS( parent ); + } + }; |