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 { , AddrTypePcs = 262144 }
enum  VCardClassification { , ClassConfidential = 4 }
typedef std::list< EmailEmailList
typedef std::list< TelephoneTelephoneList
typedef std::list< AddressAddressList

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)
const EmailListemailAddresses () 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)
const AddressListaddresses () const
void addTelephone (const std::string &number, int type)
const TelephoneListtelephone () const
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  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

Al 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 186 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 JEP-0054 for details.

Enumerator:
AddrTypePcs 

Definition at line 44 of file vcard.h.

enum VCardClassification

Classifies the VCard.

Enumerator:
ClassConfidential 

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.

~VCard (  )  [virtual]

Virtual destructor.

Definition at line 179 of file vcard.cpp.


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

Referenced by VCardManager::storeVCard().

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

Sets the formatted name.

Parameters:
name The formatted name.

Definition at line 214 of file vcard.h.

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

Returns the formatted name.

Returns:
The formatted name.

Definition at line 220 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 189 of file vcard.cpp.

const Name& name (  )  const [inline]

Returns a full name.

Returns:
A full name.

Definition at line 237 of file vcard.h.

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

Sets a nickname.

Parameters:
nickname The nickname.

Definition at line 243 of file vcard.h.

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

Returns the nickname.

Returns:
The nickname.

Definition at line 249 of file vcard.h.

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

Sets a URL (homepage, etc.).

Parameters:
url The URL.

Definition at line 255 of file vcard.h.

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

Returns the url.

Returns:
The url.

Definition at line 261 of file vcard.h.

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

Sets the birthday.

Parameters:
bday The birthday, ISO 8601 formatted.

Definition at line 267 of file vcard.h.

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

Returns the birthday.

Returns:
The birthday.

Definition at line 273 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 279 of file vcard.h.

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

Returns the Jabber ID.

Returns:
The Jabber ID.

Definition at line 285 of file vcard.h.

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

Sets the person's title.

Parameters:
title The title.

Definition at line 291 of file vcard.h.

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

Returns the title.

Returns:
The title.

Definition at line 297 of file vcard.h.

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

Sets the person's role.

Parameters:
role The role.

Definition at line 303 of file vcard.h.

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

Returns the role.

Returns:
The role.

Definition at line 309 of file vcard.h.

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

Sets a "Commentary note".

Parameters:
note The note.

Definition at line 315 of file vcard.h.

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

Returns the note.

Returns:
The note.

Definition at line 321 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 327 of file vcard.h.

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

Returns the "free-form descriptive text".

Returns:
The descriptive text.

Definition at line 333 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 339 of file vcard.h.

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

Returns the mailer.

Returns:
The mailer.

Definition at line 345 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 351 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 357 of file vcard.h.

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

Sets the "Unique identifier property."

Parameters:
uid The unique identifier.

Definition at line 363 of file vcard.h.

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

Returns the unique identifier.

Returns:
The unique identifier.

Definition at line 369 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 376 of file vcard.h.

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

Returns the timezone offset.

Returns:
The timezone offset.

Definition at line 382 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 388 of file vcard.h.

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

Returns the product identifier.

Returns:
The product identifier.

Definition at line 394 of file vcard.h.

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

Sets the "Sort string property."

Parameters:
sortstring The sort string.

Definition at line 400 of file vcard.h.

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

Returns the sort string.

Returns:
The sort string.

Definition at line 406 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 200 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 209 of file vcard.cpp.

const Photo& photo (  )  const [inline]

Returns photo information.

Returns:
Info about the photo.

Definition at line 425 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 219 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 228 of file vcard.cpp.

const Photo& logo (  )  const [inline]

Returns logo information.

Returns:
Info about the logo.

Definition at line 444 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 238 of file vcard.cpp.

const EmailList& emailAddresses (  )  const [inline]

Returns a list of email addresses.

Returns:
A list of email addresses.

Definition at line 457 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.
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 254 of file vcard.cpp.

const AddressList& addresses (  )  const [inline]

Returns a list of addresses.

Returns:
A list of addresses.

Definition at line 479 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 282 of file vcard.cpp.

const TelephoneList& telephone (  )  const [inline]

Returns a list of telephone numbers.

Returns:
A list of telephone numbers.

Definition at line 492 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 306 of file vcard.cpp.

const Geo& geo (  )  const [inline]

Returns geo location information.

Returns:
Info about the geo location.

Definition at line 506 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 315 of file vcard.cpp.

const Org& org (  )  const [inline]

Returns organization information.

Returns:
Info about the organization.

Definition at line 519 of file vcard.h.

void setClass ( VCardClassification  vclass  )  [inline]

Sets the "Privacy classification property."

Parameters:
vclass The classification value.

Definition at line 525 of file vcard.h.

VCardClassification classification (  )  const [inline]

Returns information about classification.

Returns:
Info about the classification.

Definition at line 531 of file vcard.h.


The documentation for this class was generated from the following files:
Generated on Tue May 1 14:20:27 2007 for gloox by  doxygen 1.5.1