author | ulf69 <ulf69> | 2004-08-02 18:10:42 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-08-02 18:10:42 (UTC) |
commit | 09e8e7e5d4c3cafcf2b05511e5c78717fb5380e7 (patch) (unidiff) | |
tree | 4060a8dad4d840c92c62c16f9c51e733da51e33c /microkde/kresources/resource.h | |
parent | 7520e7cb4f10eb535efd457c539a15a0b7e52137 (diff) | |
download | kdepimpi-09e8e7e5d4c3cafcf2b05511e5c78717fb5380e7.zip kdepimpi-09e8e7e5d4c3cafcf2b05511e5c78717fb5380e7.tar.gz kdepimpi-09e8e7e5d4c3cafcf2b05511e5c78717fb5380e7.tar.bz2 |
add changes that resources can be used for syncing as well
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; | |||
39 | 39 | ||
40 | namespace KRES { | 40 | namespace KRES { |
41 | 41 | ||
42 | class ConfigWidget; | 42 | class ConfigWidget; |
43 | class SyncWidget; | ||
43 | 44 | ||
44 | /** | 45 | /** |
45 | * @internal | 46 | * @internal |
46 | * @libdoc The KDE Resource library | 47 | * @libdoc The KDE Resource library |
@@ -319,8 +320,13 @@ class Resource : public QObject | |||
319 | * Returns the name of resource. | 320 | * Returns the name of resource. |
320 | */ | 321 | */ |
321 | virtual QString resourceName() const; | 322 | virtual QString resourceName() const; |
322 | 323 | ||
324 | |||
325 | |||
326 | virtual bool isSyncable() const = 0; | ||
327 | |||
328 | |||
323 | /** | 329 | /** |
324 | Sets, if the resource is active. | 330 | Sets, if the resource is active. |
325 | */ | 331 | */ |
326 | void setActive( bool active ); | 332 | void setActive( bool active ); |
@@ -337,8 +343,9 @@ class Resource : public QObject | |||
337 | Print resource information as debug output. | 343 | Print resource information as debug output. |
338 | */ | 344 | */ |
339 | virtual void dump() const; | 345 | virtual void dump() const; |
340 | 346 | ||
347 | |||
341 | protected: | 348 | protected: |
342 | /** | 349 | /** |
343 | * Open this resource. When called, the resource must be in | 350 | * Open this resource. When called, the resource must be in |
344 | * a closed state. | 351 | * a closed state. |
@@ -366,33 +373,41 @@ class Resource : public QObject | |||
366 | 373 | ||
367 | class PluginFactoryBase : public KLibFactory | 374 | class PluginFactoryBase : public KLibFactory |
368 | { | 375 | { |
369 | public: | 376 | public: |
370 | virtual Resource *resource( const KConfig *config ) = 0; | 377 | virtual Resource *resource( const KConfig *config, bool syncable ) = 0; |
371 | 378 | ||
372 | virtual ConfigWidget *configWidget( QWidget *parent ) = 0; | 379 | virtual ConfigWidget *configWidget( QWidget *parent ) = 0; |
373 | 380 | ||
381 | virtual SyncWidget *syncWidget( QWidget *parent ) = 0; | ||
382 | |||
374 | protected: | 383 | protected: |
375 | virtual QObject* createObject( QObject*, const char*, const char*, | 384 | virtual QObject* createObject( QObject*, const char*, const char*, |
376 | const QStringList & ) | 385 | const QStringList & ) |
377 | { | 386 | { |
378 | return 0; | 387 | return 0; |
379 | } | 388 | } |
380 | }; | 389 | }; |
381 | 390 | ||
382 | template<class TR,class TC> | 391 | template<class TR,class TC, class TS> |
383 | class PluginFactory : public PluginFactoryBase | 392 | class PluginFactory : public PluginFactoryBase |
384 | { | 393 | { |
385 | public: | 394 | public: |
386 | Resource *resource( const KConfig *config ) | 395 | Resource *resource( const KConfig *config, bool syncable ) |
387 | { | 396 | { |
388 | return new TR( config ); | 397 | return new TR( config, syncable ); |
389 | } | 398 | } |
390 | 399 | ||
391 | ConfigWidget *configWidget( QWidget *parent ) | 400 | ConfigWidget *configWidget( QWidget *parent ) |
392 | { | 401 | { |
393 | return new TC( parent ); | 402 | return new TC( parent ); |
394 | } | 403 | } |
404 | |||
405 | virtual SyncWidget *syncWidget( QWidget *parent ) | ||
406 | { | ||
407 | return new TS( parent ); | ||
408 | } | ||
409 | |||
395 | }; | 410 | }; |
396 | 411 | ||
397 | 412 | ||
398 | 413 | ||