summaryrefslogtreecommitdiffabout
path: root/kabc/plugins/sharpdtm/resourcesharpdtm.h
Unidiff
Diffstat (limited to 'kabc/plugins/sharpdtm/resourcesharpdtm.h') (more/less context) (show whitespace changes)
-rw-r--r--kabc/plugins/sharpdtm/resourcesharpdtm.h32
1 files changed, 18 insertions, 14 deletions
diff --git a/kabc/plugins/sharpdtm/resourcesharpdtm.h b/kabc/plugins/sharpdtm/resourcesharpdtm.h
index d2e2a52..f495e9d 100644
--- a/kabc/plugins/sharpdtm/resourcesharpdtm.h
+++ b/kabc/plugins/sharpdtm/resourcesharpdtm.h
@@ -1,9 +1,9 @@
1/* 1/*
2 This file is part of libkabc. 2 This file is part of libkabc.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2004 Ulf Schenk
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
@@ -53,18 +53,18 @@ public:
53 53
54 /** 54 /**
55 Constructor. 55 Constructor.
56 56
57 @param cfg The config object where custom resource settings are stored. 57 @param cfg The config object where custom resource settings are stored.
58 */ 58 */
59 ResourceSharpDTM( const KConfig *cfg ); 59 ResourceSharpDTM( const KConfig *cfg, bool syncable );
60 60
61 /** 61 /**
62 Construct file resource on file @arg fileName using format @arg formatName. 62 Construct file resource on file @arg fileName using format @arg formatName.
63 */ 63 */
64 ResourceSharpDTM( const QString &fileName ); 64 ResourceSharpDTM( const QString &fileName, bool syncable );
65 65
66 /** 66 /**
67 * Destructor. 67 * Destructor.
68 */ 68 */
69 ~ResourceSharpDTM(); 69 ~ResourceSharpDTM();
70 70
@@ -101,32 +101,38 @@ public:
101 * 101 *
102 * @param ticket The ticket returned by @ref requestSaveTicket() 102 * @param ticket The ticket returned by @ref requestSaveTicket()
103 */ 103 */
104 virtual bool save( Ticket *ticket ); 104 virtual bool save( Ticket *ticket );
105 105
106 /** 106 /**
107 * Remove a addressee from its source.
108 * This method is mainly called by KABC::AddressBook.
109 */
110 virtual void removeAddressee( const Addressee& addr );
111
112 /**
107 * Set name of file to be used for saving. 113 * Set name of file to be used for saving.
108 */ 114 */
109 void setFileName( const QString & ); 115 virtual void setFileName( const QString & );
110 116
111 /** 117 /**
112 * Return name of file used for loading and saving the address book. 118 * This method is called by an error handler if the application
119 * crashed
113 */ 120 */
114 QString fileName() const; 121 virtual void cleanUp();
115 122
116 /** 123 /**
117 * Remove a addressee from its source. 124 * This method returns the number of elements that are currently in the resource.
118 * This method is mainly called by KABC::AddressBook.
119 */ 125 */
120 virtual void removeAddressee( const Addressee& addr ); 126 virtual int count() const;
121 127
122 /** 128 /**
123 * This method is called by an error handler if the application 129 * This method removes all elements from the resource!! (Not from the addressbook)
124 * crashed
125 */ 130 */
126 virtual void cleanUp(); 131 virtual bool clear();
132
127 133
128protected slots: 134protected slots:
129 void fileChanged(); 135 void fileChanged();
130 136
131protected: 137protected:
132 void init( const QString &fileName ); 138 void init( const QString &fileName );
@@ -134,14 +140,12 @@ protected:
134 bool lock( const QString &fileName ); 140 bool lock( const QString &fileName );
135 void unlock( const QString &fileName ); 141 void unlock( const QString &fileName );
136 142
137private: 143private:
138 SharpDTMConverter* mConverter; 144 SharpDTMConverter* mConverter;
139 145
140 QString mFileName;
141
142 QString mLockUniqueName; 146 QString mLockUniqueName;
143 147
144 KDirWatch mDirWatch; 148 KDirWatch mDirWatch;
145}; 149};
146 150
147} 151}