summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core/ocontactaccess.h
Unidiff
Diffstat (limited to 'libopie2/opiepim/core/ocontactaccess.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/core/ocontactaccess.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/libopie2/opiepim/core/ocontactaccess.h b/libopie2/opiepim/core/ocontactaccess.h
index 32b2dcb..d7ceaf2 100644
--- a/libopie2/opiepim/core/ocontactaccess.h
+++ b/libopie2/opiepim/core/ocontactaccess.h
@@ -1,126 +1,136 @@
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.7 2003/04/13 18:07:10 zecke
21 * More API doc
22 * QString -> const QString&
23 * QString = 0l -> QString::null
24 *
20 * Revision 1.6 2003/01/02 14:27:12 eilers 25 * Revision 1.6 2003/01/02 14:27:12 eilers
21 * Improved query by example: Search by date is possible.. First step 26 * Improved query by example: Search by date is possible.. First step
22 * for a today plugin for birthdays.. 27 * for a today plugin for birthdays..
23 * 28 *
24 * Revision 1.5 2002/11/13 14:14:51 eilers 29 * Revision 1.5 2002/11/13 14:14:51 eilers
25 * Added sorted for Contacts.. 30 * Added sorted for Contacts..
26 * 31 *
27 * Revision 1.4 2002/11/01 15:10:42 eilers 32 * Revision 1.4 2002/11/01 15:10:42 eilers
28 * Added regExp-search in database for all fields in a contact. 33 * Added regExp-search in database for all fields in a contact.
29 * 34 *
30 * Revision 1.3 2002/10/16 10:52:40 eilers 35 * Revision 1.3 2002/10/16 10:52:40 eilers
31 * Added some docu to the interface and now using the cache infrastucture by zecke.. :) 36 * Added some docu to the interface and now using the cache infrastucture by zecke.. :)
32 * 37 *
33 * Revision 1.2 2002/10/14 16:21:54 eilers 38 * Revision 1.2 2002/10/14 16:21:54 eilers
34 * Some minor interface updates 39 * Some minor interface updates
35 * 40 *
36 * Revision 1.1 2002/09/27 17:11:44 eilers 41 * Revision 1.1 2002/09/27 17:11:44 eilers
37 * Added API for accessing the Contact-Database ! It is compiling, but 42 * Added API for accessing the Contact-Database ! It is compiling, but
38 * please do not expect that anything is working ! 43 * please do not expect that anything is working !
39 * I will debug that stuff in the next time .. 44 * I will debug that stuff in the next time ..
40 * Please read README_COMPILE for compiling ! 45 * Please read README_COMPILE for compiling !
41 * 46 *
42 * ===================================================================== 47 * =====================================================================
43 */ 48 */
44#ifndef _OCONTACTACCESS_H 49#ifndef _OCONTACTACCESS_H
45#define _OCONTACTACCESS_H 50#define _OCONTACTACCESS_H
46 51
47#include <qobject.h> 52#include <qobject.h>
48 53
49#include <qpe/qcopenvelope_qws.h> 54#include <qpe/qcopenvelope_qws.h>
50 55
51#include <qvaluelist.h> 56#include <qvaluelist.h>
52#include <qfileinfo.h> 57#include <qfileinfo.h>
53 58
54#include "ocontact.h" 59#include "ocontact.h"
55#include "ocontactaccessbackend.h" 60#include "ocontactaccessbackend.h"
56#include "opimaccesstemplate.h" 61#include "opimaccesstemplate.h"
57 62
58/** Class to access the contacts database. 63/**
64 * Class to access the contacts database.
59 * This is just a frontend for the real database handling which is 65 * This is just a frontend for the real database handling which is
60 * done by the backend. 66 * done by the backend.
67 * This class is used to access the Contacts on a system. This class as any OPIE PIM
68 * class is backend independent.
69
61 * @see OPimAccessTemplate 70 * @see OPimAccessTemplate
62 */ 71 */
63class OContactAccess: public QObject, public OPimAccessTemplate<OContact> 72class OContactAccess: public QObject, public OPimAccessTemplate<OContact>
64{ 73{
65 Q_OBJECT 74 Q_OBJECT
66 75
67 public: 76 public:
68 /** Create Database with contacts (addressbook). 77 /**
78 * Create Database with contacts (addressbook).
69 * @param appname Name of application which wants access to the database 79 * @param appname Name of application which wants access to the database
70 * (i.e. "todolist") 80 * (i.e. "todolist")
71 * @param filename The name of the database file. If not set, the default one 81 * @param filename The name of the database file. If not set, the default one
72 * is used. 82 * is used.
73 * @param backend Pointer to an alternative Backend. If not set, we will use 83 * @param backend Pointer to an alternative Backend. If not set, we will use
74 * the default backend. 84 * the default backend.
75 * @param handlesync If <b>true</b> the database stores the current state 85 * @param handlesync If <b>true</b> the database stores the current state
76 * automatically if it receives the signals <i>flush()</i> and <i>reload()</i> 86 * automatically if it receives the signals <i>flush()</i> and <i>reload()</i>
77 * which are used before and after synchronisation. If the application wants 87 * which are used before and after synchronisation. If the application wants
78 * to react itself, it should be disabled by setting it to <b>false</b> 88 * to react itself, it should be disabled by setting it to <b>false</b>
79 * @see OContactAccessBackend 89 * @see OContactAccessBackend
80 */ 90 */
81 OContactAccess (const QString appname, const QString filename = 0l, 91 OContactAccess (const QString appname, const QString filename = 0l,
82 OContactAccessBackend* backend = 0l, bool handlesync = true); 92 OContactAccessBackend* backend = 0l, bool handlesync = true);
83 ~OContactAccess (); 93 ~OContactAccess ();
84 94
85 /** Constants for query. 95 /** Constants for query.
86 * Use this constants to set the query parameters. 96 * Use this constants to set the query parameters.
87 * Note: <i>query_IgnoreCase</i> just make sense with one of the other attributes ! 97 * Note: <i>query_IgnoreCase</i> just make sense with one of the other attributes !
88 * @see queryByExample() 98 * @see queryByExample()
89 */ 99 */
90 enum QuerySettings { 100 enum QuerySettings {
91 WildCards = 0x0001, 101 WildCards = 0x0001,
92 IgnoreCase = 0x0002, 102 IgnoreCase = 0x0002,
93 RegExp = 0x0004, 103 RegExp = 0x0004,
94 ExactMatch = 0x0008, 104 ExactMatch = 0x0008,
95 MatchOne = 0x0010, // Only one Entry must match 105 MatchOne = 0x0010, // Only one Entry must match
96 DateDiff = 0x0020, // Find all entries from today until given date 106 DateDiff = 0x0020, // Find all entries from today until given date
97 DateYear = 0x0040, // The year matches 107 DateYear = 0x0040, // The year matches
98 DateMonth = 0x0080, // The month matches 108 DateMonth = 0x0080, // The month matches
99 DateDay = 0x0100, // The day matches 109 DateDay = 0x0100, // The day matches
100 }; 110 };
101 111
102 112
103 ORecordList<OContact> matchRegexp( const QRegExp &r )const; 113 ORecordList<OContact> matchRegexp( const QRegExp &r )const;
104 114
105 /** Return all Contacts in a sorted manner. 115 /** Return all Contacts in a sorted manner.
106 * @param ascending true: Sorted in acending order. 116 * @param ascending true: Sorted in acending order.
107 * @param sortOrder Currently not implemented. Just defined to stay compatible to otodoaccess 117 * @param sortOrder Currently not implemented. Just defined to stay compatible to otodoaccess
108 * @param sortFilter Currently not implemented. Just defined to stay compatible to otodoaccess 118 * @param sortFilter Currently not implemented. Just defined to stay compatible to otodoaccess
109 * @param cat Currently not implemented. Just defined to stay compatible to otodoaccess 119 * @param cat Currently not implemented. Just defined to stay compatible to otodoaccess
110 */ 120 */
111 List sorted( bool ascending, int sortOrder, int sortFilter, int cat ) const; 121 List sorted( bool ascending, int sortOrder, int sortFilter, int cat ) const;
112 122
113 /** Return all possible settings. 123 /** Return all possible settings.
114 * @return All settings provided by the current backend 124 * @return All settings provided by the current backend
115 * (i.e.: query_WildCards & query_IgnoreCase) 125 * (i.e.: query_WildCards & query_IgnoreCase)
116 */ 126 */
117 const uint querySettings(); 127 const uint querySettings();
118 128
119 /** Check whether settings are correct. 129 /** Check whether settings are correct.
120 * @return <i>true</i> if the given settings are correct and possible. 130 * @return <i>true</i> if the given settings are correct and possible.
121 */ 131 */
122 bool hasQuerySettings ( int querySettings ) const; 132 bool hasQuerySettings ( int querySettings ) const;
123 133
124 /** 134 /**
125 * if the resource was changed externally. 135 * if the resource was changed externally.
126 * You should use the signal instead of polling possible changes ! 136 * You should use the signal instead of polling possible changes !