summaryrefslogtreecommitdiff
path: root/libopie2/opiedb/osqlquery.h
authorzecke <zecke>2004-03-13 19:51:45 (UTC)
committer zecke <zecke>2004-03-13 19:51:45 (UTC)
commit6d08277737e22b7a1527124623f3571969073ddf (patch) (unidiff)
tree4129e674e21df767b31299e873dd44e33a308e1b /libopie2/opiedb/osqlquery.h
parent8e28911f7199f4450ac5eef09482069f9b9caea2 (diff)
downloadopie-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
Diffstat (limited to 'libopie2/opiedb/osqlquery.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiedb/osqlquery.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/libopie2/opiedb/osqlquery.h b/libopie2/opiedb/osqlquery.h
index 63c26b0..0265d2b 100644
--- a/libopie2/opiedb/osqlquery.h
+++ b/libopie2/opiedb/osqlquery.h
@@ -1,73 +1,79 @@
1 1
2#ifndef OSQL_QUERY_H 2#ifndef OSQL_QUERY_H
3#define OSQL_QUERY_H 3#define OSQL_QUERY_H
4 4
5#include <qmap.h> 5#include <qmap.h>
6#include <qvaluelist.h> 6#include <qvaluelist.h>
7#include <qstring.h> 7#include <qstring.h>
8 8
9 9
10namespace Opie {
11namespace DB {
12
10/** I'm not happy with them 13/** I'm not happy with them
11class OSQLQueryOrder { 14class OSQLQueryOrder {
12public: 15public:
13 typedef QValueList<OSQLQueryOrder> ValueList; 16 typedef QValueList<OSQLQueryOrder> ValueList;
14 OSQLQueryOrder(const QString& table = QString::null ); 17 OSQLQueryOrder(const QString& table = QString::null );
15 OSQLQueryOrder( const OSQLQueryOrder& ); 18 OSQLQueryOrder( const OSQLQueryOrder& );
16 ~OSQLQueryOrder(); 19 ~OSQLQueryOrder();
17 void setOrderFields( const QStringList& list ); 20 void setOrderFields( const QStringList& list );
18 void setValue( const QString& fieldName, const QString& Value ); 21 void setValue( const QString& fieldName, const QString& Value );
19 void setValues( const QMap<QString, QString>& ); 22 void setValues( const QMap<QString, QString>& );
20 QMap<QString, QString> orders() const; 23 QMap<QString, QString> orders() const;
21 QString orderStatement()const; 24 QString orderStatement()const;
22 OSQLQueryOrder &operator=(const OSQLQueryOrder& ); 25 OSQLQueryOrder &operator=(const OSQLQueryOrder& );
23private: 26private:
24 QMap<QString, QString> m_fields; 27 QMap<QString, QString> m_fields;
25 class OSQLQueryOrderPrivate; 28 class OSQLQueryOrderPrivate;
26 OSQLQueryOrderPrivate* d; 29 OSQLQueryOrderPrivate* d;
27}; 30};
28class OSQLWhere { 31class OSQLWhere {
29public: 32public:
30 typedef QValueList<OSQLWhere> ValueList; 33 typedef QValueList<OSQLWhere> ValueList;
31 enum Vergleiche { Equal = 0, Like, Greater, GreaterEqual, 34 enum Vergleiche { Equal = 0, Like, Greater, GreaterEqual,
32 Smaller, SmallerEqual }; 35 Smaller, SmallerEqual };
33 OSQLWhere(const QString& table = QString::null ); 36 OSQLWhere(const QString& table = QString::null );
34 ~OSQLWhere(); 37 ~OSQLWhere();
35 void setExpression(const QString& key, enum Vergleiche, const QString& ); 38 void setExpression(const QString& key, enum Vergleiche, const QString& );
36 QString statement()const; 39 QString statement()const;
37private: 40private:
38 int m_vergleich; 41 int m_vergleich;
39 const QString& m_left; 42 const QString& m_left;
40 const QString& m_right; 43 const QString& m_right;
41 44
42}; 45};
43*/ 46*/
44class OSQLQuery { 47class OSQLQuery {
45public: 48public:
46 OSQLQuery(); 49 OSQLQuery();
47 virtual ~OSQLQuery(); 50 virtual ~OSQLQuery();
48 51
49 virtual QString query()const = 0; 52 virtual QString query()const = 0;
53private:
54 class Private;
55 Private *d;
50}; 56};
51 57
52class OSQLRawQuery : public OSQLQuery { 58class OSQLRawQuery : public OSQLQuery {
53public: 59public:
54 OSQLRawQuery( const QString& query ); 60 OSQLRawQuery( const QString& query );
55 ~OSQLRawQuery(); 61 ~OSQLRawQuery();
56 QString query() const; 62 QString query() const;
57private: 63private:
58 class OSQLRawQueryPrivate; 64 class OSQLRawQueryPrivate;
59 OSQLRawQueryPrivate* d; 65 OSQLRawQueryPrivate* d;
60 QString m_query; 66 QString m_query;
61 67
62}; 68};
63/* I'm not happy with them again 69/* I'm not happy with them again
64class OSQLSelectQuery : public OSQLQuery { 70class OSQLSelectQuery : public OSQLQuery {
65public: 71public:
66 OSQLSelectQuery(); 72 OSQLSelectQuery();
67 ~OSQLSelectQuery(); 73 ~OSQLSelectQuery();
68 void setTables( const QStringList& allTablesToQuery ); 74 void setTables( const QStringList& allTablesToQuery );
69 void setValues( const QString& table, const QStringList& columns ); 75 void setValues( const QString& table, const QStringList& columns );
70 void setOrder( const OSQLSelectQuery& ); 76 void setOrder( const OSQLSelectQuery& );
71 void setOrderList( const OSQLQueryOrder::ValueList& ); 77 void setOrderList( const OSQLQueryOrder::ValueList& );
72 void setWhereList( const OSQLWhere& ); 78 void setWhereList( const OSQLWhere& );
73 void setWhereList( const OSQLWhere::ValueList& ); 79 void setWhereList( const OSQLWhere::ValueList& );
@@ -98,25 +104,27 @@ public:
98 OSQLDeleteQuery(const QString& table); 104 OSQLDeleteQuery(const QString& table);
99 ~OSQLDeleteQuery(); 105 ~OSQLDeleteQuery();
100 void setWhere( const OSQLWhere& ); 106 void setWhere( const OSQLWhere& );
101 void setWheres( const OSQLWhere::ValueList& ); 107 void setWheres( const OSQLWhere::ValueList& );
102 QString query()const; 108 QString query()const;
103private: 109private:
104 QString m_table; 110 QString m_table;
105 OSQLWhere::ValueList m_where; 111 OSQLWhere::ValueList m_where;
106 112
107}; 113};
108class OSQLUpdateQuery : public OSQLQuery { 114class OSQLUpdateQuery : public OSQLQuery {
109public: 115public:
110 OSQLUpdateQuery( const QString& table ); 116 OSQLUpdateQuery( const QString& table );
111 ~OSQLUpdateQuery(); 117 ~OSQLUpdateQuery();
112 void setWhere( const OSQLWhere& ); 118 void setWhere( const OSQLWhere& );
113 void setWheres( const OSQLWhere::ValueList& ); 119 void setWheres( const OSQLWhere::ValueList& );
114 */ 120 */
115 /* replaces all previous set Values */ 121 /* replaces all previous set Values */
116 /* 122 /*
117 void setValue( const QString& field, const QString& value ); 123 void setValue( const QString& field, const QString& value );
118 void setValue( const QMap<QString, QString> &fields ); 124 void setValue( const QMap<QString, QString> &fields );
119 QString query() const; 125 QString query() const;
120}; 126};
121*/ 127*/
128}
129}
122#endif 130#endif