Diffstat (limited to 'kabc/plugins/qtopia/resourceqtopia.h') (more/less context) (show whitespace changes)
-rw-r--r-- | kabc/plugins/qtopia/resourceqtopia.h | 31 |
1 files changed, 18 insertions, 13 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 | |||
@@ -33,12 +33,13 @@ $Id$ | |||
33 | #include <kdirwatch.h> | 33 | #include <kdirwatch.h> |
34 | 34 | ||
35 | #include <sys/types.h> | 35 | #include <sys/types.h> |
36 | 36 | ||
37 | #include "resource.h" | 37 | #include "resource.h" |
38 | 38 | ||
39 | class AddressBookAccess; | ||
39 | 40 | ||
40 | namespace KABC { | 41 | namespace KABC { |
41 | 42 | ||
42 | //US class FormatPlugin; | 43 | //US class FormatPlugin; |
43 | class ResourceConfigWidget; | 44 | class ResourceConfigWidget; |
44 | class QtopiaConverter; | 45 | class QtopiaConverter; |
@@ -54,18 +55,18 @@ public: | |||
54 | 55 | ||
55 | /** | 56 | /** |
56 | Constructor. | 57 | Constructor. |
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. |
69 | */ | 70 | */ |
70 | ~ResourceQtopia(); | 71 | ~ResourceQtopia(); |
71 | 72 | ||
@@ -102,47 +103,51 @@ public: | |||
102 | * | 103 | * |
103 | * @param ticket The ticket returned by @ref requestSaveTicket() | 104 | * @param ticket The ticket returned by @ref requestSaveTicket() |
104 | */ | 105 | */ |
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 | ||
129 | protected slots: | 135 | protected slots: |
130 | void fileChanged(); | 136 | void fileChanged(); |
131 | 137 | ||
132 | protected: | 138 | protected: |
133 | void init( const QString &fileName ); | 139 | void init( const QString &fileName ); |
134 | 140 | ||
135 | bool lock( const QString &fileName ); | 141 | bool lock( const QString &fileName ); |
136 | void unlock( const QString &fileName ); | 142 | void unlock( const QString &fileName ); |
137 | 143 | ||
138 | private: | 144 | private: |
145 | AddressBookAccess* mAccess; | ||
139 | QtopiaConverter* mConverter; | 146 | QtopiaConverter* mConverter; |
140 | 147 | ||
141 | QString mFileName; | ||
142 | |||
143 | QString mLockUniqueName; | 148 | QString mLockUniqueName; |
144 | 149 | ||
145 | KDirWatch mDirWatch; | 150 | KDirWatch mDirWatch; |
146 | }; | 151 | }; |
147 | 152 | ||
148 | } | 153 | } |