summaryrefslogtreecommitdiffabout
path: root/kabc/plugins/qtopia/resourceqtopia.h
Unidiff
Diffstat (limited to 'kabc/plugins/qtopia/resourceqtopia.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/qtopia/resourceqtopia.h35
1 files changed, 20 insertions, 15 deletions
diff --git a/kabc/plugins/qtopia/resourceqtopia.h b/kabc/plugins/qtopia/resourceqtopia.h
index bf9dd45..90ab1f4 100644
--- a/kabc/plugins/qtopia/resourceqtopia.h
+++ b/kabc/plugins/qtopia/resourceqtopia.h
@@ -36,6 +36,7 @@ $Id$
36 36
37#include "resource.h" 37#include "resource.h"
38 38
39class AddressBookAccess;
39 40
40namespace KABC { 41namespace KABC {
41 42
@@ -57,12 +58,12 @@ public:
57 58
58 @param cfg The config object where custom resource settings are stored. 59 @param cfg The config object where custom resource settings are stored.
59 */ 60 */
60 ResourceQtopia( const KConfig *cfg ); 61 ResourceQtopia( const KConfig *cfg, bool syncable );
61 62
62 /** 63 /**
63 Construct file resource on file @arg fileName using format @arg formatName. 64 Construct file resource on file @arg fileName using format @arg formatName.
64 */ 65 */
65 ResourceQtopia( const QString &fileName ); 66 ResourceQtopia( const QString &fileName, bool syncable );
66 67
67 /** 68 /**
68 * Destructor. 69 * Destructor.
@@ -84,7 +85,7 @@ public:
84 * Closes the file again. 85 * Closes the file again.
85 */ 86 */
86 virtual void doClose(); 87 virtual void doClose();
87 88
88 /** 89 /**
89 * Requests a save ticket, that is used by @ref save() 90 * Requests a save ticket, that is used by @ref save()
90 */ 91 */
@@ -105,26 +106,31 @@ public:
105 virtual bool save( Ticket *ticket ); 106 virtual bool save( Ticket *ticket );
106 107
107 /** 108 /**
109 * Remove a addressee from its source.
110 * This method is mainly called by KABC::AddressBook.
111 */
112 virtual void removeAddressee( const Addressee& addr );
113
114 /**
108 * Set name of file to be used for saving. 115 * Set name of file to be used for saving.
109 */ 116 */
110 void setFileName( const QString & ); 117 virtual void setFileName( const QString & );
111 118
112 /** 119 /**
113 * Return name of file used for loading and saving the address book. 120 * This method is called by an error handler if the application
121 * crashed
114 */ 122 */
115 QString fileName() const; 123 virtual void cleanUp();
116 124
117 /** 125 /**
118 * Remove a addressee from its source. 126 * This method returns the number of elements that are currently in the resource.
119 * This method is mainly called by KABC::AddressBook.
120 */ 127 */
121 virtual void removeAddressee( const Addressee& addr ); 128 virtual int count() const;
122 129
123 /** 130 /**
124 * This method is called by an error handler if the application 131 * This method removes all elements from the resource!! (Not from the addressbook)
125 * crashed
126 */ 132 */
127 virtual void cleanUp(); 133 virtual bool clear();
128 134
129protected slots: 135protected slots:
130 void fileChanged(); 136 void fileChanged();
@@ -136,12 +142,11 @@ protected:
136 void unlock( const QString &fileName ); 142 void unlock( const QString &fileName );
137 143
138private: 144private:
145 AddressBookAccess* mAccess;
139 QtopiaConverter* mConverter; 146 QtopiaConverter* mConverter;
140
141 QString mFileName;
142 147
143 QString mLockUniqueName; 148 QString mLockUniqueName;
144 149
145 KDirWatch mDirWatch; 150 KDirWatch mDirWatch;
146}; 151};
147 152