vcardconverter.h

00001 /*
00002     This file is part of libkabc.
00003     Copyright (c) 2002 Tobias Koenig <tokoe@kde.org>
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public License
00016     along with this library; see the file COPYING.LIB.  If not, write to
00017     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018     Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef KABC_VCARDCONVERTER_H
00022 #define KABC_VCARDCONVERTER_H
00023 
00024 #include <qstring.h>
00025 
00026 #include "addressee.h"
00027 #include "vcardparser.h"  //for KABC_VCARD_ENCODING_FIX define
00028 
00029 namespace KABC {
00030 
00054 class KABC_EXPORT VCardConverter
00055 {
00056   public:
00057 
00062    enum Version
00063     {
00064       v2_1,
00065       v3_0
00066     };
00067 
00071     VCardConverter();
00072 
00076     ~VCardConverter();
00077 
00085     KDE_DEPRECATED QString createVCard( const Addressee &addr, Version version = v3_0 );
00086     QCString createVCardRaw( const Addressee &addr, Version version = v3_0 );
00087 
00095     // FIXME: Add error handling
00096     KDE_DEPRECATED QString createVCards( Addressee::List list, Version version = v3_0 );
00097     QCString createVCardsRaw( Addressee::List list, Version version = v3_0 );
00098 
00099     // FIXME: Add "createVCards( AddressBook * )"
00100 
00104     KDE_DEPRECATED Addressee parseVCard( const QString& vcard );
00105     Addressee parseVCardRaw( const QCString& vcard );
00106 
00110     // FIXME: Add error handling
00111     KDE_DEPRECATED Addressee::List parseVCards( const QString& vcard );
00112     Addressee::List parseVCardsRaw( const QCString& vcard );
00113 
00114     // FIXME: Add "bool parseVCards( AddressBook *, const QString &vcard )"
00115 
00119     bool vCardToAddressee( const QString&, Addressee &, Version version = v3_0 ) KDE_DEPRECATED;
00120 
00124     bool addresseeToVCard( const Addressee&, QString&, Version version = v3_0 ) KDE_DEPRECATED;
00125 
00126   private:
00131     QStringList splitString( const QChar &sep, const QString &value );
00132 
00133     struct VCardConverterData;
00134     VCardConverterData *d;
00135 };
00136 
00137 
00148 KABC_EXPORT QString dateToVCardString( const QDateTime &dateTime );
00149 
00156 KABC_EXPORT QString dateToVCardString( const QDate &date );
00157 
00165 KABC_EXPORT QDateTime VCardStringToDate( const QString &dateString );
00166 
00167 }
00168 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys