libopie PIM API Documentation

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.6 2003/04/13 18:07:10 zecke Exp $
00017  * =====================================================================
00018  * History:
00019  * $Log: ocontactaccessbackend_vcard.h,v $
00020  * Revision 1.6  2003/04/13 18:07:10  zecke
00021  * More API doc
00022  * QString -> const QString&
00023  * QString = 0l -> QString::null
00024  *
00025  * Revision 1.5  2003/03/21 10:33:09  eilers
00026  * Merged speed optimized xml backend for contacts to main.
00027  * Added QDateTime to querybyexample. For instance, it is now possible to get
00028  * all Birthdays/Anniversaries between two dates. This should be used
00029  * to show all birthdays in the datebook..
00030  * This change is sourcecode backward compatible but you have to upgrade
00031  * the binaries for today-addressbook.
00032  *
00033  * Revision 1.4  2002/12/07 13:26:22  eilers
00034  * Fixing bug in storing anniversary..
00035  *
00036  * Revision 1.3  2002/11/13 14:14:51  eilers
00037  * Added sorted for Contacts..
00038  *
00039  * Revision 1.2  2002/11/10 15:41:53  eilers
00040  * Bugfixes..
00041  *
00042  * Revision 1.1  2002/11/09 14:34:52  eilers
00043  * Added VCard Backend.
00044  *
00045  */
00046 #ifndef __OCONTACTACCESSBACKEND_VCARD_H_
00047 #define __OCONTACTACCESSBACKEND_VCARD_H_
00048 
00049 #include <opie/ocontact.h>
00050 
00051 #include "ocontactaccessbackend.h"
00052 
00053 class VObject;
00054 
00060 class OContactAccessBackend_VCard : public OContactAccessBackend {
00061  public:
00062     OContactAccessBackend_VCard ( const QString& appname, const QString& filename = QString::null );
00063 
00064     bool load ();
00065     bool reload();
00066     bool save();
00067     void clear ();
00068 
00069     bool add ( const OContact& newcontact );
00070     bool remove ( int uid );
00071     bool replace ( const OContact& contact );
00072 
00073     OContact find ( int uid ) const;
00074     QArray<int> allRecords() const;
00075     QArray<int> queryByExample ( const OContact &query, int settings, const QDateTime& d = QDateTime() );
00076     QArray<int> matchRegexp(  const QRegExp &r ) const;
00077 
00078     const uint querySettings();
00079     bool hasQuerySettings (uint querySettings) const;
00080     QArray<int> sorted( bool ascending, int sortOrder, int sortFilter, int cat );
00081     bool wasChangedExternally();
00082 
00083 private:
00084     OContact parseVObject( VObject* obj );
00085     VObject* createVObject( const OContact& c );
00086     QString convDateToVCardDate( const QDate& c ) const;
00087     QDate convVCardDateToDate( const QString& datestr );
00088     VObject *safeAddPropValue( VObject *o, const char* prop, const QString& value );
00089     VObject *safeAddProp( VObject* o, const char* prop);
00090 
00091     bool m_dirty : 1;
00092     QString m_file;
00093     QMap<int, OContact> m_map;
00094 };
00095 
00096 #endif
KDE Logo
This file is part of the documentation for OPIE Version 1.1.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:25:19 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001