Diffstat (limited to 'libopie2/opiepim/backend/ocontactaccessbackend_xml.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend_xml.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_xml.h b/libopie2/opiepim/backend/ocontactaccessbackend_xml.h index f439c4c..eaea352 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_xml.h +++ b/libopie2/opiepim/backend/ocontactaccessbackend_xml.h | |||
@@ -27,82 +27,82 @@ | |||
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | /* | 29 | /* |
30 | * XML Backend for the OPIE-Contact Database. | 30 | * XML Backend for the OPIE-Contact Database. |
31 | */ | 31 | */ |
32 | 32 | ||
33 | #ifndef _OContactAccessBackend_XML_ | 33 | #ifndef _OPimContactAccessBackend_XML_ |
34 | #define _OContactAccessBackend_XML_ | 34 | #define _OPimContactAccessBackend_XML_ |
35 | 35 | ||
36 | #include <opie2/ocontactaccessbackend.h> | 36 | #include <opie2/ocontactaccessbackend.h> |
37 | #include <opie2/ocontactaccess.h> | 37 | #include <opie2/ocontactaccess.h> |
38 | 38 | ||
39 | #include <qlist.h> | 39 | #include <qlist.h> |
40 | #include <qdict.h> | 40 | #include <qdict.h> |
41 | 41 | ||
42 | namespace Opie { | 42 | namespace Opie { |
43 | /* the default xml implementation */ | 43 | /* the default xml implementation */ |
44 | /** | 44 | /** |
45 | * This class is the XML implementation of a Contact backend | 45 | * This class is the XML implementation of a Contact backend |
46 | * it does implement everything available for OContact. | 46 | * it does implement everything available for OPimContact. |
47 | * @see OPimAccessBackend for more information of available methods | 47 | * @see OPimAccessBackend for more information of available methods |
48 | */ | 48 | */ |
49 | class OContactAccessBackend_XML : public OContactAccessBackend { | 49 | class OPimContactAccessBackend_XML : public OPimContactAccessBackend { |
50 | public: | 50 | public: |
51 | OContactAccessBackend_XML ( const QString& appname, const QString& filename = QString::null ); | 51 | OPimContactAccessBackend_XML ( const QString& appname, const QString& filename = QString::null ); |
52 | 52 | ||
53 | bool save(); | 53 | bool save(); |
54 | 54 | ||
55 | bool load (); | 55 | bool load (); |
56 | 56 | ||
57 | void clear (); | 57 | void clear (); |
58 | 58 | ||
59 | bool wasChangedExternally(); | 59 | bool wasChangedExternally(); |
60 | 60 | ||
61 | QArray<int> allRecords() const; | 61 | QArray<int> allRecords() const; |
62 | 62 | ||
63 | OContact find ( int uid ) const; | 63 | OPimContact find ( int uid ) const; |
64 | 64 | ||
65 | QArray<int> queryByExample ( const OContact &query, int settings, const QDateTime& d = QDateTime() ); | 65 | QArray<int> queryByExample ( const OPimContact &query, int settings, const QDateTime& d = QDateTime() ); |
66 | 66 | ||
67 | QArray<int> matchRegexp( const QRegExp &r ) const; | 67 | QArray<int> matchRegexp( const QRegExp &r ) const; |
68 | 68 | ||
69 | const uint querySettings(); | 69 | const uint querySettings(); |
70 | 70 | ||
71 | bool hasQuerySettings (uint querySettings) const; | 71 | bool hasQuerySettings (uint querySettings) const; |
72 | 72 | ||
73 | // Currently only asc implemented.. | 73 | // Currently only asc implemented.. |
74 | QArray<int> sorted( bool asc, int , int , int ); | 74 | QArray<int> sorted( bool asc, int , int , int ); |
75 | bool add ( const OContact &newcontact ); | 75 | bool add ( const OPimContact &newcontact ); |
76 | 76 | ||
77 | bool replace ( const OContact &contact ); | 77 | bool replace ( const OPimContact &contact ); |
78 | 78 | ||
79 | bool remove ( int uid ); | 79 | bool remove ( int uid ); |
80 | bool reload(); | 80 | bool reload(); |
81 | 81 | ||
82 | private: | 82 | private: |
83 | 83 | ||
84 | enum journal_action { ACTION_ADD, ACTION_REMOVE, ACTION_REPLACE }; | 84 | enum journal_action { ACTION_ADD, ACTION_REMOVE, ACTION_REPLACE }; |
85 | 85 | ||
86 | void addContact_p( const OContact &newcontact ); | 86 | void addContact_p( const OPimContact &newcontact ); |
87 | 87 | ||
88 | /* This function loads the xml-database and the journalfile */ | 88 | /* This function loads the xml-database and the journalfile */ |
89 | bool load( const QString filename, bool isJournal ); | 89 | bool load( const QString filename, bool isJournal ); |
90 | 90 | ||
91 | 91 | ||
92 | void updateJournal( const OContact& cnt, journal_action action ); | 92 | void updateJournal( const OPimContact& cnt, journal_action action ); |
93 | void removeJournal(); | 93 | void removeJournal(); |
94 | 94 | ||
95 | protected: | 95 | protected: |
96 | bool m_changed; | 96 | bool m_changed; |
97 | QString m_journalName; | 97 | QString m_journalName; |
98 | QString m_fileName; | 98 | QString m_fileName; |
99 | QString m_appName; | 99 | QString m_appName; |
100 | QList<OContact> m_contactList; | 100 | QList<OPimContact> m_contactList; |
101 | QDateTime m_readtime; | 101 | QDateTime m_readtime; |
102 | 102 | ||
103 | QDict<OContact> m_uidToContact; | 103 | QDict<OPimContact> m_uidToContact; |
104 | }; | 104 | }; |
105 | 105 | ||
106 | } | 106 | } |
107 | 107 | ||
108 | #endif | 108 | #endif |