• Skip to content
  • Skip to link menu
Brand

API Documentation

  1. KDE API Reference
  2. The KDE Frameworks
  3. KContacts
  • KDE Home
  • Contact Us

Quick Links

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

Class Picker

About

Address book API for KDE

Maintainer
Laurent Montel
Supported platforms
Android, FreeBSD, iOS, Linux, MacOSX, Windows
Community
IRC: #kde-devel on Freenode
Mailing list: kde-frameworks-devel
Use with CMake
find_package(KF5Contacts)
target_link_libraries(yourapp KF5::Contacts)
Use with QMake
QT += KContacts 
Clone
git clone git://anongit.kde.org/kcontacts.git
Browse source
KContacts on cgit.kde.org

KContacts

  • View on LXR
  • KContacts
  • VCardConverter
Public Types | Public Member Functions | List of all members
KContacts::VCardConverter Class Reference

#include <vcardconverter.h>

Public Types

enum  Version { v2_1, v3_0, v4_0 }
 

Public Member Functions

 VCardConverter ()
 
 ~VCardConverter ()
 
QByteArray createVCard (const Addressee &addr, Version version=v3_0) const
 
QByteArray createVCards (const Addressee::List &list, Version version=v3_0) const
 
QByteArray exportVCard (const Addressee &addr, Version version) const
 
QByteArray exportVCards (const Addressee::List &list, Version version) 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 52 of file vcardconverter.h.

Member Enumeration Documentation

enum KContacts::VCardConverter::Version
  • v2_1 - VCard format version 2.1
  • v3_0 - VCard format version 3.0
  • v4_0 - VCard format version 4.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 62 of file vcardconverter.cpp.

QByteArray VCardConverter::createVCards ( const 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 70 of file vcardconverter.cpp.

QByteArray VCardConverter::exportVCard ( const Addressee &  addr,
Version  version 
) const
Since
4.9.1

Definition at line 35 of file vcardconverter.cpp.

QByteArray VCardConverter::exportVCards ( const Addressee::List &  list,
Version  version 
) const
Since
4.9.1

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 89 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 96 of file vcardconverter.cpp.


The documentation for this class was generated from the following files:
  • vcardconverter.h
  • vcardconverter.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Sat Dec 14 2019 01:54:12 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal