summaryrefslogtreecommitdiff
path: root/libopie/pim/ocontactaccess.h
Unidiff
Diffstat (limited to 'libopie/pim/ocontactaccess.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/ocontactaccess.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/libopie/pim/ocontactaccess.h b/libopie/pim/ocontactaccess.h
index d7ceaf2..e90db32 100644
--- a/libopie/pim/ocontactaccess.h
+++ b/libopie/pim/ocontactaccess.h
@@ -1,162 +1,164 @@
1/* 1/*
2 * Class to manage the Contacts. 2 * Class to manage the Contacts.
3 * 3 *
4 * Copyright (c) 2002 by Stefan Eilers (Eilers.Stefan@epost.de) 4 * Copyright (c) 2002 by Stefan Eilers (Eilers.Stefan@epost.de)
5 * Copyright (c) 2002 by Holger Freyther (zecke@handhelds.org) 5 * Copyright (c) 2002 by Holger Freyther (zecke@handhelds.org)
6 * 6 *
7 * ===================================================================== 7 * =====================================================================
8 *This program is free software; you can redistribute it and/or 8 *This program is free software; you can redistribute it and/or
9 *modify it under the terms of the GNU Library General Public 9 *modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; 10 * License as published by the Free Software Foundation;
11 * either version 2 of the License, or (at your option) any later 11 * either version 2 of the License, or (at your option) any later
12 * version. 12 * version.
13 * ===================================================================== 13 * =====================================================================
14 * ToDo: Define enum for query settings 14 * ToDo: Define enum for query settings
15 * ===================================================================== 15 * =====================================================================
16 * Version: $Id$ 16 * Version: $Id$
17 * ===================================================================== 17 * =====================================================================
18 * History: 18 * History:
19 * $Log$ 19 * $Log$
20 * Revision 1.8 2003/05/08 13:55:09 tille
21 * search stuff
22 * and match, toRichText & toShortText in oevent
23 *
20 * Revision 1.7 2003/04/13 18:07:10 zecke 24 * Revision 1.7 2003/04/13 18:07:10 zecke
21 * More API doc 25 * More API doc
22 * QString -> const QString& 26 * QString -> const QString&
23 * QString = 0l -> QString::null 27 * QString = 0l -> QString::null
24 * 28 *
25 * Revision 1.6 2003/01/02 14:27:12 eilers 29 * Revision 1.6 2003/01/02 14:27:12 eilers
26 * Improved query by example: Search by date is possible.. First step 30 * Improved query by example: Search by date is possible.. First step
27 * for a today plugin for birthdays.. 31 * for a today plugin for birthdays..
28 * 32 *
29 * Revision 1.5 2002/11/13 14:14:51 eilers 33 * Revision 1.5 2002/11/13 14:14:51 eilers
30 * Added sorted for Contacts.. 34 * Added sorted for Contacts..
31 * 35 *
32 * Revision 1.4 2002/11/01 15:10:42 eilers 36 * Revision 1.4 2002/11/01 15:10:42 eilers
33 * Added regExp-search in database for all fields in a contact. 37 * Added regExp-search in database for all fields in a contact.
34 * 38 *
35 * Revision 1.3 2002/10/16 10:52:40 eilers 39 * Revision 1.3 2002/10/16 10:52:40 eilers
36 * Added some docu to the interface and now using the cache infrastucture by zecke.. :) 40 * Added some docu to the interface and now using the cache infrastucture by zecke.. :)
37 * 41 *
38 * Revision 1.2 2002/10/14 16:21:54 eilers 42 * Revision 1.2 2002/10/14 16:21:54 eilers
39 * Some minor interface updates 43 * Some minor interface updates
40 * 44 *
41 * Revision 1.1 2002/09/27 17:11:44 eilers 45 * Revision 1.1 2002/09/27 17:11:44 eilers
42 * Added API for accessing the Contact-Database ! It is compiling, but 46 * Added API for accessing the Contact-Database ! It is compiling, but
43 * please do not expect that anything is working ! 47 * please do not expect that anything is working !
44 * I will debug that stuff in the next time .. 48 * I will debug that stuff in the next time ..
45 * Please read README_COMPILE for compiling ! 49 * Please read README_COMPILE for compiling !
46 * 50 *
47 * ===================================================================== 51 * =====================================================================
48 */ 52 */
49#ifndef _OCONTACTACCESS_H 53#ifndef _OCONTACTACCESS_H
50#define _OCONTACTACCESS_H 54#define _OCONTACTACCESS_H
51 55
52#include <qobject.h> 56#include <qobject.h>
53 57
54#include <qpe/qcopenvelope_qws.h> 58#include <qpe/qcopenvelope_qws.h>
55 59
56#include <qvaluelist.h> 60#include <qvaluelist.h>
57#include <qfileinfo.h> 61#include <qfileinfo.h>
58 62
59#include "ocontact.h" 63#include "ocontact.h"
60#include "ocontactaccessbackend.h" 64#include "ocontactaccessbackend.h"
61#include "opimaccesstemplate.h" 65#include "opimaccesstemplate.h"
62 66
63/** 67/**
64 * Class to access the contacts database. 68 * Class to access the contacts database.
65 * This is just a frontend for the real database handling which is 69 * This is just a frontend for the real database handling which is
66 * done by the backend. 70 * done by the backend.
67 * This class is used to access the Contacts on a system. This class as any OPIE PIM 71 * This class is used to access the Contacts on a system. This class as any OPIE PIM
68 * class is backend independent. 72 * class is backend independent.
69 73
70 * @see OPimAccessTemplate 74 * @see OPimAccessTemplate
71 */ 75 */
72class OContactAccess: public QObject, public OPimAccessTemplate<OContact> 76class OContactAccess: public QObject, public OPimAccessTemplate<OContact>
73{ 77{
74 Q_OBJECT 78 Q_OBJECT
75 79
76 public: 80 public:
77 /** 81 /**
78 * Create Database with contacts (addressbook). 82 * Create Database with contacts (addressbook).
79 * @param appname Name of application which wants access to the database 83 * @param appname Name of application which wants access to the database
80 * (i.e. "todolist") 84 * (i.e. "todolist")
81 * @param filename The name of the database file. If not set, the default one 85 * @param filename The name of the database file. If not set, the default one
82 * is used. 86 * is used.
83 * @param backend Pointer to an alternative Backend. If not set, we will use 87 * @param backend Pointer to an alternative Backend. If not set, we will use
84 * the default backend. 88 * the default backend.
85 * @param handlesync If <b>true</b> the database stores the current state 89 * @param handlesync If <b>true</b> the database stores the current state
86 * automatically if it receives the signals <i>flush()</i> and <i>reload()</i> 90 * automatically if it receives the signals <i>flush()</i> and <i>reload()</i>
87 * which are used before and after synchronisation. If the application wants 91 * which are used before and after synchronisation. If the application wants
88 * to react itself, it should be disabled by setting it to <b>false</b> 92 * to react itself, it should be disabled by setting it to <b>false</b>
89 * @see OContactAccessBackend 93 * @see OContactAccessBackend
90 */ 94 */
91 OContactAccess (const QString appname, const QString filename = 0l, 95 OContactAccess (const QString appname, const QString filename = 0l,
92 OContactAccessBackend* backend = 0l, bool handlesync = true); 96 OContactAccessBackend* backend = 0l, bool handlesync = true);
93 ~OContactAccess (); 97 ~OContactAccess ();
94 98
95 /** Constants for query. 99 /** Constants for query.
96 * Use this constants to set the query parameters. 100 * Use this constants to set the query parameters.
97 * Note: <i>query_IgnoreCase</i> just make sense with one of the other attributes ! 101 * Note: <i>query_IgnoreCase</i> just make sense with one of the other attributes !
98 * @see queryByExample() 102 * @see queryByExample()
99 */ 103 */
100 enum QuerySettings { 104 enum QuerySettings {
101 WildCards = 0x0001, 105 WildCards = 0x0001,
102 IgnoreCase = 0x0002, 106 IgnoreCase = 0x0002,
103 RegExp = 0x0004, 107 RegExp = 0x0004,
104 ExactMatch = 0x0008, 108 ExactMatch = 0x0008,
105 MatchOne = 0x0010, // Only one Entry must match 109 MatchOne = 0x0010, // Only one Entry must match
106 DateDiff = 0x0020, // Find all entries from today until given date 110 DateDiff = 0x0020, // Find all entries from today until given date
107 DateYear = 0x0040, // The year matches 111 DateYear = 0x0040, // The year matches
108 DateMonth = 0x0080, // The month matches 112 DateMonth = 0x0080, // The month matches
109 DateDay = 0x0100, // The day matches 113 DateDay = 0x0100, // The day matches
110 }; 114 };
111 115
112 116
113 ORecordList<OContact> matchRegexp( const QRegExp &r )const;
114
115 /** Return all Contacts in a sorted manner. 117 /** Return all Contacts in a sorted manner.
116 * @param ascending true: Sorted in acending order. 118 * @param ascending true: Sorted in acending order.
117 * @param sortOrder Currently not implemented. Just defined to stay compatible to otodoaccess 119 * @param sortOrder Currently not implemented. Just defined to stay compatible to otodoaccess
118 * @param sortFilter Currently not implemented. Just defined to stay compatible to otodoaccess 120 * @param sortFilter Currently not implemented. Just defined to stay compatible to otodoaccess
119 * @param cat Currently not implemented. Just defined to stay compatible to otodoaccess 121 * @param cat Currently not implemented. Just defined to stay compatible to otodoaccess
120 */ 122 */
121 List sorted( bool ascending, int sortOrder, int sortFilter, int cat ) const; 123 List sorted( bool ascending, int sortOrder, int sortFilter, int cat ) const;
122 124
123 /** Return all possible settings. 125 /** Return all possible settings.
124 * @return All settings provided by the current backend 126 * @return All settings provided by the current backend
125 * (i.e.: query_WildCards & query_IgnoreCase) 127 * (i.e.: query_WildCards & query_IgnoreCase)
126 */ 128 */
127 const uint querySettings(); 129 const uint querySettings();
128 130
129 /** Check whether settings are correct. 131 /** Check whether settings are correct.
130 * @return <i>true</i> if the given settings are correct and possible. 132 * @return <i>true</i> if the given settings are correct and possible.
131 */ 133 */
132 bool hasQuerySettings ( int querySettings ) const; 134 bool hasQuerySettings ( int querySettings ) const;
133 135
134 /** 136 /**
135 * if the resource was changed externally. 137 * if the resource was changed externally.
136 * You should use the signal instead of polling possible changes ! 138 * You should use the signal instead of polling possible changes !
137 */ 139 */
138 bool wasChangedExternally()const; 140 bool wasChangedExternally()const;
139 141
140 142
141 /** Save contacts database. 143 /** Save contacts database.
142 * Save is more a "commit". After calling this function, all changes are public available. 144 * Save is more a "commit". After calling this function, all changes are public available.
143 * @return true if successful 145 * @return true if successful
144 */ 146 */
145 bool save(); 147 bool save();
146 148
147 signals: 149 signals:
148 /* Signal is emitted if the database was changed. Therefore 150 /* Signal is emitted if the database was changed. Therefore
149 * we may need to reload to stay consistent. 151 * we may need to reload to stay consistent.
150 * @param which Pointer to the database who created this event. This pointer 152 * @param which Pointer to the database who created this event. This pointer
151 * is useful if an application has to handle multiple databases at the same time. 153 * is useful if an application has to handle multiple databases at the same time.
152 * @see reload() 154 * @see reload()
153 */ 155 */
154 void signalChanged ( const OContactAccess *which ); 156 void signalChanged ( const OContactAccess *which );
155 157
156 158
157 private: 159 private:
158 // class OContactAccessPrivate; 160 // class OContactAccessPrivate;
159 // OContactAccessPrivate* d; 161 // OContactAccessPrivate* d;
160 OContactAccessBackend *m_backEnd; 162 OContactAccessBackend *m_backEnd;
161 bool m_loading:1; 163 bool m_loading:1;
162 164