Diffstat (limited to 'libopie2/opiepim/backend/ocontactaccessbackend_sql.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend_sql.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_sql.h b/libopie2/opiepim/backend/ocontactaccessbackend_sql.h index 58ae2ae..ba122ec 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_sql.h +++ b/libopie2/opiepim/backend/ocontactaccessbackend_sql.h | |||
@@ -31,27 +31,31 @@ | |||
31 | */ | 31 | */ |
32 | 32 | ||
33 | #ifndef _OPimContactAccessBackend_SQL_ | 33 | #ifndef _OPimContactAccessBackend_SQL_ |
34 | #define _OPimContactAccessBackend_SQL_ | 34 | #define _OPimContactAccessBackend_SQL_ |
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 | /* aren't in namespace Opie yet - alwin */ | 42 | /* aren't in namespace Opie yet - alwin */ |
43 | namespace Opie { | ||
44 | namespace DB { | ||
43 | class OSQLDriver; | 45 | class OSQLDriver; |
44 | class OSQLResult; | 46 | class OSQLResult; |
45 | class OSQLResultItem; | 47 | class OSQLResultItem; |
48 | } | ||
49 | } | ||
46 | 50 | ||
47 | namespace Opie { | 51 | namespace Opie { |
48 | 52 | ||
49 | /* the default xml implementation */ | 53 | /* the default xml implementation */ |
50 | /** | 54 | /** |
51 | * This class is the SQL implementation of a Contact backend | 55 | * This class is the SQL implementation of a Contact backend |
52 | * it does implement everything available for OPimContact. | 56 | * it does implement everything available for OPimContact. |
53 | * @see OPimAccessBackend for more information of available methods | 57 | * @see OPimAccessBackend for more information of available methods |
54 | */ | 58 | */ |
55 | class OPimContactAccessBackend_SQL : public OPimContactAccessBackend { | 59 | class OPimContactAccessBackend_SQL : public OPimContactAccessBackend { |
56 | public: | 60 | public: |
57 | OPimContactAccessBackend_SQL ( const QString& appname, const QString& filename = QString::null ); | 61 | OPimContactAccessBackend_SQL ( const QString& appname, const QString& filename = QString::null ); |
@@ -82,28 +86,28 @@ class OPimContactAccessBackend_SQL : public OPimContactAccessBackend { | |||
82 | bool hasQuerySettings (uint querySettings) const; | 86 | bool hasQuerySettings (uint querySettings) const; |
83 | 87 | ||
84 | // Currently only asc implemented.. | 88 | // Currently only asc implemented.. |
85 | QArray<int> sorted( bool asc, int , int , int ); | 89 | QArray<int> sorted( bool asc, int , int , int ); |
86 | bool add ( const OPimContact &newcontact ); | 90 | bool add ( const OPimContact &newcontact ); |
87 | 91 | ||
88 | bool replace ( const OPimContact &contact ); | 92 | bool replace ( const OPimContact &contact ); |
89 | 93 | ||
90 | bool remove ( int uid ); | 94 | bool remove ( int uid ); |
91 | bool reload(); | 95 | bool reload(); |
92 | 96 | ||
93 | private: | 97 | private: |
94 | QArray<int> extractUids( OSQLResult& res ) const; | 98 | QArray<int> extractUids( Opie::DB::OSQLResult& res ) const; |
95 | QMap<int, QString> requestNonCustom( int uid ) const; | 99 | QMap<int, QString> requestNonCustom( int uid ) const; |
96 | QMap<QString, QString> requestCustom( int uid ) const; | 100 | QMap<QString, QString> requestCustom( int uid ) const; |
97 | void update(); | 101 | void update(); |
98 | 102 | ||
99 | protected: | 103 | protected: |
100 | bool m_changed; | 104 | bool m_changed; |
101 | QString m_fileName; | 105 | QString m_fileName; |
102 | QArray<int> m_uids; | 106 | QArray<int> m_uids; |
103 | 107 | ||
104 | OSQLDriver* m_driver; | 108 | Opie::DB::OSQLDriver* m_driver; |
105 | }; | 109 | }; |
106 | 110 | ||
107 | } | 111 | } |
108 | 112 | ||
109 | #endif | 113 | #endif |