author | zecke <zecke> | 2004-03-13 19:51:45 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-03-13 19:51:45 (UTC) |
commit | 6d08277737e22b7a1527124623f3571969073ddf (patch) (unidiff) | |
tree | 4129e674e21df767b31299e873dd44e33a308e1b /libopie2/opiepim/backend | |
parent | 8e28911f7199f4450ac5eef09482069f9b9caea2 (diff) | |
download | opie-6d08277737e22b7a1527124623f3571969073ddf.zip opie-6d08277737e22b7a1527124623f3571969073ddf.tar.gz opie-6d08277737e22b7a1527124623f3571969073ddf.tar.bz2 |
Move XML class to internal PIM
Add namespaces!!!
Opie::Core and Opie::Core::Private
Opie::Net and Opie::Net::Private
Opie::Ui and Opie::Ui::Private
Opie::MM and Opie::MM::Private
Opie::DB and Opie::DB::Private
PIM classes are not yet converted because we will do other work
on it as well
8 files changed, 31 insertions, 12 deletions
diff --git a/libopie2/opiepim/backend/backends.pro b/libopie2/opiepim/backend/backends.pro index 4231a00..d4867ba 100644 --- a/libopie2/opiepim/backend/backends.pro +++ b/libopie2/opiepim/backend/backends.pro | |||
@@ -1,31 +1,33 @@ | |||
1 | SOURCES += core/backends/ocontactaccessbackend_sql.cpp \ | 1 | SOURCES += core/backends/ocontactaccessbackend_sql.cpp \ |
2 | core/backends/ocontactaccessbackend_vcard.cpp \ | 2 | core/backends/ocontactaccessbackend_vcard.cpp \ |
3 | core/backends/ocontactaccessbackend_xml.cpp \ | 3 | core/backends/ocontactaccessbackend_xml.cpp \ |
4 | core/backends/ocontactaccess.cpp \ | 4 | core/backends/ocontactaccess.cpp \ |
5 | core/backends/odatebookaccessbackend.cpp \ | 5 | core/backends/odatebookaccessbackend.cpp \ |
6 | core/backends/odatebookaccessbackend_xml.cpp \ | 6 | core/backends/odatebookaccessbackend_xml.cpp \ |
7 | core/backends/otodoaccessbackend.cpp \ | 7 | core/backends/otodoaccessbackend.cpp \ |
8 | core/backends/otodoaccess.cpp \ | 8 | core/backends/otodoaccess.cpp \ |
9 | core/backends/otodoaccesssql.cpp \ | 9 | core/backends/otodoaccesssql.cpp \ |
10 | core/backends/otodoaccessvcal.cpp \ | 10 | core/backends/otodoaccessvcal.cpp \ |
11 | core/backends/otodoaccessxml.cpp \ | 11 | core/backends/otodoaccessxml.cpp \ |
12 | core/backends/odatebookaccess.cpp \ | 12 | core/backends/odatebookaccess.cpp \ |
13 | core/backends/odatebookaccessbackend_sql.cpp | 13 | core/backends/odatebookaccessbackend_sql.cpp \ |
14 | core/backends/private/xmltree.cc | ||
14 | 15 | ||
15 | HEADERS += core/backends/obackendfactory.h \ | 16 | HEADERS += core/backends/obackendfactory.h \ |
16 | core/backends/ocontactaccessbackend.h \ | 17 | core/backends/ocontactaccessbackend.h \ |
17 | core/backends/ocontactaccessbackend_sql.h \ | 18 | core/backends/ocontactaccessbackend_sql.h \ |
18 | core/backends/ocontactaccessbackend_vcard.h \ | 19 | core/backends/ocontactaccessbackend_vcard.h \ |
19 | core/backends/ocontactaccessbackend_xml.h \ | 20 | core/backends/ocontactaccessbackend_xml.h \ |
20 | core/backends/ocontactaccess.h \ | 21 | core/backends/ocontactaccess.h \ |
21 | core/backends/odatebookaccessbackend.h \ | 22 | core/backends/odatebookaccessbackend.h \ |
22 | core/backends/odatebookaccessbackend_sql.h \ | 23 | core/backends/odatebookaccessbackend_sql.h \ |
23 | core/backends/odatebookaccessbackend_xml.h \ | 24 | core/backends/odatebookaccessbackend_xml.h \ |
24 | core/backends/opimaccessbackend.h \ | 25 | core/backends/opimaccessbackend.h \ |
25 | core/backends/opimaccesstemplate.h \ | 26 | core/backends/opimaccesstemplate.h \ |
26 | core/backends/otodoaccessbackend.h \ | 27 | core/backends/otodoaccessbackend.h \ |
27 | core/backends/otodoaccess.h \ | 28 | core/backends/otodoaccess.h \ |
28 | core/backends/otodoaccesssql.h \ | 29 | core/backends/otodoaccesssql.h \ |
29 | core/backends/otodoaccessvcal.h \ | 30 | core/backends/otodoaccessvcal.h \ |
30 | core/backends/otodoaccessxml.h \ | 31 | core/backends/otodoaccessxml.h \ |
31 | core/backends/odatebookaccess.h | 32 | core/backends/odatebookaccess.h \ |
33 | core/backends/private/xmltree.h | ||
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp index f121cc2..d16d692 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp | |||
@@ -37,25 +37,25 @@ | |||
37 | #include <qstringlist.h> | 37 | #include <qstringlist.h> |
38 | 38 | ||
39 | #include <qpe/global.h> | 39 | #include <qpe/global.h> |
40 | #include <qpe/recordfields.h> | 40 | #include <qpe/recordfields.h> |
41 | 41 | ||
42 | #include <opie2/opimcontactfields.h> | 42 | #include <opie2/opimcontactfields.h> |
43 | #include <opie2/opimdateconversion.h> | 43 | #include <opie2/opimdateconversion.h> |
44 | #include <opie2/osqldriver.h> | 44 | #include <opie2/osqldriver.h> |
45 | #include <opie2/osqlresult.h> | 45 | #include <opie2/osqlresult.h> |
46 | #include <opie2/osqlmanager.h> | 46 | #include <opie2/osqlmanager.h> |
47 | #include <opie2/osqlquery.h> | 47 | #include <opie2/osqlquery.h> |
48 | 48 | ||
49 | 49 | using namespace Opie::DB; | |
50 | 50 | ||
51 | 51 | ||
52 | // If defined, we use a horizontal table ( uid, attr1, attr2, attr3, ..., attrn ) instead | 52 | // If defined, we use a horizontal table ( uid, attr1, attr2, attr3, ..., attrn ) instead |
53 | // vertical like "uid, type, value". | 53 | // vertical like "uid, type, value". |
54 | // DON'T DEACTIVATE THIS DEFINE IN PRODUCTIVE ENVIRONMENTS !! | 54 | // DON'T DEACTIVATE THIS DEFINE IN PRODUCTIVE ENVIRONMENTS !! |
55 | #define __STORE_HORIZONTAL_ | 55 | #define __STORE_HORIZONTAL_ |
56 | 56 | ||
57 | // Distinct loading is not very fast. If I expect that every person has just | 57 | // Distinct loading is not very fast. If I expect that every person has just |
58 | // one (and always one) 'Last Name', I can request all uid's for existing lastnames, | 58 | // one (and always one) 'Last Name', I can request all uid's for existing lastnames, |
59 | // which is faster.. | 59 | // which is faster.. |
60 | // But this may not be true for all entries, like company contacts.. | 60 | // But this may not be true for all entries, like company contacts.. |
61 | // The current AddressBook application handles this problem, but other may not.. (eilers) | 61 | // The current AddressBook application handles this problem, but other may not.. (eilers) |
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 |
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp index 5d92b8f..f5e76d5 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp | |||
@@ -32,32 +32,33 @@ | |||
32 | 32 | ||
33 | #include <opie2/ocontactaccessbackend_xml.h> | 33 | #include <opie2/ocontactaccessbackend_xml.h> |
34 | 34 | ||
35 | #include <qasciidict.h> | 35 | #include <qasciidict.h> |
36 | #include <qfile.h> | 36 | #include <qfile.h> |
37 | #include <qfileinfo.h> | 37 | #include <qfileinfo.h> |
38 | #include <qregexp.h> | 38 | #include <qregexp.h> |
39 | #include <qarray.h> | 39 | #include <qarray.h> |
40 | #include <qmap.h> | 40 | #include <qmap.h> |
41 | 41 | ||
42 | #include <qpe/global.h> | 42 | #include <qpe/global.h> |
43 | 43 | ||
44 | #include <opie2/xmltree.h> | 44 | #include "private/xmltree.h" |
45 | #include <opie2/ocontactaccessbackend.h> | 45 | #include <opie2/ocontactaccessbackend.h> |
46 | #include <opie2/ocontactaccess.h> | 46 | #include <opie2/ocontactaccess.h> |
47 | 47 | ||
48 | #include <stdlib.h> | 48 | #include <stdlib.h> |
49 | #include <errno.h> | 49 | #include <errno.h> |
50 | 50 | ||
51 | using namespace Opie; | 51 | using namespace Opie; |
52 | using namespace Opie::Pim::Private; | ||
52 | 53 | ||
53 | 54 | ||
54 | namespace Opie { | 55 | namespace Opie { |
55 | OPimContactAccessBackend_XML::OPimContactAccessBackend_XML ( const QString& appname, const QString& filename ): | 56 | OPimContactAccessBackend_XML::OPimContactAccessBackend_XML ( const QString& appname, const QString& filename ): |
56 | m_changed( false ) | 57 | m_changed( false ) |
57 | { | 58 | { |
58 | // Just m_contactlist should call delete if an entry | 59 | // Just m_contactlist should call delete if an entry |
59 | // is removed. | 60 | // is removed. |
60 | m_contactList.setAutoDelete( true ); | 61 | m_contactList.setAutoDelete( true ); |
61 | m_uidToContact.setAutoDelete( false ); | 62 | m_uidToContact.setAutoDelete( false ); |
62 | 63 | ||
63 | m_appName = appname; | 64 | m_appName = appname; |
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp b/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp index 2ee76cc..a779dc1 100644 --- a/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp +++ b/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp | |||
@@ -37,24 +37,26 @@ | |||
37 | #include <qarray.h> | 37 | #include <qarray.h> |
38 | #include <qstringlist.h> | 38 | #include <qstringlist.h> |
39 | 39 | ||
40 | #include <qpe/global.h> | 40 | #include <qpe/global.h> |
41 | 41 | ||
42 | #include <opie2/osqldriver.h> | 42 | #include <opie2/osqldriver.h> |
43 | #include <opie2/osqlmanager.h> | 43 | #include <opie2/osqlmanager.h> |
44 | #include <opie2/osqlquery.h> | 44 | #include <opie2/osqlquery.h> |
45 | 45 | ||
46 | #include <opie2/opimrecurrence.h> | 46 | #include <opie2/opimrecurrence.h> |
47 | #include <opie2/odatebookaccessbackend_sql.h> | 47 | #include <opie2/odatebookaccessbackend_sql.h> |
48 | 48 | ||
49 | using namespace Opie::DB; | ||
50 | |||
49 | namespace Opie { | 51 | namespace Opie { |
50 | 52 | ||
51 | 53 | ||
52 | ODateBookAccessBackend_SQL::ODateBookAccessBackend_SQL( const QString& , | 54 | ODateBookAccessBackend_SQL::ODateBookAccessBackend_SQL( const QString& , |
53 | const QString& fileName ) | 55 | const QString& fileName ) |
54 | : ODateBookAccessBackend(), m_driver( NULL ) | 56 | : ODateBookAccessBackend(), m_driver( NULL ) |
55 | { | 57 | { |
56 | m_fileName = fileName.isEmpty() ? Global::applicationFileName( "datebook", "datebook.db" ) : fileName; | 58 | m_fileName = fileName.isEmpty() ? Global::applicationFileName( "datebook", "datebook.db" ) : fileName; |
57 | 59 | ||
58 | // Get the standart sql-driver from the OSQLManager.. | 60 | // Get the standart sql-driver from the OSQLManager.. |
59 | OSQLManager man; | 61 | OSQLManager man; |
60 | m_driver = man.standard(); | 62 | m_driver = man.standard(); |
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_sql.h b/libopie2/opiepim/backend/odatebookaccessbackend_sql.h index cbfeb97..60d7f21 100644 --- a/libopie2/opiepim/backend/odatebookaccessbackend_sql.h +++ b/libopie2/opiepim/backend/odatebookaccessbackend_sql.h | |||
@@ -25,25 +25,29 @@ | |||
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | #ifndef OPIE_DATE_BOOK_ACCESS_BACKEND_SQL__H | 29 | #ifndef OPIE_DATE_BOOK_ACCESS_BACKEND_SQL__H |
30 | #define OPIE_DATE_BOOK_ACCESS_BACKEND_SQL__H | 30 | #define OPIE_DATE_BOOK_ACCESS_BACKEND_SQL__H |
31 | 31 | ||
32 | #include <qmap.h> | 32 | #include <qmap.h> |
33 | #include <opie2/osqlresult.h> | 33 | #include <opie2/osqlresult.h> |
34 | 34 | ||
35 | #include <opie2/odatebookaccessbackend.h> | 35 | #include <opie2/odatebookaccessbackend.h> |
36 | 36 | ||
37 | namespace Opie { | ||
38 | namespace DB { | ||
37 | class OSQLDriver; | 39 | class OSQLDriver; |
40 | } | ||
41 | } | ||
38 | 42 | ||
39 | namespace Opie { | 43 | namespace Opie { |
40 | /** | 44 | /** |
41 | * This is the default SQL implementation for DateBoook SQL storage | 45 | * This is the default SQL implementation for DateBoook SQL storage |
42 | * It fully implements the interface | 46 | * It fully implements the interface |
43 | * @see ODateBookAccessBackend | 47 | * @see ODateBookAccessBackend |
44 | * @see OPimAccessBackend | 48 | * @see OPimAccessBackend |
45 | */ | 49 | */ |
46 | class ODateBookAccessBackend_SQL : public ODateBookAccessBackend { | 50 | class ODateBookAccessBackend_SQL : public ODateBookAccessBackend { |
47 | public: | 51 | public: |
48 | ODateBookAccessBackend_SQL( const QString& appName, | 52 | ODateBookAccessBackend_SQL( const QString& appName, |
49 | const QString& fileName = QString::null); | 53 | const QString& fileName = QString::null); |
@@ -68,26 +72,26 @@ public: | |||
68 | 72 | ||
69 | OPimEvent::ValueList directNonRepeats(); | 73 | OPimEvent::ValueList directNonRepeats(); |
70 | OPimEvent::ValueList directRawRepeats(); | 74 | OPimEvent::ValueList directRawRepeats(); |
71 | 75 | ||
72 | private: | 76 | private: |
73 | bool loadFile(); | 77 | bool loadFile(); |
74 | QString m_fileName; | 78 | QString m_fileName; |
75 | QArray<int> m_uids; | 79 | QArray<int> m_uids; |
76 | 80 | ||
77 | QMap<int, QString> m_fieldMap; | 81 | QMap<int, QString> m_fieldMap; |
78 | QMap<QString, int> m_reverseFieldMap; | 82 | QMap<QString, int> m_reverseFieldMap; |
79 | 83 | ||
80 | OSQLDriver* m_driver; | 84 | Opie::DB::OSQLDriver* m_driver; |
81 | 85 | ||
82 | class Private; | 86 | class Private; |
83 | Private *d; | 87 | Private *d; |
84 | 88 | ||
85 | void initFields(); | 89 | void initFields(); |
86 | void update(); | 90 | void update(); |
87 | QArray<int> extractUids( OSQLResult& res ) const; | 91 | QArray<int> extractUids( Opie::DB::OSQLResult& res ) const; |
88 | 92 | ||
89 | }; | 93 | }; |
90 | 94 | ||
91 | } | 95 | } |
92 | 96 | ||
93 | #endif | 97 | #endif |
diff --git a/libopie2/opiepim/backend/otodoaccesssql.cpp b/libopie2/opiepim/backend/otodoaccesssql.cpp index 72232e5..d218090 100644 --- a/libopie2/opiepim/backend/otodoaccesssql.cpp +++ b/libopie2/opiepim/backend/otodoaccesssql.cpp | |||
@@ -32,24 +32,26 @@ | |||
32 | #include <qpe/global.h> | 32 | #include <qpe/global.h> |
33 | 33 | ||
34 | #include <opie2/osqldriver.h> | 34 | #include <opie2/osqldriver.h> |
35 | #include <opie2/osqlresult.h> | 35 | #include <opie2/osqlresult.h> |
36 | #include <opie2/osqlmanager.h> | 36 | #include <opie2/osqlmanager.h> |
37 | #include <opie2/osqlquery.h> | 37 | #include <opie2/osqlquery.h> |
38 | 38 | ||
39 | #include <opie2/otodoaccesssql.h> | 39 | #include <opie2/otodoaccesssql.h> |
40 | #include <opie2/opimstate.h> | 40 | #include <opie2/opimstate.h> |
41 | #include <opie2/opimnotifymanager.h> | 41 | #include <opie2/opimnotifymanager.h> |
42 | #include <opie2/opimrecurrence.h> | 42 | #include <opie2/opimrecurrence.h> |
43 | 43 | ||
44 | using namespace Opie::DB; | ||
45 | |||
44 | using namespace Opie; | 46 | using namespace Opie; |
45 | /* | 47 | /* |
46 | * first some query | 48 | * first some query |
47 | * CREATE query | 49 | * CREATE query |
48 | * LOAD query | 50 | * LOAD query |
49 | * INSERT | 51 | * INSERT |
50 | * REMOVE | 52 | * REMOVE |
51 | * CLEAR | 53 | * CLEAR |
52 | */ | 54 | */ |
53 | namespace { | 55 | namespace { |
54 | /** | 56 | /** |
55 | * CreateQuery for the Todolist Table | 57 | * CreateQuery for the Todolist Table |
diff --git a/libopie2/opiepim/backend/otodoaccesssql.h b/libopie2/opiepim/backend/otodoaccesssql.h index e945863..0ae2591 100644 --- a/libopie2/opiepim/backend/otodoaccesssql.h +++ b/libopie2/opiepim/backend/otodoaccesssql.h | |||
@@ -24,27 +24,31 @@ | |||
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | #ifndef OPIE_PIM_ACCESS_SQL_H | 29 | #ifndef OPIE_PIM_ACCESS_SQL_H |
30 | #define OPIE_PIM_ACCESS_SQL_H | 30 | #define OPIE_PIM_ACCESS_SQL_H |
31 | 31 | ||
32 | #include <qasciidict.h> | 32 | #include <qasciidict.h> |
33 | 33 | ||
34 | #include <opie2/otodoaccessbackend.h> | 34 | #include <opie2/otodoaccessbackend.h> |
35 | 35 | ||
36 | namespace Opie { | ||
37 | namespace DB { | ||
36 | class OSQLDriver; | 38 | class OSQLDriver; |
37 | class OSQLResult; | 39 | class OSQLResult; |
38 | class OSQLResultItem; | 40 | class OSQLResultItem; |
41 | } | ||
42 | } | ||
39 | 43 | ||
40 | namespace Opie { | 44 | namespace Opie { |
41 | 45 | ||
42 | class OPimTodoAccessBackendSQL : public OPimTodoAccessBackend { | 46 | class OPimTodoAccessBackendSQL : public OPimTodoAccessBackend { |
43 | public: | 47 | public: |
44 | OPimTodoAccessBackendSQL( const QString& file ); | 48 | OPimTodoAccessBackendSQL( const QString& file ); |
45 | ~OPimTodoAccessBackendSQL(); | 49 | ~OPimTodoAccessBackendSQL(); |
46 | 50 | ||
47 | bool load(); | 51 | bool load(); |
48 | bool reload(); | 52 | bool reload(); |
49 | bool save(); | 53 | bool save(); |
50 | QArray<int> allRecords()const; | 54 | QArray<int> allRecords()const; |
@@ -62,27 +66,27 @@ public: | |||
62 | const QDate& end, bool includeNoDates ); | 66 | const QDate& end, bool includeNoDates ); |
63 | QArray<int> sorted(bool asc, int sortOrder, int sortFilter, int cat ); | 67 | QArray<int> sorted(bool asc, int sortOrder, int sortFilter, int cat ); |
64 | 68 | ||
65 | QBitArray supports()const; | 69 | QBitArray supports()const; |
66 | QArray<int> matchRegexp( const QRegExp &r ) const; | 70 | QArray<int> matchRegexp( const QRegExp &r ) const; |
67 | void removeAllCompleted(); | 71 | void removeAllCompleted(); |
68 | 72 | ||
69 | 73 | ||
70 | private: | 74 | private: |
71 | void update()const; | 75 | void update()const; |
72 | void fillDict(); | 76 | void fillDict(); |
73 | inline bool date( QDate& date, const QString& )const; | 77 | inline bool date( QDate& date, const QString& )const; |
74 | inline OPimTodo todo( const OSQLResult& )const; | 78 | inline OPimTodo todo( const Opie::DB::OSQLResult& )const; |
75 | inline OPimTodo todo( OSQLResultItem& )const; | 79 | inline OPimTodo todo( Opie::DB::OSQLResultItem& )const; |
76 | inline QArray<int> uids( const OSQLResult& )const; | 80 | inline QArray<int> uids( const Opie::DB::OSQLResult& )const; |
77 | OPimTodo todo( int uid )const; | 81 | OPimTodo todo( int uid )const; |
78 | QBitArray sup() const; | 82 | QBitArray sup() const; |
79 | 83 | ||
80 | QAsciiDict<int> m_dict; | 84 | QAsciiDict<int> m_dict; |
81 | OSQLDriver* m_driver; | 85 | Opie::DB::OSQLDriver* m_driver; |
82 | QArray<int> m_uids; | 86 | QArray<int> m_uids; |
83 | bool m_dirty : 1; | 87 | bool m_dirty : 1; |
84 | }; | 88 | }; |
85 | 89 | ||
86 | } | 90 | } |
87 | 91 | ||
88 | #endif | 92 | #endif |