summaryrefslogtreecommitdiffabout
path: root/kabc/resource.h
authorulf69 <ulf69>2004-08-02 18:33:07 (UTC)
committer ulf69 <ulf69>2004-08-02 18:33:07 (UTC)
commit60a6886f06be31ec690df34dc8e3b8931c2d3bd7 (patch) (side-by-side diff)
treec4c7c15cfd3753a3342806a11fb8f5c20bb4f923 /kabc/resource.h
parent863c4c3678e59ef125c08c00e9532ded5b540f67 (diff)
downloadkdepimpi-60a6886f06be31ec690df34dc8e3b8931c2d3bd7.zip
kdepimpi-60a6886f06be31ec690df34dc8e3b8931c2d3bd7.tar.gz
kdepimpi-60a6886f06be31ec690df34dc8e3b8931c2d3bd7.tar.bz2
added support for syncable resources
Diffstat (limited to 'kabc/resource.h') (more/less context) (show whitespace changes)
-rw-r--r--kabc/resource.h56
1 files changed, 51 insertions, 5 deletions
diff --git a/kabc/resource.h b/kabc/resource.h
index c363125..db806a6 100644
--- a/kabc/resource.h
+++ b/kabc/resource.h
@@ -30,8 +30,11 @@ $Id$
#include <kresources/resource.h>
+
#include "addressbook.h"
+class KSyncProfile;
+
namespace KABC {
/**
@@ -57,11 +60,17 @@ class Ticket
*/
class Resource : public KRES::Resource
{
+private:
+ /**
+ * make this constructor private to force everybody to use the other one
+ */
+ Resource( const KConfig *config);
+
public:
/**
* Constructor
*/
- Resource( const KConfig *config );
+ Resource( const KConfig *config, bool syncable );
/**
* Destructor.
@@ -88,10 +97,6 @@ public:
*/
virtual bool doOpen();
- /**
- * Close the resource and returns if it was successfully
- */
- virtual void doClose();
/**
* Request a ticket, you have to pass through @ref save() to
@@ -117,18 +122,59 @@ public:
*/
virtual void removeAddressee( const Addressee& addr );
+
/**
* This method is called by an error handler if the application
* crashed
*/
virtual void cleanUp();
+
+ /**
+ * 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();
private:
AddressBook *mAddressBook;
+ KSyncProfile *mSyncProfile;
+ QString mFileName;
+
};
+
}
+
+
+
#endif