VCard Class Reference

`#include <vcard.h>`

Inheritance diagram for VCard:
[legend]

## Classes

struct | Name
struct | Email
struct | Telephone
struct | Address
struct | Label
struct | Geo
struct | Org
struct | Photo

## Public Types

enum

AddressType {
AddrTypeHome = 1 , AddrTypeWork = 2 , AddrTypePref = 4 , AddrTypeX400 = 8 ,
AddrTypeInet = 16 , AddrTypeParcel = 32 , AddrTypePostal = 64 , AddrTypeDom = 128 ,
AddrTypeIntl = 256 , AddrTypeVoice = 512 , AddrTypeFax = 1024 , AddrTypePager = 2048 ,
AddrTypeMsg = 4096 , AddrTypeCell = 8192 , AddrTypeVideo = 16384 , AddrTypeBbs = 32768 ,
AddrTypeModem = 65536 , AddrTypeIsdn = 131072 , AddrTypePcs = 262144
}

enum | VCardClassification { ClassNone = 0 , ClassPublic = 1 , ClassPrivate = 2 , ClassConfidential = 4 }
typedef std::list< Email > | EmailList
typedef std::list< Telephone > | TelephoneList
typedef std::list< Address > | AddressList
typedef std::list< Label > | LabelList

## Public Member Functions

| VCard ()
| VCard (const Tag *vcard)
virtual | ~VCard ()
void | setFormattedname (const std::string &name)
const std::string & | formattedname () const
void | setName (const std::string &family, const std::string &given, const std::string &middle=EmptyString, const std::string &prefix=EmptyString, const std::string &suffix=EmptyString)
const Name & | name () const
void | setNickname (const std::string &nickname)
const std::string & | nickname () const
void | setUrl (const std::string &url)
const std::string & | url () const
void | setBday (const std::string &bday)
const std::string & | bday () const
void | setJabberid (const std::string &jabberid)
const std::string & | jabberid () const
void | setTitle (const std::string &title)
const std::string & | title () const
void | setRole (const std::string &role)
const std::string & | role () const
void | setNote (const std::string &note)
const std::string & | note () const
void | setDesc (const std::string &desc)
const std::string & | desc () const
void | setMailer (const std::string &mailer)
const std::string & | mailer () const
void | setRev (const std::string &rev)
const std::string & | rev () const
void | setUid (const std::string &uid)
const std::string & | uid () const
void | setTz (const std::string &tz)
const std::string & | tz () const
void | setProdid (const std::string &prodid)
const std::string & | prodid () const
void | setSortstring (const std::string &sortstring)
const std::string & | sortstring () const
void | setPhotoUri (const std::string &extval)
void | setPhoto (const std::string &type=EmptyString, const std::string &binval=EmptyString)
const Photo & | photo () const
void | setLogo (const std::string &extval)
void | setLogo (const std::string &type=EmptyString, const std::string &binval=EmptyString)
const Photo & | logo () const
void | addEmail (const std::string &userid, int type)
const EmailList & | emailAddresses () const
void | addAddress (const std::string &pobox, const std::string &extadd, const std::string &street, const std::string &locality, const std::string &region, const std::string &pcode, const std::string &ctry, int type)
void | addLabel (const StringList &lines, int type)
const AddressList & | addresses () const
const LabelList & | labels () const
void | addTelephone (const std::string &number, int type)
const TelephoneList & | telephone () const
void | setGeo (const std::string &lat, const std::string &lon)
const Geo & | geo () const
void | setOrganization (const std::string &orgname, const StringList &orgunits)
const Org & | org () const
void | setClass (VCardClassification vclass)
const VCardClassification & | classification () const
virtual const std::string & | filterString () const
virtual StanzaExtension * | newInstance (const Tag *tag) const
virtual Tag * | tag () const
virtual StanzaExtension * | clone () const
Public Member Functions inherited from StanzaExtension
| StanzaExtension (int type)
virtual | ~StanzaExtension ()
virtual Stanza * | embeddedStanza () const
virtual Tag * | embeddedTag () const
int | extensionType () const

## Detailed Description

A VCard abstraction.

See VCardManager for info on how to fetch VCards.

Author
  Jakob Schröter js@ca.nosp@m.maya.nosp@m..net

Since
  0.8

Definition at line 34 of file vcard.h.

## Member Typedef Documentation

## AddressList

typedef std::list<Address> AddressList

A list of address entries.

Definition at line 204 of file vcard.h.

## EmailList

typedef std::list<Email> EmailList

A list of email fields.

Definition at line 107 of file vcard.h.

## LabelList

typedef std::list<Label> LabelList

A list of address labels.

Definition at line 209 of file vcard.h.

## TelephoneList

typedef std::list<Telephone> TelephoneList

A list of telephone entries.

Definition at line 133 of file vcard.h.

## Member Enumeration Documentation

## AddressType

enum AddressType

Addressing type indicators.

Note
  `AddrTypeDom` and `AddrTypeIntl` are mutually exclusive. If both are present, `AddrTypeDom` takes precendence.
  Also note that not all adress types are applicable everywhere. For example, `AddrTypeIsdn` does not make sense for a postal address. Check XEP-0054 for details.

Enumerator
AddrTypeHome | Home address.
AddrTypeWork | Work address.
AddrTypePref | Preferred address.
AddrTypeX400 | X.400 address.
AddrTypeInet | Internet address.
AddrTypeParcel | Parcel address.
AddrTypePostal | Postal address.
AddrTypeDom | Domestic(?) address.
AddrTypeIntl | International(?) address.
AddrTypeVoice | Voice number.
AddrTypeFax | Fax number.
AddrTypePager | Pager.
AddrTypeMsg | MSG(?)
AddrTypeCell | Cell phone number.
AddrTypeVideo | Video chat(?).
AddrTypeBbs | BBS.
AddrTypeModem | Modem.
AddrTypeIsdn | ISDN.
AddrTypePcs | PCS.

Definition at line 45 of file vcard.h.

## VCardClassification

enum VCardClassification

Classifies the VCard.

Enumerator
ClassNone | Not classified.
ClassPublic | Public.
ClassPrivate | Private.
ClassConfidential | Confidential.

Definition at line 83 of file vcard.h.

## Constructor & Destructor Documentation

## VCard() [1/2]

VCard | ( |  | ) |

Constructor.

Definition at line 43 of file vcard.cpp.

## VCard() [2/2]

VCard | ( | const Tag * | vcard | ) |

Constructs a new VCard from a given Tag containing appropriate fields.

Parameters

  vcard | The VCard-Tag.

Definition at line 50 of file vcard.cpp.

## ~VCard()

virtual ~VCard | ( |  | ) |

inline virtual

Virtual destructor.

Definition at line 225 of file vcard.h.

## Member Function Documentation

## addAddress()

void addAddress | ( | const std::string & | pobox,
|  | const std::string & | extadd,
|  | const std::string & | street,
|  | const std::string & | locality,
|  | const std::string & | region,
|  | const std::string & | pcode,
|  | const std::string & | ctry,
|  | int | type )

Adds an address.

Parameters

  pobox | A PO Box.
  extadd | Some extra field (extended address).
  street | The street.
  locality | The village, city, etc.
  region | The region.
  pcode | The post code.
  ctry | The country.
  type | Bit-wise ORed AddressType.

Definition at line 311 of file vcard.cpp.

## addEmail()

void addEmail | ( | const std::string & | userid,
|  | int | type )

Adds an email address.

Parameters

  userid | The email address.
  type | Bit-wise ORed AddressType.

Definition at line 295 of file vcard.cpp.

## addLabel()

void addLabel | ( | const StringList & | lines,
|  | int | type )

