summaryrefslogtreecommitdiff
path: root/library/backend
authorkergoth <kergoth>2002-06-07 18:53:14 (UTC)
committer kergoth <kergoth>2002-06-07 18:53:14 (UTC)
commit640d964cfdc7467f6cacb513087cd3acda2c04f0 (patch) (unidiff)
tree9a784686c1795f8b1f81eb344598f3b549d43467 /library/backend
parentdfb9c76738bb68e235114c5ad43dbd26a59b98ab (diff)
downloadopie-640d964cfdc7467f6cacb513087cd3acda2c04f0.zip
opie-640d964cfdc7467f6cacb513087cd3acda2c04f0.tar.gz
opie-640d964cfdc7467f6cacb513087cd3acda2c04f0.tar.bz2
Backing out unintentional merge from TT branch.
Diffstat (limited to 'library/backend') (more/less context) (show whitespace changes)
-rw-r--r--library/backend/categories.cpp142
-rw-r--r--library/backend/categories.h12
-rw-r--r--library/backend/contact.cpp79
-rw-r--r--library/backend/contact.h7
-rw-r--r--library/backend/event.h5
-rw-r--r--library/backend/recordfields.h44
-rw-r--r--library/backend/task.h4
-rw-r--r--library/backend/vobject.cpp9
-rw-r--r--library/backend/vobject_p.h3
9 files changed, 165 insertions, 140 deletions
diff --git a/library/backend/categories.cpp b/library/backend/categories.cpp
index 91331db..6e011c4 100644
--- a/library/backend/categories.cpp
+++ b/library/backend/categories.cpp
@@ -162,54 +162,24 @@ QStringList CategoryGroup::labels() const
162QStringList CategoryGroup::labels(const QArray<int> &catids ) const 162QStringList CategoryGroup::labels(const QArray<int> &catids ) const
163{ 163{
164 QStringList labels; 164 QStringList labels;
165 if ( catids.count() == 0 ) 165 if ( catids.count() == 0 )
166 return labels; 166 return labels;
167 for ( QMap<int, QString>::ConstIterator it = mIdLabelMap.begin(); 167 for ( QMap<int, QString>::ConstIterator it = mIdLabelMap.begin();
168 it != mIdLabelMap.end(); ++it ) 168 it != mIdLabelMap.end(); ++it )
169 if ( catids.find( it.key() ) != -1 ) 169 if ( catids.find( it.key() ) != -1 )
170 labels += *it; 170 labels += *it;
171 return labels; 171 return labels;
172} 172}
173 173
174QArray<int> CategoryGroup::ids( const QStringList &cats ) const
175{
176 QArray<int> results;
177
178 for ( QStringList::ConstIterator catIt = cats.begin();
179 catIt != cats.end(); ++catIt ) {
180 if ( *catIt == QObject::tr("All") || *catIt == QObject::tr("Unfiled") )
181 continue;
182 int value = id( *catIt );
183 if ( value != 0 ) {
184 int tmp = results.size();
185 results.resize( tmp + 1 );
186 results[ tmp ] = value;
187 }
188 }
189
190 return results;
191}
192
193QArray<int> CategoryGroup::ids() const
194{
195 QArray<int> results( mIdLabelMap.count() );
196 int i = 0;
197 for ( QMap<int, QString>::ConstIterator it = mIdLabelMap.begin();
198 it != mIdLabelMap.end(); ++it )
199 results[i++] = it.key();
200
201 return results;
202}
203
204/*********************************************************** 174/***********************************************************
205 * 175 *
206 * Categories 176 * Categories
207 * 177 *
208 **********************************************************/ 178 **********************************************************/
209 179
210/** Add the category name as long as it doesn't already exist locally 180/** Add the category name as long as it doesn't already exist locally
211 * or globally. Return TRUE if added, FALSE if conflicts. 181 * or globally. Return TRUE if added, FALSE if conflicts.
212 */ 182 */
213int Categories::addCategory( const QString &appname, 183int Categories::addCategory( const QString &appname,
214 const QString &catname, 184 const QString &catname,
215 int uid ) 185 int uid )
@@ -334,67 +304,60 @@ bool Categories::removeGlobalCategory( int uid )
334 304
335/** Returns the sorted list of all categories that are associated with 305/** Returns the sorted list of all categories that are associated with
336 * the app. If includeGlobal parameter is TRUE then the returned 306 * the app. If includeGlobal parameter is TRUE then the returned
337 * categories will include the global category items. 307 * categories will include the global category items.
338 */ 308 */
339QStringList Categories::labels( const QString &app, 309QStringList Categories::labels( const QString &app,
340 bool includeGlobal, 310 bool includeGlobal,
341 ExtraLabels extra ) const 311 ExtraLabels extra ) const
342{ 312{
343 QMap< QString, CategoryGroup >::ConstIterator 313 QMap< QString, CategoryGroup >::ConstIterator
344 appIt = mAppCats.find( app ); 314 appIt = mAppCats.find( app );
345 QStringList cats; 315 QStringList cats;
316
317 if ( appIt != mAppCats.end() )
318 cats += (*appIt).labels();
319 else qDebug("Categories::labels didn't find app %s", app.latin1() );
320 if ( includeGlobal )
321 cats += mGlobalCats.labels();
322
323 cats.sort();
346 switch ( extra ) { 324 switch ( extra ) {
347 case NoExtra: break; 325 case NoExtra: break;
348 case AllUnfiled: 326 case AllUnfiled:
349 cats.append( tr("All") ); 327 cats.append( tr("All") );
350 cats.append( tr("Unfiled") ); 328 cats.append( tr("Unfiled") );
351 break; 329 break;
352 case AllLabel: 330 case AllLabel:
353 cats.append( tr("All") ); 331 cats.append( tr("All") );
354 break; 332 break;
355 case UnfiledLabel: 333 case UnfiledLabel:
356 cats.append( tr("Unfiled") ); 334 cats.append( tr("Unfiled") );
357 break; 335 break;
358 } 336 }
359 if ( appIt != mAppCats.end() ) 337
360 cats += (*appIt).labels();
361 else qDebug("Categories::labels didn't find app %s", app.latin1() );
362 if ( includeGlobal )
363 cats += mGlobalCats.labels();
364 // I don't think a sorted list is useful, the user might find prefer
365 // it in the original order.
366// cats.sort();
367 return cats; 338 return cats;
368} 339}
369 340
370QString Categories::label( const QString &app, int id ) const 341QString Categories::label( const QString &app, int id ) const
371{ 342{
372 if ( mGlobalCats.contains( id ) ) 343 if ( mGlobalCats.contains( id ) )
373 return mGlobalCats.label( id ); 344 return mGlobalCats.label( id );
374 QMap< QString, CategoryGroup >::ConstIterator 345 QMap< QString, CategoryGroup >::ConstIterator
375 appIt = mAppCats.find( app ); 346 appIt = mAppCats.find( app );
376 if ( appIt == mAppCats.end() ) 347 if ( appIt == mAppCats.end() )
377 return QString::null; 348 return QString::null;
378 return (*appIt).label( id ); 349 return (*appIt).label( id );
379} 350}
380 351
381QStringList Categories::labels( const QString & app,
382 const QArray<int> &catids ) const
383{
384 QStringList strs = mGlobalCats.labels( catids );
385 strs += mAppCats[app].labels( catids );
386 return strs;
387}
388
389/** Returns a single string associated with the cat ids for display in 352/** Returns a single string associated with the cat ids for display in
390 * a combobox or any area that requires one string. If catids are empty 353 * a combobox or any area that requires one string. If catids are empty
391 * then "Unfiled" will be returned. If multiple categories are assigned 354 * then "Unfiled" will be returned. If multiple categories are assigned
392 * the first cat id is shown with " (multi)" appended to the string. 355 * the first cat id is shown with " (multi)" appended to the string.
393 */ 356 */
394QString Categories::displaySingle( const QString &app, 357QString Categories::displaySingle( const QString &app,
395 const QArray<int> &catids, 358 const QArray<int> &catids,
396 DisplaySingle display ) const 359 DisplaySingle display ) const
397{ 360{
398 QStringList strs = labels( app, catids ); 361 QStringList strs = labels( app, catids );
399 if ( !strs.count() ) 362 if ( !strs.count() )
400 return tr("Unfiled"); 363 return tr("Unfiled");
@@ -408,51 +371,39 @@ QString Categories::displaySingle( const QString &app,
408 case ShowMulti: 371 case ShowMulti:
409 r = strs.first() + tr(" (multi.)"); 372 r = strs.first() + tr(" (multi.)");
410 break; 373 break;
411 case ShowAll: 374 case ShowAll:
412 r = strs.join(" "); 375 r = strs.join(" ");
413 break; 376 break;
414 } 377 }
415 } 378 }
416 else r = strs.first(); 379 else r = strs.first();
417 return r; 380 return r;
418} 381}
419 382
420QArray<int> Categories::ids( const QString &app ) const 383QArray<int> Categories::ids( const QString &app, const QStringList &labels) const
421{ 384{
422 QArray<int> allIds = mGlobalCats.ids(); 385 QArray<int> results;
423 QArray<int> appIds = mAppCats[app].ids(); 386 QStringList::ConstIterator it;
424 387 int i;
425 // we should make the guarentee that the ids are in the
426 // same order as the labels, (i.e. app cats then global)
427 // otherwise there is no point in having these two separate functions.
428 uint appSize = appIds.size();
429 appIds.resize( appSize + allIds.size() );
430 for ( uint i = appSize; i < appIds.size(); ++i )
431 appIds[int(i)] = allIds[int(i - appSize)];
432 388
433 return appIds; 389 for ( i=0, it=labels.begin(); it!=labels.end(); i++, ++it ) {
390 int value = id( app, *it );
391 if ( value != 0 ) {
392 int tmp = results.size();
393 results.resize( tmp + 1 );
394 results[ tmp ] = value;
434} 395}
435 396 }
436QArray<int> Categories::ids( const QString &app, const QStringList &cats ) const 397 return results;
437{
438 QArray<int> allIds = mGlobalCats.ids( cats );
439 QArray<int> appIds = mAppCats[app].ids( cats );
440
441 uint appSize = appIds.size();
442 appIds.resize( appSize + allIds.size() );
443 for ( uint i = appSize; i < appIds.size(); ++i )
444 appIds[int(i)] = allIds[int(i - appSize)];
445
446 return appIds;
447} 398}
448 399
449int Categories::id( const QString &app, const QString &cat ) const 400int Categories::id( const QString &app, const QString &cat ) const
450{ 401{
451 if ( cat == tr("Unfiled") || cat.contains( tr(" (multi.)") ) ) 402 if ( cat == tr("Unfiled") || cat.contains( tr(" (multi.)") ) )
452 return 0; 403 return 0;
453 int uid = mGlobalCats.id( cat ); 404 int uid = mGlobalCats.id( cat );
454 if ( uid != 0 ) 405 if ( uid != 0 )
455 return uid; 406 return uid;
456 return mAppCats[app].id( cat ); 407 return mAppCats[app].id( cat );
457} 408}
458 409
@@ -530,63 +481,88 @@ bool Categories::exists( const QString &catname ) const
530bool Categories::exists( const QString &appname, 481bool Categories::exists( const QString &appname,
531 const QString &catname) const 482 const QString &catname) const
532{ 483{
533 QMap< QString, CategoryGroup >::ConstIterator 484 QMap< QString, CategoryGroup >::ConstIterator
534 appIt = mAppCats.find( appname ); 485 appIt = mAppCats.find( appname );
535 486
536 if ( appIt == mAppCats.end() ) 487 if ( appIt == mAppCats.end() )
537 return FALSE; 488 return FALSE;
538 489
539 return (*appIt).contains( catname ); 490 return (*appIt).contains( catname );
540} 491}
541 492
493
542bool Categories::save( const QString &fname ) const 494bool Categories::save( const QString &fname ) const
543{ 495{
544 QFile file( fname ); 496 QString strNewFile = fname + ".new";
545 if ( !file.open( IO_WriteOnly ) ) { 497 QFile f( strNewFile );
498 QString out;
499 int total_written;
500
501 if ( !f.open( IO_WriteOnly|IO_Raw ) ) {
546 qWarning("Unable to write to %s", fname.latin1()); 502 qWarning("Unable to write to %s", fname.latin1());
547 return FALSE; 503 return FALSE;
548 } 504 }
549 505
550 QTextStream ts( &file ); 506 out = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
551 ts << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; 507 out += "<!DOCTYPE CategoryList>\n";
552 ts << "<!DOCTYPE CategoryList>" << endl; 508
509 out += "<Categories>\n";
553 510
554 ts << "<Categories>" << endl;
555 for ( QMap<int, QString>::ConstIterator git = mGlobalCats.idMap().begin(); 511 for ( QMap<int, QString>::ConstIterator git = mGlobalCats.idMap().begin();
556 git != mGlobalCats.idMap().end(); ++git ) 512 git != mGlobalCats.idMap().end(); ++git )
557 ts << "<Category id=\"" << git.key() << "\"" 513 out += "<Category id=\"" + QString::number(git.key()) + "\"" +
558 << " name=\"" << escapeString(*git) << "\" />" << endl; 514 " name=\"" + escapeString(*git) + "\" />\n";
559 515
560 for ( QMap<QString, CategoryGroup>::ConstIterator appsIt=mAppCats.begin(); 516 for ( QMap<QString, CategoryGroup>::ConstIterator appsIt=mAppCats.begin();
561 appsIt != mAppCats.end(); ++appsIt ) { 517 appsIt != mAppCats.end(); ++appsIt ) {
562 const QString &app = appsIt.key(); 518 const QString &app = appsIt.key();
563 const QMap<int, QString> &appcats = (*appsIt).idMap(); 519 const QMap<int, QString> &appcats = (*appsIt).idMap();
564 for ( QMap<int, QString>::ConstIterator appcatit = appcats.begin(); 520 for ( QMap<int, QString>::ConstIterator appcatit = appcats.begin();
565 appcatit != appcats.end(); ++appcatit ) 521 appcatit != appcats.end(); ++appcatit )
566 ts << "<Category id=\"" << appcatit.key() << "\"" 522 out += "<Category id=\"" + QString::number(appcatit.key()) + "\"" +
567 << " app=\"" << escapeString(app) << "\"" 523 " app=\"" + escapeString(app) + "\"" +
568 << " name=\"" << escapeString(*appcatit) << "\" />" << endl; 524 " name=\"" + escapeString(*appcatit) + "\" />\n";
525 }
526 out += "</Categories>\n";
527
528 QCString cstr = out.utf8();
529 total_written = f.writeBlock( cstr.data(), cstr.length() );
530 if ( total_written != int(cstr.length()) ) {
531 f.close();
532 QFile::remove( strNewFile );
533 return FALSE;
534 }
535 f.close();
536
537 if ( ::rename( strNewFile.latin1(), fname.latin1() ) < 0 ) {
538 qWarning( "problem renaming file %s to %s",
539 strNewFile.latin1(), fname.latin1());
540 // remove the tmp file...
541 QFile::remove( strNewFile );
569 } 542 }
570 ts << "</Categories>" << endl;
571 543
572 file.close();
573 return TRUE; 544 return TRUE;
574} 545}
575 546
576bool Categories::load( const QString &fname ) 547bool Categories::load( const QString &fname )
577{ 548{
578 QFile file( fname ); 549 QFile file( fname );
579 if ( !file.open( IO_ReadOnly ) ) { 550 if ( !file.open( IO_ReadOnly ) ) {
580 qWarning("Unable to open %s", fname.latin1()); 551 qWarning("Unable to open %s", fname.latin1());
552
553 addGlobalCategory(tr("Business"));
554 addGlobalCategory(tr("Personal"));
555 save(fname);
556
581 return FALSE; 557 return FALSE;
582 } 558 }
583 559
584 clear(); 560 clear();
585 QByteArray ba = file.readAll(); 561 QByteArray ba = file.readAll();
586 QString data = QString::fromUtf8( ba.data(), ba.size() ); 562 QString data = QString::fromUtf8( ba.data(), ba.size() );
587 QChar *uc = (QChar *)data.unicode(); 563 QChar *uc = (QChar *)data.unicode();
588 int len = data.length(); 564 int len = data.length();
589 565
590 // QTime t; 566 // QTime t;
591 // t.start(); 567 // t.start();
592 QString name; 568 QString name;
diff --git a/library/backend/categories.h b/library/backend/categories.h
index 82d765b..ba65ee3 100644
--- a/library/backend/categories.h
+++ b/library/backend/categories.h
@@ -62,26 +62,25 @@ public:
62 bool contains(int id) const; 62 bool contains(int id) const;
63 bool contains(const QString &label) const; 63 bool contains(const QString &label) const;
64 64
65 /** Returns label associated with the uid or QString::null if 65 /** Returns label associated with the uid or QString::null if
66 * not found 66 * not found
67 */ 67 */
68 const QString &label(int id) const; 68 const QString &label(int id) const;
69 /** Returns the uid associated with label or 0 if not found */ 69 /** Returns the uid associated with label or 0 if not found */
70 int id(const QString &label) const; 70 int id(const QString &label) const;
71 71
72 /** Returns a sorted list of labels */ 72 /** Returns a sorted list of labels */
73 QStringList labels() const; 73 QStringList labels() const;
74 QArray<int> ids( const QStringList &cats ) const; 74
75 QArray<int> ids() const;
76 QStringList labels( const QArray<int> &catids ) const; 75 QStringList labels( const QArray<int> &catids ) const;
77 76
78 const QMap<int, QString> &idMap() const { return mIdLabelMap; } 77 const QMap<int, QString> &idMap() const { return mIdLabelMap; }
79 78
80private: 79private:
81 void insert( int uid, const QString &label ); 80 void insert( int uid, const QString &label );
82 QMap<int, QString> mIdLabelMap; 81 QMap<int, QString> mIdLabelMap;
83 QMap<QString, int> mLabelIdMap; 82 QMap<QString, int> mLabelIdMap;
84 83
85 static Qtopia::UidGen &uidGen() { return sUidGen; } 84 static Qtopia::UidGen &uidGen() { return sUidGen; }
86 static Qtopia::UidGen sUidGen; 85 static Qtopia::UidGen sUidGen;
87}; 86};
@@ -121,51 +120,46 @@ public:
121 * already exist globally. Return UID if added, 0 if conflicts. 120 * already exist globally. Return UID if added, 0 if conflicts.
122 */ 121 */
123 int addGlobalCategory( const QString &catname, int uid ); 122 int addGlobalCategory( const QString &catname, int uid );
124 /** Removes the category from the application; if it is not found 123 /** Removes the category from the application; if it is not found
125 * in the application, then it removes it from the global list 124 * in the application, then it removes it from the global list
126 */ 125 */
127 bool removeCategory( const QString &appName, const QString &catName, 126 bool removeCategory( const QString &appName, const QString &catName,
128 bool checkGlobal = TRUE); 127 bool checkGlobal = TRUE);
129 bool removeCategory( const QString &appName, int uid ); 128 bool removeCategory( const QString &appName, int uid );
130 bool removeGlobalCategory( const QString &catName ); 129 bool removeGlobalCategory( const QString &catName );
131 bool removeGlobalCategory( int uid ); 130 bool removeGlobalCategory( int uid );
132 131
133 QArray<int> ids( const QString &app ) const; 132 QArray<int> ids( const QString &app, const QStringList &labels) const;
134 QArray<int> ids( const QString &app, 133
135 const QStringList &cats ) const;
136 /** Returns the id associated with the app */ 134 /** Returns the id associated with the app */
137 int id( const QString &app, const QString &cat ) const; 135 int id( const QString &app, const QString &cat ) const;
138 /** Returns the label associated with the id */ 136 /** Returns the label associated with the id */
139 QString label( const QString &app, int id ) const; 137 QString label( const QString &app, int id ) const;
140 138
141 enum ExtraLabels { NoExtra, AllUnfiled, AllLabel, UnfiledLabel }; 139 enum ExtraLabels { NoExtra, AllUnfiled, AllLabel, UnfiledLabel };
142 /** Returns the sorted list of all categories that are 140 /** Returns the sorted list of all categories that are
143 * associated with the app. 141 * associated with the app.
144 * If includeGlobal parameter is TRUE then the returned 142 * If includeGlobal parameter is TRUE then the returned
145 * categories will include the global category items. 143 * categories will include the global category items.
146 * If extra = NoExtra, then 144 * If extra = NoExtra, then
147 * If extra = AllUnfiled, then All and Unfiled will be prepended to 145 * If extra = AllUnfiled, then All and Unfiled will be prepended to
148 * the list 146 * the list
149 * If extra = AllLabel, then All is prepended 147 * If extra = AllLabel, then All is prepended
150 * If extra = UnfiledLabel, then Unfiled is prepended 148 * If extra = UnfiledLabel, then Unfiled is prepended
151 */ 149 */
152 QStringList labels( const QString &app, 150 QStringList labels( const QString &app,
153 bool includeGlobal = TRUE, 151 bool includeGlobal = TRUE,
154 ExtraLabels extra = NoExtra ) const; 152 ExtraLabels extra = NoExtra ) const;
155 153
156 /** Returns the labels of the categories associated with the uids */
157 QStringList labels( const QString & app,
158 const QArray<int> &catids ) const;
159
160 enum DisplaySingle { ShowMulti, ShowAll, ShowFirst }; 154 enum DisplaySingle { ShowMulti, ShowAll, ShowFirst };
161 155
162 /** Returns a single string associated with the cat ids for display in 156 /** Returns a single string associated with the cat ids for display in
163 * a combobox or any area that requires one string. If catids are empty 157 * a combobox or any area that requires one string. If catids are empty
164 * then "Unfiled" will be returned. If multiple categories are assigned 158 * then "Unfiled" will be returned. If multiple categories are assigned
165 * then the behavior depends on the DisplaySingle type. 159 * then the behavior depends on the DisplaySingle type.
166 * If /a display is set to ShowMulti then " (multi)" appended to the 160 * If /a display is set to ShowMulti then " (multi)" appended to the
167 * first string. If /a display is set to ShowAll, then a space seperated 161 * first string. If /a display is set to ShowAll, then a space seperated
168 * string is returned with all categories. If ShowFirst is returned, 162 * string is returned with all categories. If ShowFirst is returned,
169 * the just the first string is returned. 163 * the just the first string is returned.
170 */ 164 */
171 QString displaySingle( const QString &app, 165 QString displaySingle( const QString &app,
diff --git a/library/backend/contact.cpp b/library/backend/contact.cpp
index a5f10ab..b10b19a 100644
--- a/library/backend/contact.cpp
+++ b/library/backend/contact.cpp
@@ -9,24 +9,26 @@
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#define QTOPIA_INTERNAL_CONTACT_MRE
22
21#include "contact.h" 23#include "contact.h"
22#include "vobject_p.h" 24#include "vobject_p.h"
23#include "qfiledirect_p.h" 25#include "qfiledirect_p.h"
24 26
25#include <qpe/stringutil.h> 27#include <qpe/stringutil.h>
26#include <qpe/timeconversion.h> 28#include <qpe/timeconversion.h>
27 29
28#include <qobject.h> 30#include <qobject.h>
29#include <qregexp.h> 31#include <qregexp.h>
30#include <qstylesheet.h> 32#include <qstylesheet.h>
31#include <qfileinfo.h> 33#include <qfileinfo.h>
32 34
@@ -377,117 +379,125 @@ void Contact::save( QString &buf ) const
377 379
378QStringList Contact::fields() 380QStringList Contact::fields()
379{ 381{
380 QStringList list; 382 QStringList list;
381 383
382 list.append( "Title" ); // Not Used! 384 list.append( "Title" ); // Not Used!
383 list.append( "FirstName" ); 385 list.append( "FirstName" );
384 list.append( "MiddleName" ); 386 list.append( "MiddleName" );
385 list.append( "LastName" ); 387 list.append( "LastName" );
386 list.append( "Suffix" ); 388 list.append( "Suffix" );
387 list.append( "FileAs" ); 389 list.append( "FileAs" );
388 390
391 list.append( "JobTitle" );
392 list.append( "Department" );
393 list.append( "Company" );
394 list.append( "BusinessPhone" );
395 list.append( "BusinessFax" );
396 list.append( "BusinessMobile" );
397
389 list.append( "DefaultEmail" ); 398 list.append( "DefaultEmail" );
390 list.append( "Emails" ); 399 list.append( "Emails" );
391 400
392 list.append( "HomeStreet" );
393 list.append( "HomeCity" );
394 list.append( "HomeState" );
395 list.append( "HomeZip" );
396 list.append( "HomeCountry" );
397 list.append( "HomePhone" ); 401 list.append( "HomePhone" );
398 list.append( "HomeFax" ); 402 list.append( "HomeFax" );
399 list.append( "HomeMobile" ); 403 list.append( "HomeMobile" );
400 list.append( "HomeWebPage" );
401 404
402 list.append( "Company" );
403 list.append( "BusinessStreet" ); 405 list.append( "BusinessStreet" );
404 list.append( "BusinessCity" ); 406 list.append( "BusinessCity" );
405 list.append( "BusinessState" ); 407 list.append( "BusinessState" );
406 list.append( "BusinessZip" ); 408 list.append( "BusinessZip" );
407 list.append( "BusinessCountry" ); 409 list.append( "BusinessCountry" );
410 list.append( "BusinessPager" );
408 list.append( "BusinessWebPage" ); 411 list.append( "BusinessWebPage" );
409 list.append( "JobTitle" ); 412
410 list.append( "Department" );
411 list.append( "Office" ); 413 list.append( "Office" );
412 list.append( "BusinessPhone" );
413 list.append( "BusinessFax" );
414 list.append( "BusinessMobile" );
415 list.append( "BusinessPager" );
416 list.append( "Profession" ); 414 list.append( "Profession" );
417 list.append( "Assistant" ); 415 list.append( "Assistant" );
418 list.append( "Manager" ); 416 list.append( "Manager" );
419 417
418 list.append( "HomeStreet" );
419 list.append( "HomeCity" );
420 list.append( "HomeState" );
421 list.append( "HomeZip" );
422 list.append( "HomeCountry" );
423 list.append( "HomeWebPage" );
424
420 list.append( "Spouse" ); 425 list.append( "Spouse" );
421 list.append( "Gender" ); 426 list.append( "Gender" );
422 list.append( "Birthday" ); 427 list.append( "Birthday" );
423 list.append( "Anniversary" ); 428 list.append( "Anniversary" );
424 list.append( "Nickname" ); 429 list.append( "Nickname" );
425
426 list.append( "Children" ); 430 list.append( "Children" );
431
427 list.append( "Notes" ); 432 list.append( "Notes" );
433 list.append( "Groups" );
428 434
429 return list; 435 return list;
430} 436}
431 437
432QStringList Contact::trfields() 438QStringList Contact::trfields()
433{ 439{
434 QStringList list; 440 QStringList list;
435 441
436 list.append( QObject::tr( "Name Title") ); 442 list.append( QObject::tr( "Name Title") );
437 list.append( QObject::tr( "First Name" ) ); 443 list.append( QObject::tr( "First Name" ) );
438 list.append( QObject::tr( "Middle Name" ) ); 444 list.append( QObject::tr( "Middle Name" ) );
439 list.append( QObject::tr( "Last Name" ) ); 445 list.append( QObject::tr( "Last Name" ) );
440 list.append( QObject::tr( "Suffix" ) ); 446 list.append( QObject::tr( "Suffix" ) );
441 list.append( QObject::tr( "File As" ) ); 447 list.append( QObject::tr( "File As" ) );
442 448
449 list.append( QObject::tr( "Job Title" ) );
450 list.append( QObject::tr( "Department" ) );
451 list.append( QObject::tr( "Company" ) );
452 list.append( QObject::tr( "Business Phone" ) );
453 list.append( QObject::tr( "Business Fax" ) );
454 list.append( QObject::tr( "Business Mobile" ) );
455
443 list.append( QObject::tr( "Default Email" ) ); 456 list.append( QObject::tr( "Default Email" ) );
444 list.append( QObject::tr( "Emails" ) ); 457 list.append( QObject::tr( "Emails" ) );
445 458
446 list.append( QObject::tr( "Home Street" ) );
447 list.append( QObject::tr( "Home City" ) );
448 list.append( QObject::tr( "Home State" ) );
449 list.append( QObject::tr( "Home Zip" ) );
450 list.append( QObject::tr( "Home Country" ) );
451 list.append( QObject::tr( "Home Phone" ) ); 459 list.append( QObject::tr( "Home Phone" ) );
452 list.append( QObject::tr( "Home Fax" ) ); 460 list.append( QObject::tr( "Home Fax" ) );
453 list.append( QObject::tr( "Home Mobile" ) ); 461 list.append( QObject::tr( "Home Mobile" ) );
454 list.append( QObject::tr( "Home Web Page" ) );
455 462
456 list.append( QObject::tr( "Company" ) );
457 list.append( QObject::tr( "Business Street" ) ); 463 list.append( QObject::tr( "Business Street" ) );
458 list.append( QObject::tr( "Business City" ) ); 464 list.append( QObject::tr( "Business City" ) );
459 list.append( QObject::tr( "Business State" ) ); 465 list.append( QObject::tr( "Business State" ) );
460 list.append( QObject::tr( "Business Zip" ) ); 466 list.append( QObject::tr( "Business Zip" ) );
461 list.append( QObject::tr( "Business Country" ) ); 467 list.append( QObject::tr( "Business Country" ) );
468 list.append( QObject::tr( "Business Pager" ) );
462 list.append( QObject::tr( "Business WebPage" ) ); 469 list.append( QObject::tr( "Business WebPage" ) );
463 list.append( QObject::tr( "Job Title" ) ); 470
464 list.append( QObject::tr( "Department" ) );
465 list.append( QObject::tr( "Office" ) ); 471 list.append( QObject::tr( "Office" ) );
466 list.append( QObject::tr( "Business Phone" ) );
467 list.append( QObject::tr( "Business Fax" ) );
468 list.append( QObject::tr( "Business Mobile" ) );
469 list.append( QObject::tr( "Business Pager" ) );
470 list.append( QObject::tr( "Profession" ) ); 472 list.append( QObject::tr( "Profession" ) );
471 list.append( QObject::tr( "Assistant" ) ); 473 list.append( QObject::tr( "Assistant" ) );
472 list.append( QObject::tr( "Manager" ) ); 474 list.append( QObject::tr( "Manager" ) );
473 475
476 list.append( QObject::tr( "Home Street" ) );
477 list.append( QObject::tr( "Home City" ) );
478 list.append( QObject::tr( "Home State" ) );
479 list.append( QObject::tr( "Home Zip" ) );
480 list.append( QObject::tr( "Home Country" ) );
481 list.append( QObject::tr( "Home Web Page" ) );
482
474 list.append( QObject::tr( "Spouse" ) ); 483 list.append( QObject::tr( "Spouse" ) );
475 list.append( QObject::tr( "Gender" ) ); 484 list.append( QObject::tr( "Gender" ) );
476 list.append( QObject::tr( "Birthday" ) ); 485 list.append( QObject::tr( "Birthday" ) );
477 list.append( QObject::tr( "Anniversary" ) ); 486 list.append( QObject::tr( "Anniversary" ) );
478 list.append( QObject::tr( "Nickname" ) ); 487 list.append( QObject::tr( "Nickname" ) );
479
480 list.append( QObject::tr( "Children" ) ); 488 list.append( QObject::tr( "Children" ) );
489
481 list.append( QObject::tr( "Notes" ) ); 490 list.append( QObject::tr( "Notes" ) );
491 list.append( QObject::tr( "Groups" ) );
482 492
483 return list; 493 return list;
484} 494}
485 495
486void Contact::setEmails( const QString &v ) 496void Contact::setEmails( const QString &v )
487{ 497{
488 replace( Qtopia::Emails, v ); 498 replace( Qtopia::Emails, v );
489 if ( v.isEmpty() ) 499 if ( v.isEmpty() )
490 setDefaultEmail( QString::null ); 500 setDefaultEmail( QString::null );
491} 501}
492 502
493void Contact::setChildren( const QString &v ) 503void Contact::setChildren( const QString &v )
@@ -620,25 +630,25 @@ static Contact parseVObject( VObject *obj )
620 630
621 VObjectIterator it; 631 VObjectIterator it;
622 initPropIterator( &it, obj ); 632 initPropIterator( &it, obj );
623 while( moreIteration( &it ) ) { 633 while( moreIteration( &it ) ) {
624 VObject *o = nextVObject( &it ); 634 VObject *o = nextVObject( &it );
625 QCString name = vObjectName( o ); 635 QCString name = vObjectName( o );
626 QCString value = vObjectStringZValue( o ); 636 QCString value = vObjectStringZValue( o );
627 if ( name == VCNameProp ) { 637 if ( name == VCNameProp ) {
628 VObjectIterator nit; 638 VObjectIterator nit;
629 initPropIterator( &nit, o ); 639 initPropIterator( &nit, o );
630 while( moreIteration( &nit ) ) { 640 while( moreIteration( &nit ) ) {
631 VObject *o = nextVObject( &nit ); 641 VObject *o = nextVObject( &nit );
632 QCString name = vObjectName( o ); 642 QCString name = vObjectTypeInfo( o );
633 QString value = vObjectStringZValue( o ); 643 QString value = vObjectStringZValue( o );
634 if ( name == VCNamePrefixesProp ) 644 if ( name == VCNamePrefixesProp )
635 c.setTitle( value ); 645 c.setTitle( value );
636 else if ( name == VCNameSuffixesProp ) 646 else if ( name == VCNameSuffixesProp )
637 c.setSuffix( value ); 647 c.setSuffix( value );
638 else if ( name == VCFamilyNameProp ) 648 else if ( name == VCFamilyNameProp )
639 c.setLastName( value ); 649 c.setLastName( value );
640 else if ( name == VCGivenNameProp ) 650 else if ( name == VCGivenNameProp )
641 c.setFirstName( value ); 651 c.setFirstName( value );
642 else if ( name == VCAdditionalNamesProp ) 652 else if ( name == VCAdditionalNamesProp )
643 c.setMiddleName( value ); 653 c.setMiddleName( value );
644 } 654 }
@@ -693,25 +703,25 @@ static Contact parseVObject( VObject *obj )
693 VOICE = 0x04, 703 VOICE = 0x04,
694 CELL = 0x08, 704 CELL = 0x08,
695 FAX = 0x10, 705 FAX = 0x10,
696 PAGER = 0x20, 706 PAGER = 0x20,
697 UNKNOWN = 0x80 707 UNKNOWN = 0x80
698 }; 708 };
699 int type = 0; 709 int type = 0;
700 710
701 VObjectIterator nit; 711 VObjectIterator nit;
702 initPropIterator( &nit, o ); 712 initPropIterator( &nit, o );
703 while( moreIteration( &nit ) ) { 713 while( moreIteration( &nit ) ) {
704 VObject *o = nextVObject( &nit ); 714 VObject *o = nextVObject( &nit );
705 QCString name = vObjectName( o ); 715 QCString name = vObjectTypeInfo( o );
706 if ( name == VCHomeProp ) 716 if ( name == VCHomeProp )
707 type |= HOME; 717 type |= HOME;
708 else if ( name == VCWorkProp ) 718 else if ( name == VCWorkProp )
709 type |= WORK; 719 type |= WORK;
710 else if ( name == VCVoiceProp ) 720 else if ( name == VCVoiceProp )
711 type |= VOICE; 721 type |= VOICE;
712 else if ( name == VCCellularProp ) 722 else if ( name == VCCellularProp )
713 type |= CELL; 723 type |= CELL;
714 else if ( name == VCFaxProp ) 724 else if ( name == VCFaxProp )
715 type |= FAX; 725 type |= FAX;
716 else if ( name == VCPagerProp ) 726 else if ( name == VCPagerProp )
717 type |= PAGER; 727 type |= PAGER;
@@ -740,48 +750,48 @@ static Contact parseVObject( VObject *obj )
740 c.setBusinessMobile( value ); 750 c.setBusinessMobile( value );
741 if ( ( type & (PAGER|WORK) ) == (PAGER|WORK) ) 751 if ( ( type & (PAGER|WORK) ) == (PAGER|WORK) )
742 c.setBusinessPager( value ); 752 c.setBusinessPager( value );
743 } 753 }
744 } 754 }
745 else if ( name == VCEmailAddressProp ) { 755 else if ( name == VCEmailAddressProp ) {
746 QString email = vObjectStringZValue( o ); 756 QString email = vObjectStringZValue( o );
747 bool valid = TRUE; 757 bool valid = TRUE;
748 VObjectIterator nit; 758 VObjectIterator nit;
749 initPropIterator( &nit, o ); 759 initPropIterator( &nit, o );
750 while( moreIteration( &nit ) ) { 760 while( moreIteration( &nit ) ) {
751 VObject *o = nextVObject( &nit ); 761 VObject *o = nextVObject( &nit );
752 QCString name = vObjectName( o ); 762 QCString name = vObjectTypeInfo( o );
753 if ( name != VCInternetProp && name != VCHomeProp && 763 if ( name != VCInternetProp && name != VCHomeProp &&
754 name != VCWorkProp && 764 name != VCWorkProp &&
755 name != VCPreferredProp ) 765 name != VCPreferredProp )
756 // ### preffered should map to default email 766 // ### preffered should map to default email
757 valid = FALSE; 767 valid = FALSE;
758 } 768 }
759 if ( valid ) { 769 if ( valid ) {
760 if ( haveDefaultEmail ) { 770 if ( haveDefaultEmail ) {
761 QString str = c.emails(); 771 QString str = c.emails();
762 if ( !str.isEmpty() ) 772 if ( !str.isEmpty() )
763 str += ","+email; 773 str += ","+email;
764 c.setEmails( str ); 774 c.setEmails( str );
765 } else { 775 } else {
766 c.setDefaultEmail( email ); 776 c.setDefaultEmail( email );
767 } 777 }
768 } 778 }
769 } 779 }
770 else if ( name == VCURLProp ) { 780 else if ( name == VCURLProp ) {
771 VObjectIterator nit; 781 VObjectIterator nit;
772 initPropIterator( &nit, o ); 782 initPropIterator( &nit, o );
773 while( moreIteration( &nit ) ) { 783 while( moreIteration( &nit ) ) {
774 VObject *o = nextVObject( &nit ); 784 VObject *o = nextVObject( &nit );
775 QCString name = vObjectName( o ); 785 QCString name = vObjectTypeInfo( o );
776 if ( name == VCHomeProp ) 786 if ( name == VCHomeProp )
777 c.setHomeWebpage( value ); 787 c.setHomeWebpage( value );
778 else if ( name == VCWorkProp ) 788 else if ( name == VCWorkProp )
779 c.setBusinessWebpage( value ); 789 c.setBusinessWebpage( value );
780 } 790 }
781 } 791 }
782 else if ( name == VCOrgProp ) { 792 else if ( name == VCOrgProp ) {
783 VObjectIterator nit; 793 VObjectIterator nit;
784 initPropIterator( &nit, o ); 794 initPropIterator( &nit, o );
785 while( moreIteration( &nit ) ) { 795 while( moreIteration( &nit ) ) {
786 VObject *o = nextVObject( &nit ); 796 VObject *o = nextVObject( &nit );
787 QCString name = vObjectName( o ); 797 QCString name = vObjectName( o );
@@ -885,24 +895,29 @@ QValueList<Contact> Contact::readVCard( const QString &filename )
885 895
886 while ( obj ) { 896 while ( obj ) {
887 contacts.append( parseVObject( obj ) ); 897 contacts.append( parseVObject( obj ) );
888 898
889 VObject *t = obj; 899 VObject *t = obj;
890 obj = nextVObjectInList(obj); 900 obj = nextVObjectInList(obj);
891 cleanVObject( t ); 901 cleanVObject( t );
892 } 902 }
893 903
894 return contacts; 904 return contacts;
895} 905}
896 906
907bool Contact::match( const QString &regexp ) const
908{
909 return match(QRegExp(regexp));
910}
911
897bool Contact::match( const QRegExp &r ) const 912bool Contact::match( const QRegExp &r ) const
898{ 913{
899 bool match; 914 bool match;
900 match = false; 915 match = false;
901 QMap<int, QString>::ConstIterator it; 916 QMap<int, QString>::ConstIterator it;
902 for ( it = mMap.begin(); it != mMap.end(); ++it ) { 917 for ( it = mMap.begin(); it != mMap.end(); ++it ) {
903 if ( (*it).find( r ) > -1 ) { 918 if ( (*it).find( r ) > -1 ) {
904 match = true; 919 match = true;
905 break; 920 break;
906 } 921 }
907 } 922 }
908 return match; 923 return match;
diff --git a/library/backend/contact.h b/library/backend/contact.h
index 6abdab6..a74cbbe 100644
--- a/library/backend/contact.h
+++ b/library/backend/contact.h
@@ -92,25 +92,30 @@ public:
92 92
93 // personal 93 // personal
94 void setSpouse( const QString &v ) { replace( Qtopia::Spouse, v ); } 94 void setSpouse( const QString &v ) { replace( Qtopia::Spouse, v ); }
95 void setGender( const QString &v ) { replace( Qtopia::Gender, v ); } 95 void setGender( const QString &v ) { replace( Qtopia::Gender, v ); }
96 void setBirthday( const QString &v ) { replace( Qtopia::Birthday, v ); } 96 void setBirthday( const QString &v ) { replace( Qtopia::Birthday, v ); }
97 void setAnniversary( const QString &v ) { replace( Qtopia::Anniversary, v ); } 97 void setAnniversary( const QString &v ) { replace( Qtopia::Anniversary, v ); }
98 void setNickname( const QString &v ) { replace( Qtopia::Nickname, v ); } 98 void setNickname( const QString &v ) { replace( Qtopia::Nickname, v ); }
99 void setChildren( const QString &v ); 99 void setChildren( const QString &v );
100 100
101 // other 101 // other
102 void setNotes( const QString &v ) { replace( Qtopia::Notes, v); } 102 void setNotes( const QString &v ) { replace( Qtopia::Notes, v); }
103 103
104 bool match( const QRegExp &r ) const; 104 bool match( const QString &regexp ) const;
105
106// DON'T ATTEMPT TO USE THIS
107#ifdef QTOPIA_INTERNAL_CONTACT_MRE
108 bool match( const QRegExp &regexp ) const;
109#endif
105 110
106// // custom 111// // custom
107// void setCustomField( const QString &key, const QString &v ) 112// void setCustomField( const QString &key, const QString &v )
108// { replace(Custom- + key, v ); } 113// { replace(Custom- + key, v ); }
109 114
110 // name 115 // name
111 QString fullName() const; 116 QString fullName() const;
112 QString title() const { return find( Qtopia::Title ); } 117 QString title() const { return find( Qtopia::Title ); }
113 QString firstName() const { return find( Qtopia::FirstName ); } 118 QString firstName() const { return find( Qtopia::FirstName ); }
114 QString middleName() const { return find( Qtopia::MiddleName ); } 119 QString middleName() const { return find( Qtopia::MiddleName ); }
115 QString lastName() const { return find( Qtopia::LastName ); } 120 QString lastName() const { return find( Qtopia::LastName ); }
116 QString suffix() const { return find( Qtopia::Suffix ); } 121 QString suffix() const { return find( Qtopia::Suffix ); }
diff --git a/library/backend/event.h b/library/backend/event.h
index 0ebe9ea..277aadd 100644
--- a/library/backend/event.h
+++ b/library/backend/event.h
@@ -131,25 +131,30 @@ private:
131 131
132 QString descript, locat, categ; 132 QString descript, locat, categ;
133 Type typ : 4; 133 Type typ : 4;
134 bool startTimeDirty : 1; 134 bool startTimeDirty : 1;
135 bool endTimeDirty : 1; 135 bool endTimeDirty : 1;
136 time_t startUTC, endUTC; 136 time_t startUTC, endUTC;
137 QString tz; 137 QString tz;
138 bool hAlarm, hRepeat; 138 bool hAlarm, hRepeat;
139 int aMinutes; 139 int aMinutes;
140 SoundTypeChoice aSound; 140 SoundTypeChoice aSound;
141 RepeatPattern pattern; 141 RepeatPattern pattern;
142 QString note; 142 QString note;
143 // ADDITION
144 int mRid;// Recode ID
145 int mRinfo;// Recode Info
146 //
143 EventPrivate *d; 147 EventPrivate *d;
148
144}; 149};
145 150
146// Since an event spans multiple day, it is better to have this 151// Since an event spans multiple day, it is better to have this
147// class to represent a day instead of creating many 152// class to represent a day instead of creating many
148// dummy events... 153// dummy events...
149 154
150class EffectiveEventPrivate; 155class EffectiveEventPrivate;
151class QPC_EXPORT EffectiveEvent 156class QPC_EXPORT EffectiveEvent
152{ 157{
153public: 158public:
154 // If we calculate the effective event of a multi-day event 159 // If we calculate the effective event of a multi-day event
155 // we have to figure out whether we are at the first day, 160 // we have to figure out whether we are at the first day,
diff --git a/library/backend/recordfields.h b/library/backend/recordfields.h
index 3cddde2..4196c8b 100644
--- a/library/backend/recordfields.h
+++ b/library/backend/recordfields.h
@@ -23,88 +23,99 @@
23#include "qpcglobal.h" 23#include "qpcglobal.h"
24 24
25// dataset = "addressbook" 25// dataset = "addressbook"
26namespace Qtopia 26namespace Qtopia
27{ 27{
28 static const int UID_ID = 0; 28 static const int UID_ID = 0;
29 static const int CATEGORY_ID = 1; 29 static const int CATEGORY_ID = 1;
30 30
31 enum AddressBookFields { 31 enum AddressBookFields {
32 AddressUid = UID_ID, 32 AddressUid = UID_ID,
33 AddressCategory = CATEGORY_ID, 33 AddressCategory = CATEGORY_ID,
34 34
35 // NOTE: Order of fields dependency in backend/contact.cpp
36
35 Title, 37 Title,
36 FirstName, 38 FirstName,
37 MiddleName, 39 MiddleName,
38 LastName, 40 LastName,
39 Suffix, 41 Suffix,
40 FileAs, 42 FileAs,
41 43
44 JobTitle,
45 Department,
46 Company,
47 BusinessPhone,
48 BusinessFax,
49 BusinessMobile,
50
42 // email 51 // email
43 DefaultEmail, 52 DefaultEmail,
44 Emails, 53 Emails,
45 54
46 // home
47 HomeStreet,
48 HomeCity,
49 HomeState,
50 HomeZip,
51 HomeCountry,
52 HomePhone, 55 HomePhone,
53 HomeFax, 56 HomeFax,
54 HomeMobile, 57 HomeMobile,
55 HomeWebPage,
56 58
57 // business 59 // business
58 Company,
59 BusinessStreet, 60 BusinessStreet,
60 BusinessCity, 61 BusinessCity,
61 BusinessState, 62 BusinessState,
62 BusinessZip, 63 BusinessZip,
63 BusinessCountry, 64 BusinessCountry,
65 BusinessPager,
64 BusinessWebPage, 66 BusinessWebPage,
65 JobTitle, 67
66 Department,
67 Office, 68 Office,
68 BusinessPhone,
69 BusinessFax,
70 BusinessMobile,
71 BusinessPager,
72 Profession, 69 Profession,
73 Assistant, 70 Assistant,
74 Manager, 71 Manager,
75 72
73 // home
74 HomeStreet,
75 HomeCity,
76 HomeState,
77 HomeZip,
78 HomeCountry,
79 HomeWebPage,
80
76 //personal 81 //personal
77 Spouse, 82 Spouse,
78 Gender, 83 Gender,
79 Birthday, 84 Birthday,
80 Anniversary, 85 Anniversary,
81 Nickname, 86 Nickname,
82 Children, 87 Children,
83 88
84 // other 89 // other
85 Notes, 90 Notes,
86 Groups 91 Groups
92
93 ,rid,
94 rinfo
87 }; 95 };
88 96
89 // dataset = "todolist" 97 // dataset = "todolist"
90 enum TaskFields { 98 enum TaskFields {
91 TaskUid = UID_ID, 99 TaskUid = UID_ID,
92 TaskCategory = CATEGORY_ID, 100 TaskCategory = CATEGORY_ID,
93 101
94 HasDate, 102 HasDate,
95 Completed, 103 Completed,
96 TaskDescription, 104 TaskDescription,
97 Priority, 105 Priority,
98 Date 106 Date,
107
108 TaskRid,
109 TaskRinfo
99 }; 110 };
100 111
101 // dataset = "categories" for todos 112 // dataset = "categories" for todos
102 enum CategoryFields { 113 enum CategoryFields {
103 CatUid = UID_ID, 114 CatUid = UID_ID,
104 CatName, 115 CatName,
105 CatAppGroup 116 CatAppGroup
106 }; 117 };
107 118
108 119
109// dataset = "datebook" 120// dataset = "datebook"
110 enum DatebookFields { 121 enum DatebookFields {
@@ -119,17 +130,20 @@ namespace Qtopia
119 EndDateTime, 130 EndDateTime,
120 DatebookType, 131 DatebookType,
121 HasAlarm, 132 HasAlarm,
122 SoundType, 133 SoundType,
123 AlarmTime, 134 AlarmTime,
124 135
125 RepeatPatternType, 136 RepeatPatternType,
126 RepeatPatternFrequency, 137 RepeatPatternFrequency,
127 RepeatPatternPosition, 138 RepeatPatternPosition,
128 RepeatPatternDays, 139 RepeatPatternDays,
129 RepeatPatternHasEndDate, 140 RepeatPatternHasEndDate,
130 RepeatPatternEndDate, 141 RepeatPatternEndDate,
142
143 DateBookRid,
144 DateBookRinfo
131 }; 145 };
132}; 146};
133 147
134 148
135#endif 149#endif
diff --git a/library/backend/task.h b/library/backend/task.h
index ffe26b0..6f383b8 100644
--- a/library/backend/task.h
+++ b/library/backend/task.h
@@ -63,15 +63,19 @@ public:
63 bool match( const QRegExp &r ) const; 63 bool match( const QRegExp &r ) const;
64 64
65private: 65private:
66 Qtopia::UidGen &uidGen() { return sUidGen; } 66 Qtopia::UidGen &uidGen() { return sUidGen; }
67 static Qtopia::UidGen sUidGen; 67 static Qtopia::UidGen sUidGen;
68 68
69 bool mDue; 69 bool mDue;
70 QDate mDueDate; 70 QDate mDueDate;
71 bool mCompleted; 71 bool mCompleted;
72 int mPriority; 72 int mPriority;
73 QString mDesc; 73 QString mDesc;
74 TaskPrivate *d; 74 TaskPrivate *d;
75 // ADDITION
76 int recordId;
77 int recordInfo;
78 //
75}; 79};
76 80
77#endif 81#endif
diff --git a/library/backend/vobject.cpp b/library/backend/vobject.cpp
index af112a7..9c2ba3b 100644
--- a/library/backend/vobject.cpp
+++ b/library/backend/vobject.cpp
@@ -1198,13 +1198,22 @@ DLLEXPORT(void) writeVObjectsToFile(char *fname, VObject *list)
1198 QFileDirect f( fname); 1198 QFileDirect f( fname);
1199 if ( !f.open( IO_WriteOnly ) ) { 1199 if ( !f.open( IO_WriteOnly ) ) {
1200 qWarning("Unable to open vobject write %s", fname); 1200 qWarning("Unable to open vobject write %s", fname);
1201 return; 1201 return;
1202 } 1202 }
1203 1203
1204 while (list) { 1204 while (list) {
1205 writeVObject(f.directHandle(),list); 1205 writeVObject(f.directHandle(),list);
1206 list = nextVObjectInList(list); 1206 list = nextVObjectInList(list);
1207 } 1207 }
1208} 1208}
1209 1209
1210DLLEXPORT(const char *) vObjectTypeInfo(VObject *o)
1211{
1212 const char *type = vObjectName( o );
1213 if ( strcmp( type, "TYPE" ) == 0 )
1214 type = vObjectStringZValue( o );
1215 return type;
1216}
1217
1218
1210// end of source file vobject.c 1219// end of source file vobject.c
diff --git a/library/backend/vobject_p.h b/library/backend/vobject_p.h
index b6a2c0a..a0d921e 100644
--- a/library/backend/vobject_p.h
+++ b/library/backend/vobject_p.h
@@ -387,15 +387,18 @@ If you are linking this code into your build directly then
387you may find them a more convenient API that the other flavors 387you may find them a more convenient API that the other flavors
388that take a file name. If you use them with the DLL LIB you 388that take a file name. If you use them with the DLL LIB you
389will get a link error. 389will get a link error.
390*/ 390*/
391 391
392 392
393#if INCLUDEMFC 393#if INCLUDEMFC
394extern VObject* Parse_MIME_FromFile(CFile *file); 394extern VObject* Parse_MIME_FromFile(CFile *file);
395#else 395#else
396extern VObject* Parse_MIME_FromFile(FILE *file); 396extern VObject* Parse_MIME_FromFile(FILE *file);
397#endif 397#endif
398 398
399extern DLLEXPORT(const char *) vObjectTypeInfo(VObject *o);
400
401
399#endif /* __VOBJECT_H__ */ 402#endif /* __VOBJECT_H__ */
400 403
401 404