summaryrefslogtreecommitdiff
path: root/libopie/pim/ocontactaccessbackend_sql.h
Unidiff
Diffstat (limited to 'libopie/pim/ocontactaccessbackend_sql.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/ocontactaccessbackend_sql.h107
1 files changed, 0 insertions, 107 deletions
diff --git a/libopie/pim/ocontactaccessbackend_sql.h b/libopie/pim/ocontactaccessbackend_sql.h
deleted file mode 100644
index f553760..0000000
--- a/libopie/pim/ocontactaccessbackend_sql.h
+++ b/dev/null
@@ -1,107 +0,0 @@
1/*
2 * SQL Backend for the OPIE-Contact Database.
3 *
4 * Copyright (c) 2002 by Stefan Eilers (Eilers.Stefan@epost.de)
5 *
6 * =====================================================================
7 *This program is free software; you can redistribute it and/or
8 *modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 * =====================================================================
12 *
13 *
14 * =====================================================================
15 * Version: $Id$
16 * =====================================================================
17 * History:
18 * $Log$
19 * Revision 1.3 2004/03/14 13:50:35 alwin
20 * namespace correction
21 *
22 * Revision 1.2 2003/12/08 15:18:11 eilers
23 * Committing unfinished sql implementation before merging to libopie2 starts..
24 *
25 * Revision 1.1 2003/09/22 14:31:16 eilers
26 * Added first experimental incarnation of sql-backend for addressbook.
27 * Some modifications to be able to compile the todo sql-backend.
28 * A lot of changes fill follow...
29 *
30 *
31 */
32
33#ifndef _OContactAccessBackend_SQL_
34#define _OContactAccessBackend_SQL_
35
36#include "ocontactaccessbackend.h"
37#include "ocontactaccess.h"
38
39#include <qlist.h>
40#include <qdict.h>
41
42namespace Opie { namespace DB {
43class OSQLDriver;
44class OSQLResult;
45class OSQLResultItem;
46
47}}
48
49/* the default xml implementation */
50/**
51 * This class is the SQL implementation of a Contact backend
52 * it does implement everything available for OContact.
53 * @see OPimAccessBackend for more information of available methods
54 */
55class OContactAccessBackend_SQL : public OContactAccessBackend {
56 public:
57 OContactAccessBackend_SQL ( const QString& appname, const QString& filename = QString::null );
58
59 ~OContactAccessBackend_SQL ();
60
61 bool save();
62
63 bool load ();
64
65 void clear ();
66
67 bool wasChangedExternally();
68
69 QArray<int> allRecords() const;
70
71 OContact find ( int uid ) const;
72 // FIXME: Add lookahead-cache support !
73 //OContact find(int uid, const QArray<int>&, uint cur, Frontend::CacheDirection )const;
74
75 QArray<int> queryByExample ( const OContact &query, int settings,
76 const QDateTime& d );
77
78 QArray<int> matchRegexp( const QRegExp &r ) const;
79
80 const uint querySettings();
81
82 bool hasQuerySettings (uint querySettings) const;
83
84 // Currently only asc implemented..
85 QArray<int> sorted( bool asc, int , int , int );
86 bool add ( const OContact &newcontact );
87
88 bool replace ( const OContact &contact );
89
90 bool remove ( int uid );
91 bool reload();
92
93 private:
94 QArray<int> extractUids( Opie::DB::OSQLResult& res ) const;
95 QMap<int, QString> requestNonCustom( int uid ) const;
96 QMap<QString, QString> requestCustom( int uid ) const;
97 void update();
98
99 protected:
100 bool m_changed;
101 QString m_fileName;
102 QArray<int> m_uids;
103
104 Opie::DB::OSQLDriver* m_driver;
105};
106
107#endif