Adds an address label.

Parameters

  lines | A list of address label lines.
  type | Bit-wise ORed `AddressType`.

Definition at line 339 of file vcard.cpp.

## addresses()

const AddressList & addresses | ( |  | ) | const

inline

Returns a list of addresses.

Returns
  A list of addresses.

Definition at line 507 of file vcard.h.

## addTelephone()

void addTelephone | ( | const std::string & | number,
|  | int | type )

Adds a telephone number.

Parameters

  number | The telephone number.
  type | Bit-wise ORed AddressType.

Definition at line 357 of file vcard.cpp.

## bday()

const std::string & bday | ( |  | ) | const

inline

Returns the birthday.

Returns
  The birthday.

Definition at line 292 of file vcard.h.

## classification()

const VCardClassification & classification | ( |  | ) | const

inline

Returns information about classification.

Returns
  Info about the classification.

Definition at line 565 of file vcard.h.

## clone()

virtual StanzaExtension * clone | ( |  | ) | const

inline virtual

Returns an identical copy of the current StanzaExtension.

Returns
  An identical copy of the current StanzaExtension.

Implements StanzaExtension.

Definition at line 580 of file vcard.h.

## desc()

const std::string & desc | ( |  | ) | const

inline

Returns the "free-form descriptive text".

Returns
  The descriptive text.

Definition at line 352 of file vcard.h.

## emailAddresses()

const EmailList & emailAddresses | ( |  | ) | const

inline

Returns a list of email addresses.

Returns
  A list of email addresses.

Definition at line 478 of file vcard.h.

## filterString()

const std::string & filterString | ( |  | ) | const

virtual

Returns an XPath expression that describes a path to child elements of a stanza that an extension handles.

Returns
  The extension's filter string.

Implements StanzaExtension.

Definition at line 399 of file vcard.cpp.

## formattedname()

const std::string & formattedname | ( |  | ) | const

inline

Returns the formatted name.

Returns
  The formatted name.

Definition at line 237 of file vcard.h.

## geo()

const Geo & geo | ( |  | ) | const

inline

Returns geo location information.

Returns
  Info about the geo location.

Definition at line 540 of file vcard.h.

## jabberid()

const std::string & jabberid | ( |  | ) | const

inline

Returns the Jabber ID.

Returns
  The Jabber ID.

Definition at line 304 of file vcard.h.

## labels()

const LabelList & labels | ( |  | ) | const

inline

Returns a list of address labels.

Returns
  A list of address labels.

Definition at line 513 of file vcard.h.

## logo()

const Photo & logo | ( |  | ) | const

inline

Returns logo information.

Returns
  Info about the logo.

Definition at line 465 of file vcard.h.

## mailer()

const std::string & mailer | ( |  | ) | const

inline

Returns the mailer.

Returns
  The mailer.

Definition at line 364 of file vcard.h.

## name()

const Name & name | ( |  | ) | const

inline

Returns a full name.

Returns
  A full name.

Definition at line 256 of file vcard.h.

## newInstance()

virtual StanzaExtension * newInstance | ( | const Tag * | tag | ) | const

inline virtual

Returns a new Instance of the derived type. Usually, for a derived class FooExtension, the implementation of this function looks like:

StanzaExtension* FooExtension::newInstance( const Tag* tag ) const
{
return new FooExtension( tag );
}
gloox::StanzaExtension::StanzaExtension
StanzaExtension(int type)
Definition stanzaextension.h:211
gloox::Tag
This is an abstraction of an XML element.
Definition tag.h:47
gloox::VCard::tag
virtual Tag * tag() const
Definition vcard.cpp:405

Returns
  The derived extension's new instance.

Implements StanzaExtension.

Definition at line 571 of file vcard.h.

## nickname()

const std::string & nickname | ( |  | ) | const

inline

Returns the nickname.

Returns
  The nickname.

Definition at line 268 of file vcard.h.

## note()

const std::string & note | ( |  | ) | const

inline

Returns the note.

Returns
  The note.

Definition at line 340 of file vcard.h.

## org()

const Org & org | ( |  | ) | const

inline

Returns organization information.

Returns
  Info about the organization.

Definition at line 553 of file vcard.h.

## photo()

const Photo & photo | ( |  | ) | const

inline

Returns photo information.

Returns
  Info about the photo.

Definition at line 445 of file vcard.h.

## prodid()

const std::string & prodid | ( |  | ) | const

inline

Returns the product identifier.

Returns
  The product identifier.

Definition at line 413 of file vcard.h.

## rev()

const std::string & rev | ( |  | ) | const

inline

Returns the date of the last revision.

Returns
  The date of the last revision.

Definition at line 376 of file vcard.h.

## role()

const std::string & role | ( |  | ) | const

inline

Returns the role.

Returns
  The role.

Definition at line 328 of file vcard.h.

## setBday()

void setBday | ( | const std::string & | bday | ) |

inline

Sets the birthday.

Parameters

  bday | The birthday, ISO 8601 formatted.

Definition at line 286 of file vcard.h.

## setClass()

void setClass | ( | VCardClassification | vclass | ) |

inline

Sets the "Privacy classification property."

Parameters

  vclass | The classification value.

Definition at line 559 of file vcard.h.

## setDesc()

void setDesc | ( | const std::string & | desc | ) |

inline

Sets a "free-form descriptive text".

Parameters

  desc | The descriptive text.

Definition at line 346 of file vcard.h.

## setFormattedname()

void setFormattedname | ( | const std::string & | name | ) |

inline

Sets the formatted name.

Parameters

  name | The formatted name.

Definition at line 231 of file vcard.h.

## setGeo()

void setGeo | ( | const std::string & | lat,
|  | const std::string & | lon )

Sets "Geographical position. Values are the decimal degrees of Latitude and Longitude. The value should be specified to six decimal places."

Parameters

  lat | The latitude.
  lon | The longitude.

Definition at line 381 of file vcard.cpp.

## setJabberid()

void setJabberid | ( | const std::string & | jabberid | ) |

inline

Sets a Jabber ID.

Parameters

  jabberid | The (bare) Jabber ID (node@host).

Definition at line 298 of file vcard.h.

## setLogo() [1/2]

void setLogo | ( | const std::string & | extval | ) |

Sets a URI to a organization logo.

Parameters

  extval | The URI to the logo.

Definition at line 269 of file vcard.cpp.

## setLogo() [2/2]

void setLogo | ( | const std::string & | type = EmptyString,
|  | const std::string & | binval = EmptyString )

Sets the organization logo directly.

Parameters

  type | Format type parameter.
  binval | The binary logo data.

Note
  To remove the logo from the VCard call this function without any parameters.

Definition at line 278 of file vcard.cpp.

## setMailer()

void setMailer | ( | const std::string & | mailer | ) |

inline

Sets the "Mailer (e.g., Mail User Agent Type) property".

Parameters

  mailer | The mailer.

Definition at line 358 of file vcard.h.

## setName()

void setName | ( | const std::string & | family,
|  | const std::string & | given,
|  | const std::string & | middle = EmptyString,
|  | const std::string & | prefix = EmptyString,
|  | const std::string & | suffix = EmptyString )

Sets the individual name parts. Unused parts can be left empty.

Parameters

  family | The family name.
  given | The given name.
  middle | The middle name(s)
  prefix | A name prefix.
  suffix | A name suffix.

Definition at line 231 of file vcard.cpp.

## setNickname()

void setNickname | ( | const std::string & | nickname | ) |

inline

Sets a nickname.

Parameters

  nickname | The nickname.

Definition at line 262 of file vcard.h.

## setNote()

void setNote | ( | const std::string & | note | ) |

inline

Sets a "Commentary note".

Parameters

  note | The note.

Definition at line 334 of file vcard.h.

## setOrganization()

void setOrganization | ( | const std::string & | orgname,
|  | const StringList & | orgunits )

Sets "Organizational name and units property."

Parameters

  orgname | The organization's name.
  orgunits | A list of organizational units.

Definition at line 390 of file vcard.cpp.

## setPhoto()

void setPhoto | ( | const std::string & | type = EmptyString,
|  | const std::string & | binval = EmptyString )

Sets the photo directly.

Parameters

  type | Format type parameter.
  binval | The binary photo data.

Note
  To remove the photo from the VCard call this function without any parameters.

Definition at line 252 of file vcard.cpp.

## setPhotoUri()

void setPhotoUri | ( | const std::string & | extval | ) |

Sets a URI to a photo.

Parameters

  extval | The URI to the photo.

Definition at line 243 of file vcard.cpp.

## setProdid()

void setProdid | ( | const std::string & | prodid | ) |

inline

Sets the "Identifier of product that generated the vCard property."

Parameters

  prodid | The product identifier.

Definition at line 407 of file vcard.h.

## setRev()

void setRev | ( | const std::string & | rev | ) |

inline

Sets the "Last revised property. The value must be an ISO 8601 formatted UTC date/time."

Parameters

  rev | The date of the last revision.

Definition at line 370 of file vcard.h.

## setRole()

void setRole | ( | const std::string & | role | ) |

inline

Sets the person's role.

Parameters

  role | The role.

Definition at line 322 of file vcard.h.

## setSortstring()

void setSortstring | ( | const std::string & | sortstring | ) |

inline

Sets the "Sort string property."

Parameters

  sortstring | The sort string.

Definition at line 419 of file vcard.h.

## setTitle()

void setTitle | ( | const std::string & | title | ) |

inline

Sets the person's title.

Parameters

  title | The title.

Definition at line 310 of file vcard.h.

## setTz()

void setTz | ( | const std::string & | tz | ) |

inline

Sets the Time zone's Standard Time UTC offset. Value must be an ISO 8601 formatted UTC offset.

Parameters

  tz | The timezone offset.

Definition at line 395 of file vcard.h.

## setUid()

void setUid | ( | const std::string & | uid | ) |

inline

Sets the "Unique identifier property."

Parameters

  uid | The unique identifier.

Definition at line 382 of file vcard.h.

## setUrl()

void setUrl | ( | const std::string & | url | ) |

inline

Sets a URL (homepage, etc.).

Parameters

  url | The URL.

Definition at line 274 of file vcard.h.

## sortstring()

const std::string & sortstring | ( |  | ) | const

inline

Returns the sort string.

Returns
  The sort string.

Definition at line 425 of file vcard.h.

## tag()

Tag * tag | ( |  | ) | const

virtual

Returns a Tag representation of the extension.

Returns
  A Tag representation of the extension.

Implements StanzaExtension.

Definition at line 405 of file vcard.cpp.

## telephone()

const TelephoneList & telephone | ( |  | ) | const

inline

Returns a list of telephone numbers.

Returns
  A list of telephone numbers.

Definition at line 526 of file vcard.h.

## title()

const std::string & title | ( |  | ) | const

inline

Returns the title.

Returns
  The title.

Definition at line 316 of file vcard.h.

## tz()

const std::string & tz | ( |  | ) | const

inline

Returns the timezone offset.

Returns
  The timezone offset.

Definition at line 401 of file vcard.h.

## uid()

const std::string & uid | ( |  | ) | const

inline

Returns the unique identifier.

Returns
  The unique identifier.

Definition at line 388 of file vcard.h.

## url()

const std::string & url | ( |  | ) | const

inline

Returns the url.

Returns
  The url.

Definition at line 280 of file vcard.h.

The documentation for this class was generated from the following files:

- vcard.h
- vcard.cpp