Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ocontactaccessbackend_vcard.h

Go to the documentation of this file.
00001 /*
00002  * VCard Backend for the OPIE-Contact Database.
00003  *
00004  * Copyright (C) 2000 Trolltech AS.  All rights reserved.
00005  * Copyright (c) 2002 by Stefan Eilers (Eilers.Stefan@epost.de)
00006  *
00007  * =====================================================================
00008  *      This program is free software; you can redistribute it and/or
00009  *      modify it under the terms of the GNU Library General Public
00010  *      License as published by the Free Software Foundation; either
00011  *      version 2 of the License, or (at your option) any later version.
00012  * =====================================================================
00013  * ToDo:
00014  *
00015  * =====================================================================
00016  * Version: $Id: ocontactaccessbackend_vcard.h,v 1.1 2004/11/16 21:46:07 mickeyl Exp $
00017  * =====================================================================
00018  * History:
00019  * $Log: ocontactaccessbackend_vcard.h,v $
00020  * Revision 1.1  2004/11/16 21:46:07  mickeyl
00021  * libopie1 goes into unsupported
00022  *
00023  * Revision 1.6  2003/04/13 18:07:10  zecke
00024  * More API doc
00025  * QString -> const QString&
00026  * QString = 0l -> QString::null
00027  *
00028  * Revision 1.5  2003/03/21 10:33:09  eilers
00029  * Merged speed optimized xml backend for contacts to main.
00030  * Added QDateTime to querybyexample. For instance, it is now possible to get
00031  * all Birthdays/Anniversaries between two dates. This should be used
00032  * to show all birthdays in the datebook..
00033  * This change is sourcecode backward compatible but you have to upgrade
00034  * the binaries for today-addressbook.
00035  *
00036  * Revision 1.4  2002/12/07 13:26:22  eilers
00037  * Fixing bug in storing anniversary..
00038  *
00039  * Revision 1.3  2002/11/13 14:14:51  eilers
00040  * Added sorted for Contacts..
00041  *
00042  * Revision 1.2  2002/11/10 15:41:53  eilers
00043  * Bugfixes..
00044  *
00045  * Revision 1.1  2002/11/09 14:34:52  eilers
00046  * Added VCard Backend.
00047  *
00048  */
00049 #ifndef __OCONTACTACCESSBACKEND_VCARD_H_
00050 #define __OCONTACTACCESSBACKEND_VCARD_H_
00051 
00052 #include <opie/ocontact.h>
00053 
00054 #include "ocontactaccessbackend.h"
00055 
00056 class VObject;
00057 
00063 class OContactAccessBackend_VCard : public OContactAccessBackend {
00064  public:
00065         OContactAccessBackend_VCard ( const QString& appname, const QString& filename = QString::null );
00066 
00067         bool load ();
00068         bool reload();
00069         bool save();
00070         void clear ();
00071 
00072         bool add ( const OContact& newcontact );
00073         bool remove ( int uid );
00074         bool replace ( const OContact& contact );
00075 
00076         OContact find ( int uid ) const;
00077         QArray<int> allRecords() const;
00078         QArray<int> queryByExample ( const OContact &query, int settings, const QDateTime& d = QDateTime() );
00079         QArray<int> matchRegexp(  const QRegExp &r ) const;
00080 
00081         const uint querySettings();
00082         bool hasQuerySettings (uint querySettings) const;
00083         QArray<int> sorted( bool ascending, int sortOrder, int sortFilter, int cat );
00084         bool wasChangedExternally();
00085 
00086 private:
00087         OContact parseVObject( VObject* obj );
00088         VObject* createVObject( const OContact& c );
00089         QString convDateToVCardDate( const QDate& c ) const;
00090         QDate convVCardDateToDate( const QString& datestr );
00091         VObject *safeAddPropValue( VObject *o, const char* prop, const QString& value );
00092         VObject *safeAddProp( VObject* o, const char* prop);
00093 
00094         bool m_dirty : 1;
00095         QString m_file;
00096         QMap<int, OContact> m_map;
00097 };
00098 
00099 #endif

Generated on Sat Nov 5 16:16:14 2005 for OPIE by  doxygen 1.4.2