• Skip to content
  • Skip to link menu
KDE 4.6 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • KDE Home
  • Contact Us
 

kabc

  • KABC
  • VCardConverter
Public Types | Public Member Functions

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 ()
QByteArray createVCard (const Addressee &addr, Version version=v3_0) const
QByteArray createVCards (Addressee::List list, Version version=v3_0) const
Addressee parseVCard (const QByteArray &vcard) const
Addressee::List parseVCards (const QByteArray &vcard) const

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( QIODevice::ReadOnly );

  QByteArray data = file.readAll();

  VCardConverter converter;
  Addressee::List list = converter.parseVCards( data );

  // print formatted name of first contact
  qDebug( "name=%s", list[ 0 ].formattedName().toLatin1() );

Definition at line 53 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 61 of file vcardconverter.h.


Constructor & Destructor Documentation

VCardConverter::VCardConverter ( )

Constructor.

Definition at line 26 of file vcardconverter.cpp.

VCardConverter::~VCardConverter ( )

Destructor.

Definition at line 31 of file vcardconverter.cpp.


Member Function Documentation

QByteArray VCardConverter::createVCard ( const Addressee &  addr,
Version  version = v3_0 
) const

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

Parameters:
addrThe contact object
versionThe version of the generated vCard format

Definition at line 35 of file vcardconverter.cpp.

QByteArray VCardConverter::createVCards ( Addressee::List  list,
Version  version = v3_0 
) const

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

Parameters:
listThe list of contact objects
versionThe version of the generated vCard format

Definition at line 43 of file vcardconverter.cpp.

Addressee VCardConverter::parseVCard ( const QByteArray &  vcard) const

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

Definition at line 50 of file vcardconverter.cpp.

Addressee::List VCardConverter::parseVCards ( const QByteArray &  vcard) const

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

Definition at line 57 of file vcardconverter.cpp.


The documentation for this class was generated from the following files:
  • vcardconverter.h
  • vcardconverter.cpp

kabc

Skip menu "kabc"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.7.3
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal