summaryrefslogtreecommitdiffabout
path: root/microkde/kresources/resource.h
Unidiff
Diffstat (limited to 'microkde/kresources/resource.h') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kresources/resource.h25
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
@@ -37,12 +37,13 @@
37 37
38class KConfig; 38class KConfig;
39 39
40namespace KRES { 40namespace KRES {
41 41
42class ConfigWidget; 42class ConfigWidget;
43class SyncWidget;
43 44
44/** 45/**
45 * @internal 46 * @internal
46 * @libdoc The KDE Resource library 47 * @libdoc The KDE Resource library
47 * 48 *
48 * NOTE: this library is NOT (YET?) PUBLIC. Do not publish this 49 * NOTE: this library is NOT (YET?) PUBLIC. Do not publish this
@@ -317,12 +318,17 @@ class Resource : public QObject
317 318
318 /** 319 /**
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 );
327 333
328 /** 334 /**
@@ -335,12 +341,13 @@ class Resource : public QObject
335 341
336 /** 342 /**
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.
345 * 352 *
346 * Returns true if the resource was opened successfully; 353 * Returns true if the resource was opened successfully;
@@ -364,37 +371,45 @@ class Resource : public QObject
364 ResourcePrivate *d; 371 ResourcePrivate *d;
365}; 372};
366 373
367class PluginFactoryBase : public KLibFactory 374class 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
382template<class TR,class TC> 391template<class TR,class TC, class TS>
383class PluginFactory : public PluginFactoryBase 392class 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
399} 414}
400 415