kabc Library API Documentation

vcardformatimpl.h

00001 /*
00002     This file is part of libkabc.
00003     Copyright (c) 2001 Cornelius Schumacher <schumacher@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., 59 Temple Place - Suite 330,
00018     Boston, MA 02111-1307, USA.
00019 */
00020 
00021 #ifndef KABC_VCARDFORMATIMPL_H
00022 #define KABC_VCARDFORMATIMPL_H
00023 
00024 #include <qstring.h>
00025 #include <qfile.h>
00026 
00027 #include "address.h"
00028 #include "addressee.h"
00029 
00030 #include <VCard.h>
00031 
00032 namespace KABC {
00033 
00034 class AddressBook;
00035 
00042 class VCardFormatImpl
00043 {
00044   public:
00045     bool load( Addressee &, QFile *file );
00046     bool loadAll( AddressBook *, Resource *, QFile *file );
00047     void save( const Addressee &, QFile *file );
00048     void saveAll( AddressBook *, Resource *, QFile *file );
00049 
00050     bool readFromString( const QString &vcard, Addressee &addr );
00051     bool writeToString( const Addressee &addressee, QString &vcard );
00052 
00053   protected:
00054     bool loadAddressee( Addressee &, VCARD::VCard & );
00055     void saveAddressee( const Addressee &, VCARD::VCard *, bool intern );
00056 
00057     void addTextValue (VCARD::VCard *, VCARD::EntityType, const QString & );
00058     QString readTextValue( VCARD::ContentLine * );
00059 
00060     void addDateValue( VCARD::VCard *, VCARD::EntityType, const QDate & );
00061     QDate readDateValue( VCARD::ContentLine * );
00062 
00063     void addDateTimeValue( VCARD::VCard *, VCARD::EntityType, const QDateTime & );
00064     QDateTime readDateTimeValue( VCARD::ContentLine * );
00065 
00066     void addAddressValue( VCARD::VCard *, const Address & );
00067     Address readAddressValue( VCARD::ContentLine * );
00068 
00069     void addLabelValue( VCARD::VCard *, const Address & );
00070 
00071     void addTelephoneValue( VCARD::VCard *, const PhoneNumber & );
00072     PhoneNumber readTelephoneValue( VCARD::ContentLine * );
00073 
00074     void addNValue( VCARD::VCard *, const Addressee & );
00075     void readNValue( VCARD::ContentLine *, Addressee & );
00076 
00077     void addCustomValue( VCARD::VCard *, const QString & );
00078 
00079     void addAddressParam( VCARD::ContentLine *, int );
00080     int readAddressParam( VCARD::ContentLine * );
00081 
00082     void addGeoValue( VCARD::VCard *, const Geo & );
00083     Geo readGeoValue( VCARD::ContentLine * );
00084 
00085     void addUTCValue( VCARD::VCard *, const TimeZone & );
00086     TimeZone readUTCValue( VCARD::ContentLine * );
00087 
00088     void addClassValue( VCARD::VCard *, const Secrecy & );
00089     Secrecy readClassValue( VCARD::ContentLine * );
00090 
00091     void addKeyValue( VCARD::VCard *, const Key & );
00092     Key readKeyValue( VCARD::ContentLine * );
00093 
00094     void addPictureValue( VCARD::VCard *, VCARD::EntityType, const Picture &, const Addressee &, bool );
00095     Picture readPictureValue( VCARD::ContentLine *, VCARD::EntityType, const Addressee &addr );
00096 
00097     void addSoundValue( VCARD::VCard *, const Sound &, const Addressee &, bool );
00098     Sound readSoundValue( VCARD::ContentLine *, const Addressee &addr );
00099 
00100     void addAgentValue( VCARD::VCard *, const Agent & );
00101     Agent readAgentValue( VCARD::ContentLine * );
00102 };
00103 
00104 }
00105 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 27 22:16:08 2005 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001