summaryrefslogtreecommitdiffabout
path: root/kabc/resource.h
Side-by-side diff
Diffstat (limited to 'kabc/resource.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/resource.h66
1 files changed, 56 insertions, 10 deletions
diff --git a/kabc/resource.h b/kabc/resource.h
index c363125..db806a6 100644
--- a/kabc/resource.h
+++ b/kabc/resource.h
@@ -32,4 +32,7 @@ $Id$
+
#include "addressbook.h"
+class KSyncProfile;
+
namespace KABC {
@@ -38,3 +41,3 @@ namespace KABC {
* @short Helper class for handling coordinated save of address books.
- *
+ *
* This class is used as helper class for saving address book.
@@ -48,5 +51,5 @@ class Ticket
- private:
+ private:
Ticket( Resource *resource ) : mResource( resource ) {}
-
+
Resource *mResource;
@@ -59,2 +62,8 @@ class Resource : public KRES::Resource
{
+private:
+ /**
+ * make this constructor private to force everybody to use the other one
+ */
+ Resource( const KConfig *config);
+
public:
@@ -63,3 +72,3 @@ public:
*/
- Resource( const KConfig *config );
+ Resource( const KConfig *config, bool syncable );
@@ -90,7 +99,3 @@ public:
- /**
- * Close the resource and returns if it was successfully
- */
- virtual void doClose();
-
+
/**
@@ -100,3 +105,3 @@ public:
virtual Ticket *requestSaveTicket();
-
+
/**
@@ -119,2 +124,3 @@ public:
+
/**
@@ -125,4 +131,37 @@ public:
+
+ /**
+ * This method returns the number of elements that are currently in the resource.
+ */
+ virtual int count() const;
+
+ /**
+ * This method removes all elements from the resource!! (Not from the addressbook)
+ */
+ virtual bool clear();
+
+ /**
+ * Set name of file to be used for saving.
+ */
+ virtual void setFileName( const QString & );
+
+ /**
+ * Return name of file used for loading and saving the address book.
+ */
+ virtual QString fileName() const;
+
+
+ virtual bool isSyncable() const;
+
+ /**
+ * Set the name of resource.You can override this method,
+ * but also remember to call Resource::setResourceName().
+ */
+ virtual void setResourceName( const QString &name );
+
+
+
protected:
Ticket *createTicket( Resource * );
+ virtual void doClose();
@@ -130,5 +169,12 @@ private:
AddressBook *mAddressBook;
+ KSyncProfile *mSyncProfile;
+ QString mFileName;
+
};
+
}
+
+
+
#endif