VCard Class Reference

A VCard abstraction. More...

#include <vcard.h>

Collaboration diagram for VCard:

Collaboration graph
[legend]

List of all members.

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< EmailEmailList
typedef std::list< TelephoneTelephoneList
typedef std::list< AddressAddressList
typedef std::list< LabelLabelList

Public Member Functions

 VCard ()
 VCard (Tag *vcard)
virtual ~VCard ()
Tagtag () const
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="", const std::string &prefix="", const std::string &suffix="")
const Namename () 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 setPhoto (const std::string &extval)
void setPhoto (const std::string &type, const std::string &binval)
const Photophoto () const
void setLogo (const std::string &extval)
void setLogo (const std::string &type, const std::string &binval)
const Photologo () const
void addEmail (const std::string &userid, int type)
EmailListemailAddresses ()
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)
AddressListaddresses ()
LabelListlabels ()
void addTelephone (const std::string &number, int type)
TelephoneListtelephone ()
void setGeo (const std::string &lat, const std::string &lon)
const Geogeo () const
void setOrganization (const std::string &orgname, const StringList &orgunits)
const Orgorg () const
void setClass (VCardClassification vclass)
VCardClassification classification () const

Classes

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


Detailed Description

A VCard abstraction.

See VCardManager for info on how to fetch VCards.

Author:
Jakob Schroeter <js@camaya.net>
Since:
0.8

Definition at line 33 of file vcard.h.


Member Typedef Documentation

typedef std::list<Email> EmailList

A list of email fields.

Definition at line 106 of file vcard.h.

typedef std::list<Telephone> TelephoneList

A list of telephone entries.

Definition at line 132 of file vcard.h.

typedef std::list<Address> AddressList

A list of address entries.

Definition at line 203 of file vcard.h.

typedef std::list<Label> LabelList

A list of address labels.

Definition at line 208 of file vcard.h.


Member Enumeration Documentation

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 44 of file vcard.h.

enum VCardClassification

Classifies the VCard.

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

Definition at line 82 of file vcard.h.


Constructor & Destructor Documentation

VCard (  ) 

Constructor.

Definition at line 21 of file vcard.cpp.

VCard ( Tag vcard  ) 

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

Parameters:
vcard The VCard-Tag.

Definition at line 27 of file vcard.cpp.

virtual ~VCard (  )  [inline, virtual]

Virtual destructor.

Definition at line 224 of file vcard.h.


Member Function Documentation

Tag * tag (  )  const

Returns a Tag representation of the VCard. The caller becomes the owner of the Tag.

Returns:
A Tag containing the VCard, or 0 if the VCard data is invalid.

Definition at line 348 of file vcard.cpp.

void setFormattedname ( const std::string &  name  )  [inline]

Sets the formatted name.

Parameters:
name The formatted name.

Definition at line 236 of file vcard.h.

const std::string& formattedname (  )  const [inline]

Returns the formatted name.

Returns:
The formatted name.

Definition at line 242 of file vcard.h.

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

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 195 of file vcard.cpp.

const Name& name (  )  const [inline]

Returns a full name.

Returns:
A full name.

Definition at line 259 of file vcard.h.

void setNickname ( const std::string &  nickname  )  [inline]

Sets a nickname.

Parameters:
nickname The nickname.

Definition at line 265 of file vcard.h.

const std::string& nickname (  )  const [inline]

Returns the nickname.

Returns:
The nickname.

Definition at line 271 of file vcard.h.

void setUrl ( const std::string &  url  )  [inline]

Sets a URL (homepage, etc.).

Parameters:
url The URL.

Definition at line 277 of file vcard.h.

const std::string& url (  )  const [inline]

Returns the url.

Returns:
The url.

Definition at line 283 of file vcard.h.

void setBday ( const std::string &  bday  )  [inline]

Sets the birthday.

Parameters:
bday The birthday, ISO 8601 formatted.

Definition at line 289 of file vcard.h.

const std::string& bday (  )  const [inline]

Returns the birthday.

Returns:
The birthday.

Definition at line 295 of file vcard.h.

void setJabberid ( const std::string &  jabberid  )  [inline]

Sets a Jabber ID.

Parameters:
jabberid The (bare) Jabber ID (node@host).

Definition at line 301 of file vcard.h.

const std::string& jabberid (  )  const [inline]

Returns the Jabber ID.

Returns:
The Jabber ID.

Definition at line 307 of file vcard.h.

void setTitle ( const std::string &  title  )  [inline]

Sets the person's title.

Parameters:
title The title.

Definition at line 313 of file vcard.h.

const std::string& title (  )  const [inline]

Returns the title.

Returns:
The title.

Definition at line 319 of file vcard.h.

void setRole ( const std::string &  role  )  [inline]

