Diffstat (limited to 'kabc/plugins/opie/resourceopie.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kabc/plugins/opie/resourceopie.h | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/kabc/plugins/opie/resourceopie.h b/kabc/plugins/opie/resourceopie.h index 9db9485..ca30fee 100644 --- a/kabc/plugins/opie/resourceopie.h +++ b/kabc/plugins/opie/resourceopie.h @@ -34,18 +34,16 @@ $Id$ #include <sys/types.h> #include "resource.h" -//class QTimer; -//class FormatPlugin; +class OContactAccess; namespace KABC { -//US class FormatPlugin; class ResourceConfigWidget; class OpieConverter; /** @internal */ class ResourceOpie : public Resource @@ -56,18 +54,18 @@ public: /** Constructor. @param cfg The config object where custom resource settings are stored. */ - ResourceOpie( const KConfig *cfg ); + ResourceOpie( const KConfig *cfg, bool syncable ); /** Construct file resource on file @arg fileName using format @arg formatName. */ - ResourceOpie( const QString &fileName ); + ResourceOpie( const QString &fileName, bool syncable ); /** * Destructor. */ ~ResourceOpie(); @@ -83,13 +81,13 @@ public: virtual bool doOpen(); /** * Closes the file again. */ virtual void doClose(); - + /** * Requests a save ticket, that is used by @ref save() */ virtual Ticket *requestSaveTicket(); /** @@ -103,50 +101,56 @@ public: * Returns true if all addressees could be saved otherwise false. * * @param ticket The ticket returned by @ref requestSaveTicket() */ virtual bool save( Ticket *ticket ); - /** - * Set name of file to be used for saving. - */ - void setFileName( const QString & ); - - /** - * Return name of file used for loading and saving the address book. - */ - QString fileName() const; /** * Remove a addressee from its source. * This method is mainly called by KABC::AddressBook. */ virtual void removeAddressee( const Addressee& addr ); /** + * Set name of file to be used for saving. + */ + virtual void setFileName( const QString & ); + + /** * 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(); + + protected slots: void fileChanged(); protected: void init( const QString &fileName ); bool lock( const QString &fileName ); void unlock( const QString &fileName ); private: + OContactAccess* mAccess; OpieConverter* mConverter; - - QString mFileName; QString mLockUniqueName; - + KDirWatch mDirWatch; }; } #endif |