kabc Library API Documentation

KABC::VCardConverter Class Reference

Class to converting contact objects into vCard format and vice versa. More...

#include <vcardconverter.h>

List of all members.

Public Types

enum  Version { v2_1, v3_0 }

Public Member Functions

 VCardConverter ()
 ~VCardConverter ()
QString createVCard (const Addressee &addr, Version version=v3_0)
QString createVCards (Addressee::List list, Version version=v3_0)
Addressee parseVCard (const QString &vcard)
Addressee::List parseVCards (const QString &vcard)
bool vCardToAddressee (const QString &, Addressee &, Version version=v3_0) KDE_DEPRECATED
bool addresseeToVCard (const Addressee &, QString &, Version version=v3_0) KDE_DEPRECATED


Detailed Description

Class to converting contact objects into vCard format and vice versa.

This class implements reading and writing of contact using from/to the vCard format. Currently vCard version 2.1 and 3.0 is supported.

Example:

QFile file( "myfile.vcf" ); file.open( IO_ReadOnly ); QTextStream s( &file ); s.setEncoding( QTextStream::UnicodeUTF8 ); QString data = s.read(); VCardConverter converter; Addressee::List list = converter.parseVCards( data ); // print formatted name of first contact qDebug( "name=%s", list[ 0 ].formattedName().latin1() );

Definition at line 56 of file vcardconverter.h.


Member Enumeration Documentation

enum KABC::VCardConverter::Version
 

  • v2_1 - VCard format version 2.1
  • v3_0 - VCard format version 3.0

Definition at line 64 of file vcardconverter.h.


Constructor & Destructor Documentation

KABC::VCardConverter::VCardConverter  ) 
 

Constructor.

KABC::VCardConverter::~VCardConverter  ) 
 

Destructor.


Member Function Documentation

QString KABC::VCardConverter::createVCard const Addressee addr,
Version  version = v3_0
 

Creates a string in vCard format which contains the given contact.

Parameters:
addr The contact object
version The version of the generated vCard format

QString KABC::VCardConverter::createVCards Addressee::List  list,
Version  version = v3_0
 

Creates a string in vCard format which contains the given list of contact.

Parameters:
list The list of contact objects
version The version of the generated vCard format

Referenced by KABC::VCardFormatPlugin::save(), and KABC::VCardFormatPlugin::saveAll().

Addressee KABC::VCardConverter::parseVCard const QString vcard  ) 
 

Parses a string in vCard format and returns the first contact.

Addressee::List KABC::VCardConverter::parseVCards const QString vcard  ) 
 

Parses a string in vCard format and returns a list of contact objects.

Referenced by KABC::VCardFormatPlugin::load(), and KABC::VCardFormatPlugin::loadAll().

bool KABC::VCardConverter::vCardToAddressee const QString ,
Addressee ,
Version  version = v3_0
 

Deprecated:

bool KABC::VCardConverter::addresseeToVCard const Addressee ,
QString ,
Version  version = v3_0
 

Deprecated:


The documentation for this class was generated from the following file:
KDE Logo
This file is part of the documentation for kabc Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed May 5 07:21:53 2004 by doxygen 1.3.6 written by Dimitri van Heesch, © 1997-2003