summaryrefslogtreecommitdiff
authorzecke <zecke>2005-06-27 18:10:40 (UTC)
committer zecke <zecke>2005-06-27 18:10:40 (UTC)
commitc3d21fe2179b4841cc95b4ee9ecac6b053e9ee17 (patch) (unidiff)
tree08b679694ca1de724e3017f2dd259e47f3498fd1
parentcecffa1dc3a7bd1526be00e7bc4a4a151e6f2c9c (diff)
downloadopie-c3d21fe2179b4841cc95b4ee9ecac6b053e9ee17.zip
opie-c3d21fe2179b4841cc95b4ee9ecac6b053e9ee17.tar.gz
opie-c3d21fe2179b4841cc95b4ee9ecac6b053e9ee17.tar.bz2
Add the two new sort flags
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/core/ocontactaccess.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/libopie2/opiepim/core/ocontactaccess.h b/libopie2/opiepim/core/ocontactaccess.h
index 9a2ecaf..88bf672 100644
--- a/libopie2/opiepim/core/ocontactaccess.h
+++ b/libopie2/opiepim/core/ocontactaccess.h
@@ -1,162 +1,164 @@
1/* 1/*
2 This file is part of the Opie Project 2 This file is part of the Opie Project
3 Copyright (C) The Main Author <main-author@whereever.org> 3 Copyright (C) The Main Author <main-author@whereever.org>
4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org> 4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org>
5 .=l. 5 .=l.
6 .>+-= 6 .>+-=
7 _;:, .> :=|. This program is free software; you can 7 _;:, .> :=|. This program is free software; you can
8.> <`_, > . <= redistribute it and/or modify it under 8.> <`_, > . <= redistribute it and/or modify it under
9:`=1 )Y*s>-.-- : the terms of the GNU Library General Public 9:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
10.="- .-=="i, .._ License as published by the Free Software 10.="- .-=="i, .._ License as published by the Free Software
11 - . .-<_> .<> Foundation; either version 2 of the License, 11 - . .-<_> .<> Foundation; either version 2 of the License,
12 ._= =} : or (at your option) any later version. 12 ._= =} : or (at your option) any later version.
13 .%`+i> _;_. 13 .%`+i> _;_.
14 .i_,=:_. -<s. This program is distributed in the hope that 14 .i_,=:_. -<s. This program is distributed in the hope that
15 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 15 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
16 : .. .:, . . . without even the implied warranty of 16 : .. .:, . . . without even the implied warranty of
17 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 17 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
18 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU 18 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.= = ; Library General Public License for more 19..}^=.= = ; Library General Public License for more
20++= -. .` .: details. 20++= -. .` .: details.
21 : = ...= . :.=- 21 : = ...= . :.=-
22 -. .:....=;==+<; You should have received a copy of the GNU 22 -. .:....=;==+<; You should have received a copy of the GNU
23 -_. . . )=. = Library General Public License along with 23 -_. . . )=. = Library General Public License along with
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/* 29/*
30 * ===================================================================== 30 * =====================================================================
31 * ToDo: Define enum for query settings 31 * ToDo: Define enum for query settings
32 * ===================================================================== 32 * =====================================================================
33 */ 33 */
34#ifndef _OCONTACTACCESS_H 34#ifndef _OCONTACTACCESS_H
35#define _OCONTACTACCESS_H 35#define _OCONTACTACCESS_H
36 36
37#include <qobject.h> 37#include <qobject.h>
38 38
39#include <qpe/qcopenvelope_qws.h> 39#include <qpe/qcopenvelope_qws.h>
40 40
41#include <qvaluelist.h> 41#include <qvaluelist.h>
42#include <qfileinfo.h> 42#include <qfileinfo.h>
43 43
44#include <opie2/opimcontact.h> 44#include <opie2/opimcontact.h>
45#include <opie2/ocontactaccessbackend.h> 45#include <opie2/ocontactaccessbackend.h>
46#include <opie2/opimaccesstemplate.h> 46#include <opie2/opimaccesstemplate.h>
47 47
48namespace Opie { 48namespace Opie {
49/** 49/**
50 * Class to access the contacts database. 50 * Class to access the contacts database.
51 * This is just a frontend for the real database handling which is 51 * This is just a frontend for the real database handling which is
52 * done by the backend. 52 * done by the backend.
53 * This class is used to access the Contacts on a system. This class as any OPIE PIM 53 * This class is used to access the Contacts on a system. This class as any OPIE PIM
54 * class is backend independent. 54 * class is backend independent.
55 * @author Stefan Eilers, Holger Freyther 55 * @author Stefan Eilers, Holger Freyther
56 * @see OPimAccessTemplate 56 * @see OPimAccessTemplate
57 */ 57 */
58class OPimContactAccess: public QObject, public OPimAccessTemplate<OPimContact> 58class OPimContactAccess: public QObject, public OPimAccessTemplate<OPimContact>
59{ 59{
60 Q_OBJECT 60 Q_OBJECT
61 61
62 public: 62 public:
63 /** 63 /**
64 * Filter for sorted() 64 * Filter for sorted()
65 * @see SortFilterBase in OPimBase 65 * @see SortFilterBase in OPimBase
66 */ 66 */
67 enum SortFilter { 67 enum SortFilter {
68 /** Don't return entries who don't have children */ 68 /** Don't return entries who don't have children */
69 DoNotShowWithoutChildren = FilterCustom<<1, 69 DoNotShowWithoutChildren = FilterCustom<<1,
70 /** Don't return entries who don't have an anniversary */ 70 /** Don't return entries who don't have an anniversary */
71 DoNotShowWithoutAnniversary = FilterCustom<<2, 71 DoNotShowWithoutAnniversary = FilterCustom<<2,
72 /** Don't return entries who don't have a birthday */ 72 /** Don't return entries who don't have a birthday */
73 DoNotShowWithoutBirthday = FilterCustom<<3, 73 DoNotShowWithoutBirthday = FilterCustom<<3,
74 /** Don't return entries who don't have a home address */ 74 /** Don't return entries who don't have a home address */
75 DoNotShowWithoutHomeAddress = FilterCustom<<4, 75 DoNotShowWithoutHomeAddress = FilterCustom<<4,
76 /** Don't return entries who don't have a business address */ 76 /** Don't return entries who don't have a business address */
77 DoNotShowWithoutBusinessAddress = FilterCustom<<5, 77 DoNotShowWithoutBusinessAddress = FilterCustom<<5,
78 /** Don't return entries which hava any category */ 78 /** Don't return entries which hava any category */
79 DoNotShowWithCategory = FilterCustom << 6 79 DoNotShowWithCategory = FilterCustom << 6
80 }; 80 };
81 81
82 /** 82 /**
83 * Sort order for sorted() 83 * Sort order for sorted()
84 * @see SortOrderBase in OPimBase 84 * @see SortOrderBase in OPimBase
85 */ 85 */
86 enum SortOrder { 86 enum SortOrder {
87 SortTitle = SortCustom, 87 SortTitle = SortCustom,
88 SortFirstName, 88 SortFirstName,
89 SortMiddleName, 89 SortMiddleName,
90 SortLastName, 90 SortLastName,
91 SortSuffix, 91 SortSuffix,
92 SortEmail, 92 SortEmail,
93 SortNickname, 93 SortNickname,
94 SortFileAsName, 94 SortFileAsName,
95 SortAnniversary, 95 SortAnniversary,
96 SortBirthday, 96 SortBirthday,
97 SortGender 97 SortGender,
98 SortBirthdayWithoutYear,
99 SortAnniversaryWithoutYear
98 }; 100 };
99 101
100 /** 102 /**
101 * Create Database with contacts (addressbook). 103 * Create Database with contacts (addressbook).
102 * @param appname Name of application which wants access to the database 104 * @param appname Name of application which wants access to the database
103 * (i.e. "todolist") 105 * (i.e. "todolist")
104 * @param filename The name of the database file. If not set, the default one 106 * @param filename The name of the database file. If not set, the default one
105 * is used. 107 * is used.
106 * @param backend Pointer to an alternative Backend. If not set, we will use 108 * @param backend Pointer to an alternative Backend. If not set, we will use
107 * the default backend. 109 * the default backend.
108 * @param handlesync If <b>true</b> the database stores the current state 110 * @param handlesync If <b>true</b> the database stores the current state
109 * automatically if it receives the signals <i>flush()</i> and <i>reload()</i> 111 * automatically if it receives the signals <i>flush()</i> and <i>reload()</i>
110 * which are used before and after synchronisation. If the application wants 112 * which are used before and after synchronisation. If the application wants
111 * to react itself, it should be disabled by setting it to <b>false</b> 113 * to react itself, it should be disabled by setting it to <b>false</b>
112 * @see OPimContactAccessBackend 114 * @see OPimContactAccessBackend
113 */ 115 */
114 OPimContactAccess (const QString appname, const QString filename = 0l, 116 OPimContactAccess (const QString appname, const QString filename = 0l,
115 OPimContactAccessBackend* backend = 0l, bool handlesync = true); 117 OPimContactAccessBackend* backend = 0l, bool handlesync = true);
116 ~OPimContactAccess (); 118 ~OPimContactAccess ();
117 119
118 120
119 /** 121 /**
120 * if the resource was changed externally. 122 * if the resource was changed externally.
121 * You should use the signal instead of polling possible changes ! 123 * You should use the signal instead of polling possible changes !
122 */ 124 */
123 bool wasChangedExternally()const; 125 bool wasChangedExternally()const;
124 126
125 127
126 /** Save contacts database. 128 /** Save contacts database.
127 * Save is more a "commit". After calling this function, all changes are public available. 129 * Save is more a "commit". After calling this function, all changes are public available.
128 * @return true if successful 130 * @return true if successful
129 */ 131 */
130 bool save(); 132 bool save();
131 133
132 /** 134 /**
133 * Return identification of used records 135 * Return identification of used records
134 */ 136 */
135 int rtti() const; 137 int rtti() const;
136 138
137 signals: 139 signals:
138 /* Signal is emitted if the database was changed. Therefore 140 /* Signal is emitted if the database was changed. Therefore
139 * we may need to reload to stay consistent. 141 * we may need to reload to stay consistent.
140 * @param which Pointer to the database who created this event. This pointer 142 * @param which Pointer to the database who created this event. This pointer
141 * is useful if an application has to handle multiple databases at the same time. 143 * is useful if an application has to handle multiple databases at the same time.
142 * @see reload() 144 * @see reload()
143 */ 145 */
144 void signalChanged ( const OPimContactAccess *which ); 146 void signalChanged ( const OPimContactAccess *which );
145 147
146 148
147 private: 149 private:
148 OPimContactAccessBackend *m_backEnd; 150 OPimContactAccessBackend *m_backEnd;
149 bool m_loading:1; 151 bool m_loading:1;
150 152
151 private slots: 153 private slots:
152 void copMessage( const QCString &msg, const QByteArray &data ); 154 void copMessage( const QCString &msg, const QByteArray &data );
153 155
154 private: 156 private:
155 class Private; 157 class Private;
156 Private *d; 158 Private *d;
157 159
158}; 160};
159 161
160} 162}
161 163
162#endif 164#endif