Sets the person's role.

Parameters:
role The role.

Definition at line 325 of file vcard.h.

const std::string& role (  )  const [inline]

Returns the role.

Returns:
The role.

Definition at line 331 of file vcard.h.

void setNote ( const std::string &  note  )  [inline]

Sets a "Commentary note".

Parameters:
note The note.

Definition at line 337 of file vcard.h.

const std::string& note (  )  const [inline]

Returns the note.

Returns:
The note.

Definition at line 343 of file vcard.h.

void setDesc ( const std::string &  desc  )  [inline]

Sets a "free-form descriptive text".

Parameters:
desc The descriptive text.

Definition at line 349 of file vcard.h.

const std::string& desc (  )  const [inline]

Returns the "free-form descriptive text".

Returns:
The descriptive text.

Definition at line 355 of file vcard.h.

void setMailer ( const std::string &  mailer  )  [inline]

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

Parameters:
mailer The mailer.

Definition at line 361 of file vcard.h.

const std::string& mailer (  )  const [inline]

Returns the mailer.

Returns:
The mailer.

Definition at line 367 of file vcard.h.

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 373 of file vcard.h.

const std::string& rev (  )  const [inline]

Returns the date of the last revision.

Returns:
The date of the last revision.

Definition at line 379 of file vcard.h.

void setUid ( const std::string &  uid  )  [inline]

Sets the "Unique identifier property."

Parameters:
uid The unique identifier.

Definition at line 385 of file vcard.h.

const std::string& uid (  )  const [inline]

Returns the unique identifier.

Returns:
The unique identifier.

Definition at line 391 of file vcard.h.

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 398 of file vcard.h.

const std::string& tz (  )  const [inline]

Returns the timezone offset.

Returns:
The timezone offset.

Definition at line 404 of file vcard.h.

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 410 of file vcard.h.

const std::string& prodid (  )  const [inline]

Returns the product identifier.

Returns:
The product identifier.

Definition at line 416 of file vcard.h.

void setSortstring ( const std::string &  sortstring  )  [inline]

Sets the "Sort string property."

Parameters:
sortstring The sort string.

Definition at line 422 of file vcard.h.

const std::string& sortstring (  )  const [inline]

Returns the sort string.

Returns:
The sort string.

Definition at line 428 of file vcard.h.

void setPhoto ( const std::string &  extval  ) 

Sets a URI to a photo.

Parameters:
extval The URI to the photo.

Definition at line 206 of file vcard.cpp.

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

Sets the photo directly.

Parameters:
type Format type parameter.
binval The binary photo data.

Definition at line 215 of file vcard.cpp.

const Photo& photo (  )  const [inline]

Returns photo information.

Returns:
Info about the photo.

Definition at line 447 of file vcard.h.

void setLogo ( const std::string &  extval  ) 

Sets a URI to a organization logo.

Parameters:
extval The URI to the logo.

Definition at line 225 of file vcard.cpp.

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

Sets the organization logo directly.

Parameters:
type Format type parameter.
binval The binary logo data.

Definition at line 234 of file vcard.cpp.

const Photo& logo (  )  const [inline]

Returns logo information.

Returns:
Info about the logo.

Definition at line 466 of file vcard.h.

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 244 of file vcard.cpp.

EmailList& emailAddresses (  )  [inline]

Returns a list of email addresses.

Returns:
A list of email addresses.

Definition at line 479 of file vcard.h.

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 260 of file vcard.cpp.

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 288 of file vcard.cpp.

AddressList& addresses (  )  [inline]

Returns a list of addresses.

Returns:
A list of addresses.

Definition at line 508 of file vcard.h.

LabelList& labels (  )  [inline]

Returns a list of address labels.

Returns:
A list of address labels.

Definition at line 514 of file vcard.h.

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 306 of file vcard.cpp.

TelephoneList& telephone (  )  [inline]

Returns a list of telephone numbers.

Returns:
A list of telephone numbers.

Definition at line 527 of file vcard.h.

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 330 of file vcard.cpp.

const Geo& geo (  )  const [inline]

Returns geo location information.

Returns:
Info about the geo location.

Definition at line 541 of file vcard.h.

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 339 of file vcard.cpp.

const Org& org (  )  const [inline]

Returns organization information.

Returns:
Info about the organization.

Definition at line 554 of file vcard.h.

void setClass ( VCardClassification  vclass  )  [inline]

Sets the "Privacy classification property."

Parameters:
vclass The classification value.

Definition at line 560 of file vcard.h.

VCardClassification classification (  )  const [inline]

Returns information about classification.

Returns:
Info about the classification.

Definition at line 566 of file vcard.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 08:50:46 2007 for gloox by  doxygen 1.5.3-20071008