summaryrefslogtreecommitdiff
path: root/core/pim
Unidiff
Diffstat (limited to 'core/pim') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/addressbook/ocontactfields.cpp85
1 files changed, 38 insertions, 47 deletions
diff --git a/core/pim/addressbook/ocontactfields.cpp b/core/pim/addressbook/ocontactfields.cpp
index 7823a9c..0da6a4f 100644
--- a/core/pim/addressbook/ocontactfields.cpp
+++ b/core/pim/addressbook/ocontactfields.cpp
@@ -1,102 +1,127 @@
1 1
2#include "ocontactfields.h" 2#include "ocontactfields.h"
3 3
4#include <qstringlist.h> 4#include <qstringlist.h>
5#include <qobject.h> 5#include <qobject.h>
6 6
7// We should use our own enum in the future .. 7// We should use our own enum in the future ..
8#include <qpe/recordfields.h> 8#include <qpe/recordfields.h>
9 9
10/*! 10/*!
11 \internal 11 \internal
12 Returns a list of details field names for a contact. 12 Returns a list of details field names for a contact.
13*/ 13*/
14QStringList OContactFields::untrdetailsfields( bool sorted ) 14QStringList OContactFields::untrdetailsfields( bool sorted )
15{ 15{
16 QStringList list; 16 QStringList list;
17 17
18 list.append( "Office" ); 18 list.append( "Office" );
19 list.append( "Profession" ); 19 list.append( "Profession" );
20 list.append( "Assistant" ); 20 list.append( "Assistant" );
21 list.append( "Manager" ); 21 list.append( "Manager" );
22
22 list.append( "Spouse" ); 23 list.append( "Spouse" );
23 list.append( "Gender" ); 24 list.append( "Gender" );
24 list.append( "Birthday" ); 25 list.append( "Birthday" );
25 list.append( "Anniversary" ); 26 list.append( "Anniversary" );
26 list.append( "Nickname" ); 27 list.append( "Nickname" );
27 list.append( "Children" ); 28 list.append( "Children" );
28 29
29 if (sorted) list.sort(); 30 if (sorted) list.sort();
31 return list;
32}
33
34/*!
35 \internal
36 Returns a translated list of details field names for a contact.
37*/
38QStringList OContactFields::trdetailsfields( bool sorted )
39{
40 QStringList list;
41
42 list.append( QObject::tr( "Office" ) );
43 list.append( QObject::tr( "Profession" ) );
44 list.append( QObject::tr( "Assistant" ) );
45 list.append( QObject::tr( "Manager" ) );
46
47 list.append( QObject::tr( "Spouse" ) );
48 list.append( QObject::tr( "Gender" ) );
49 list.append( QObject::tr( "Birthday" ) );
50 list.append( QObject::tr( "Anniversary" ) );
51 list.append( QObject::tr( "Nickname" ) );
52 list.append( QObject::tr( "Children" ) );
30 53
54 if (sorted) list.sort();
31 return list; 55 return list;
32} 56}
33 57
58
34/*! 59/*!
35 \internal 60 \internal
36 Returns a translated list of phone field names for a contact. 61 Returns a translated list of phone field names for a contact.
37*/ 62*/
38QStringList OContactFields::trphonefields( bool sorted ) 63QStringList OContactFields::trphonefields( bool sorted )
39{ 64{
40 QStringList list; 65 QStringList list;
41 list.append( QObject::tr( "Business Phone" ) ); 66 list.append( QObject::tr( "Business Phone" ) );
42 list.append( QObject::tr( "Business Fax" ) ); 67 list.append( QObject::tr( "Business Fax" ) );
43 list.append( QObject::tr( "Business Mobile" ) ); 68 list.append( QObject::tr( "Business Mobile" ) );
44 69
45 list.append( QObject::tr( "Default Email" ) ); 70 list.append( QObject::tr( "Default Email" ) );
46 list.append( QObject::tr( "Emails" ) ); 71 list.append( QObject::tr( "Emails" ) );
47 72
48 list.append( QObject::tr( "Home Phone" ) ); 73 list.append( QObject::tr( "Home Phone" ) );
49 list.append( QObject::tr( "Home Fax" ) ); 74 list.append( QObject::tr( "Home Fax" ) );
50 list.append( QObject::tr( "Home Mobile" ) ); 75 list.append( QObject::tr( "Home Mobile" ) );
51 76
52 if (sorted) list.sort(); 77 if (sorted) list.sort();
53 78
54 return list; 79 return list;
55} 80}
56 81
57 82
58/*! 83/*!
59 \internal 84 \internal
60 Returns a translated list of details field names for a contact. 85 Returns a list of phone field names for a contact.
61*/ 86*/
62QStringList OContactFields::trdetailsfields( bool sorted ) 87QStringList OContactFields::untrphonefields( bool sorted )
63{ 88{
64 QStringList list; 89 QStringList list;
65 90
66 list.append( QObject::tr( "Office" ) ); 91 list.append( "Business Phone" );
67 list.append( QObject::tr( "Profession" ) ); 92 list.append( "Business Fax" );
68 list.append( QObject::tr( "Assistant" ) ); 93 list.append( "Business Mobile" );
69 list.append( QObject::tr( "Manager" ) );
70 94
71 list.append( QObject::tr( "Spouse" ) ); 95 list.append( "Default Email" );
72 list.append( QObject::tr( "Gender" ) ); 96 list.append( "Emails" );
73 list.append( QObject::tr( "Birthday" ) ); 97
74 list.append( QObject::tr( "Anniversary" ) ); 98 list.append( "Home Phone" );
75 list.append( QObject::tr( "Nickname" ) ); 99 list.append( "Home Fax" );
76 list.append( QObject::tr( "Children" ) ); 100 list.append( "Home Mobile" );
77 101
78 if (sorted) list.sort(); 102 if (sorted) list.sort();
103
79 return list; 104 return list;
80} 105}
81 106
82 107
83/*! 108/*!
84 \internal 109 \internal
85 Returns a translated list of field names for a contact. 110 Returns a translated list of field names for a contact.
86*/ 111*/
87QStringList OContactFields::trfields( bool sorted ) 112QStringList OContactFields::trfields( bool sorted )
88{ 113{
89 QStringList list; 114 QStringList list;
90 115
91 list.append( QObject::tr( "Name Title") ); 116 list.append( QObject::tr( "Name Title") );
92 list.append( QObject::tr( "First Name" ) ); 117 list.append( QObject::tr( "First Name" ) );
93 list.append( QObject::tr( "Middle Name" ) ); 118 list.append( QObject::tr( "Middle Name" ) );
94 list.append( QObject::tr( "Last Name" ) ); 119 list.append( QObject::tr( "Last Name" ) );
95 list.append( QObject::tr( "Suffix" ) ); 120 list.append( QObject::tr( "Suffix" ) );
96 list.append( QObject::tr( "File As" ) ); 121 list.append( QObject::tr( "File As" ) );
97 122
98 list.append( QObject::tr( "Job Title" ) ); 123 list.append( QObject::tr( "Job Title" ) );
99 list.append( QObject::tr( "Department" ) ); 124 list.append( QObject::tr( "Department" ) );
100 list.append( QObject::tr( "Company" ) ); 125 list.append( QObject::tr( "Company" ) );
101 126
102 list += trphonefields( sorted ); 127 list += trphonefields( sorted );
@@ -107,117 +132,83 @@ QStringList OContactFields::trfields( bool sorted )
107 list.append( QObject::tr( "Business Zip" ) ); 132 list.append( QObject::tr( "Business Zip" ) );
108 list.append( QObject::tr( "Business Country" ) ); 133 list.append( QObject::tr( "Business Country" ) );
109 list.append( QObject::tr( "Business Pager" ) ); 134 list.append( QObject::tr( "Business Pager" ) );
110 list.append( QObject::tr( "Business WebPage" ) ); 135 list.append( QObject::tr( "Business WebPage" ) );
111 136
112 list.append( QObject::tr( "Home Street" ) ); 137 list.append( QObject::tr( "Home Street" ) );
113 list.append( QObject::tr( "Home City" ) ); 138 list.append( QObject::tr( "Home City" ) );
114 list.append( QObject::tr( "Home State" ) ); 139 list.append( QObject::tr( "Home State" ) );
115 list.append( QObject::tr( "Home Zip" ) ); 140 list.append( QObject::tr( "Home Zip" ) );
116 list.append( QObject::tr( "Home Country" ) ); 141 list.append( QObject::tr( "Home Country" ) );
117 list.append( QObject::tr( "Home Web Page" ) ); 142 list.append( QObject::tr( "Home Web Page" ) );
118 143
119 list += trdetailsfields( sorted ); 144 list += trdetailsfields( sorted );
120 145
121 list.append( QObject::tr( "Notes" ) ); 146 list.append( QObject::tr( "Notes" ) );
122 list.append( QObject::tr( "Groups" ) ); 147 list.append( QObject::tr( "Groups" ) );
123 148
124 if (sorted) list.sort(); 149 if (sorted) list.sort();
125 150
126 return list; 151 return list;
127} 152}
128 153
129/*! 154/*!
130 \internal 155 \internal
131 Returns a list of phone field names for a contact.
132*/
133QStringList OContactFields::untrphonefields( bool sorted )
134{
135 QStringList list;
136
137 list.append( "Business Phone" );
138 list.append( "Business Fax" );
139 list.append( "Business Mobile" );
140
141 list.append( "Default Email" );
142 list.append( "Emails" );
143
144 list.append( "Home Phone" );
145 list.append( "Home Fax" );
146 list.append( "Home Mobile" );
147
148 if (sorted) list.sort();
149
150 return list;
151}
152
153/*!
154 \internal
155 Returns an untranslated list of field names for a contact. 156 Returns an untranslated list of field names for a contact.
156*/ 157*/
157QStringList OContactFields::untrfields( bool sorted ) 158QStringList OContactFields::untrfields( bool sorted )
158{ 159{
159 QStringList list; 160 QStringList list;
160 161
161 list.append( "Name Title" ); 162 list.append( "Name Title" );
162 list.append( "First Name" ); 163 list.append( "First Name" );
163 list.append( "Middle Name" ); 164 list.append( "Middle Name" );
164 list.append( "Last Name" ); 165 list.append( "Last Name" );
165 list.append( "Suffix" ); 166 list.append( "Suffix" );
166 list.append( "File As" ); 167 list.append( "File As" );
167 168
168 list.append( "Job Title" ); 169 list.append( "Job Title" );
169 list.append( "Department" ); 170 list.append( "Department" );
170 list.append( "Company" ); 171 list.append( "Company" );
171 172
172 list += untrphonefields( sorted ); 173 list += untrphonefields( sorted );
173 174
174 list.append( "Business Street" ); 175 list.append( "Business Street" );
175 list.append( "Business City" ); 176 list.append( "Business City" );
176 list.append( "Business State" ); 177 list.append( "Business State" );
177 list.append( "Business Zip" ); 178 list.append( "Business Zip" );
178 list.append( "Business Country" ); 179 list.append( "Business Country" );
179 list.append( "Business Pager" ); 180 list.append( "Business Pager" );
180 list.append( "Business WebPage" ); 181 list.append( "Business WebPage" );
181 182
182 list.append( "Office" );
183 list.append( "Profession" );
184 list.append( "Assistant" );
185 list.append( "Manager" );
186
187 list.append( "Home Street" ); 183 list.append( "Home Street" );
188 list.append( "Home City" ); 184 list.append( "Home City" );
189 list.append( "Home State" ); 185 list.append( "Home State" );
190 list.append( "Home Zip" ); 186 list.append( "Home Zip" );
191 list.append( "Home Country" ); 187 list.append( "Home Country" );
192 list.append( "Home Web Page" ); 188 list.append( "Home Web Page" );
193 189
194 list.append( "Spouse" ); 190 list += untrdetailsfields( sorted );
195 list.append( "Gender" );
196 list.append( "Birthday" );
197 list.append( "Anniversary" );
198 list.append( "Nickname" );
199 list.append( "Children" );
200 191
201 list.append( "Notes" ); 192 list.append( "Notes" );
202 list.append( "Groups" ); 193 list.append( "Groups" );
203 194
204 if (sorted) list.sort(); 195 if (sorted) list.sort();
205 196
206 return list; 197 return list;
207} 198}
208QMap<int, QString> OContactFields::idToTrFields() 199QMap<int, QString> OContactFields::idToTrFields()
209{ 200{
210 QMap<int, QString> ret_map; 201 QMap<int, QString> ret_map;
211 202
212 ret_map.insert( Qtopia::Title, QObject::tr( "Name Title") ); 203 ret_map.insert( Qtopia::Title, QObject::tr( "Name Title") );
213 ret_map.insert( Qtopia::FirstName, QObject::tr( "First Name" ) ); 204 ret_map.insert( Qtopia::FirstName, QObject::tr( "First Name" ) );
214 ret_map.insert( Qtopia::MiddleName, QObject::tr( "Middle Name" ) ); 205 ret_map.insert( Qtopia::MiddleName, QObject::tr( "Middle Name" ) );
215 ret_map.insert( Qtopia::LastName, QObject::tr( "Last Name" ) ); 206 ret_map.insert( Qtopia::LastName, QObject::tr( "Last Name" ) );
216 ret_map.insert( Qtopia::Suffix, QObject::tr( "Suffix" )); 207 ret_map.insert( Qtopia::Suffix, QObject::tr( "Suffix" ));
217 ret_map.insert( Qtopia::FileAs, QObject::tr( "File As" ) ); 208 ret_map.insert( Qtopia::FileAs, QObject::tr( "File As" ) );
218 209
219 ret_map.insert( Qtopia::JobTitle, QObject::tr( "Job Title" ) ); 210 ret_map.insert( Qtopia::JobTitle, QObject::tr( "Job Title" ) );
220 ret_map.insert( Qtopia::Department, QObject::tr( "Department" ) ); 211 ret_map.insert( Qtopia::Department, QObject::tr( "Department" ) );
221 ret_map.insert( Qtopia::Company, QObject::tr( "Company" ) ); 212 ret_map.insert( Qtopia::Company, QObject::tr( "Company" ) );
222 ret_map.insert( Qtopia::BusinessPhone, QObject::tr( "Business Phone" ) ); 213 ret_map.insert( Qtopia::BusinessPhone, QObject::tr( "Business Phone" ) );
223 ret_map.insert( Qtopia::BusinessFax, QObject::tr( "Business Fax" ) ); 214 ret_map.insert( Qtopia::BusinessFax, QObject::tr( "Business Fax" ) );