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 
00028 namespace KABC {
00029 
00056 class KABC_EXPORT VCardConverter
00057 {
00058   public:
00059 
00064    enum Version
00065     {
00066       v2_1,
00067       v3_0
00068     };
00069 
00073     VCardConverter();
00074 
00078     ~VCardConverter();
00079   
00087     QString createVCard( const Addressee &addr, Version version = v3_0 );
00088 
00096     // FIXME: Add error handling
00097     QString createVCards( Addressee::List list, Version version = v3_0 );
00098 
00099     // FIXME: Add "createVCards( AddressBook * )"
00100 
00104     Addressee parseVCard( const QString& vcard );
00105 
00109     // FIXME: Add error handling
00110     Addressee::List parseVCards( const QString& vcard );
00111 
00112     // FIXME: Add "bool parseVCards( AddressBook *, const QString &vcard )"
00113 
00117     bool vCardToAddressee( const QString&, Addressee &, Version version = v3_0 ) KDE_DEPRECATED;
00118 
00122     bool addresseeToVCard( const Addressee&, QString&, Version version = v3_0 ) KDE_DEPRECATED;
00123 
00124   private:
00129     QStringList splitString( const QChar &sep, const QString &value );
00130 
00131     struct VCardConverterData;
00132     VCardConverterData *d;
00133 };
00134 
00135 
00146 KABC_EXPORT QString dateToVCardString( const QDateTime &dateTime );
00147 
00154 KABC_EXPORT QString dateToVCardString( const QDate &date );
00155 
00163 KABC_EXPORT QDateTime VCardStringToDate( const QString &dateString );
00164 
00165 }
00166 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys