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 
00053 class KABC_EXPORT VCardConverter
00054 {
00055   public:
00056 
00061    enum Version
00062     {
00063       v2_1,
00064       v3_0
00065     };
00066 
00070     VCardConverter();
00071 
00075     ~VCardConverter();
00076   
00084     QString createVCard( const Addressee &addr, Version version = v3_0 );
00085 
00093     // FIXME: Add error handling
00094     QString createVCards( Addressee::List list, Version version = v3_0 );
00095 
00096     // FIXME: Add "createVCards( AddressBook * )"
00097 
00101     Addressee parseVCard( const QString& vcard );
00102 
00106     // FIXME: Add error handling
00107     Addressee::List parseVCards( const QString& vcard );
00108 
00109     // FIXME: Add "bool parseVCards( AddressBook *, const QString &vcard )"
00110 
00114     bool vCardToAddressee( const QString&, Addressee &, Version version = v3_0 ) KDE_DEPRECATED;
00115 
00119     bool addresseeToVCard( const Addressee&, QString&, Version version = v3_0 ) KDE_DEPRECATED;
00120 
00121   private:
00126     QStringList splitString( const QChar &sep, const QString &value );
00127 
00128     struct VCardConverterData;
00129     VCardConverterData *d;
00130 };
00131 
00132 
00143 KABC_EXPORT QString dateToVCardString( const QDateTime &dateTime );
00144 
00151 KABC_EXPORT QString dateToVCardString( const QDate &date );
00152 
00160 KABC_EXPORT QDateTime VCardStringToDate( const QString &dateString );
00161 
00162 }
00163 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys