gloox  0.9.9.12
Classes | Public Types | Public Member Functions | List of all members
VCard Class Reference

#include <vcard.h>

Classes

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

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

Detailed Description

A VCard abstraction.

See VCardManager for info on how to fetch VCards.

Author
Jakob Schroeter js@ca.nosp@m.maya.nosp@m..net
Since
0.8

Definition at line 33 of file vcard.h.

Member Typedef Documentation

typedef std::list<Address> AddressList

A list of address entries.

Definition at line 203 of file vcard.h.

typedef std::list<Email> EmailList

A list of email fields.

Definition at line 106 of file vcard.h.

typedef std::list<Label> LabelList

A list of address labels.

Definition at line 208 of file vcard.h.

typedef std::list<Telephone> TelephoneList

A list of telephone entries.

Definition at line 132 of file vcard.h.

Member Enumeration Documentation

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.

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
vcardThe VCard-Tag.

Definition at line 27 of file vcard.cpp.

virtual ~VCard ( )
inlinevirtual

Virtual destructor.

Definition at line 224 of file vcard.h.

Member Function Documentation

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
poboxA PO Box.
extaddSome extra field (extended address).
streetThe street.
localityThe village, city, etc.
regionThe region.
pcodeThe post code.
ctryThe country.
typeBit-wise ORed AddressType.

Definition at line 268 of file vcard.cpp.

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

Adds an email address.

Parameters
useridThe email address.
typeBit-wise ORed AddressType.

Definition at line 252 of file vcard.cpp.

void addLabel ( const StringList lines,
int  type 
)

Adds an address label.

Parameters
linesA list of address label lines.
typeBit-wise ORed AddressType.

Definition at line 296 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.

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

Adds a telephone number.

Parameters
numberThe telephone number.
typeBit-wise ORed AddressType.

Definition at line 314 of file vcard.cpp.

const std::string& bday ( ) const
inline

Returns the birthday.

Returns
The birthday.

Definition at line 295 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.

const std::string& desc ( ) const
inline

Returns the "free-form descriptive text".

Returns
The descriptive text.

Definition at line 355 of file vcard.h.

EmailList& emailAddresses ( )
inline

Returns a list of email addresses.

Returns
A list of email addresses.

Definition at line 479 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.

const Geo& geo ( ) const
inline

Returns geo location information.

Returns
Info about the geo location.

Definition at line 541 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.

LabelList& labels ( )
inline

Returns a list of address labels.

Returns
A list of address labels.

Definition at line 514 of file vcard.h.

const Photo& logo ( ) const
inline

Returns logo information.

Returns
Info about the logo.

Definition at line 466 of file vcard.h.

const std::string& mailer ( ) const
inline

Returns the mailer.

Returns
The mailer.

Definition at line 367 of file vcard.h.

const Name& name ( ) const
inline

Returns a full name.

Returns
A full name.

Definition at line 259 of file vcard.h.

const std::string& nickname ( ) const
inline

Returns the nickname.

Returns
The nickname.

Definition at line 271 of file vcard.h.

const std::string& note ( ) const
inline

Returns the note.

Returns
The note.

Definition at line 343 of file vcard.h.

const Org& org ( ) const
inline

Returns organization information.

Returns
Info about the organization.

Definition at line 554 of file vcard.h.

const Photo& photo ( ) const
inline

Returns photo information.

Returns
Info about the photo.

Definition at line 447 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.

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.

const std::string& role ( ) const
inline

Returns the role.

Returns
The role.

Definition at line 331 of file vcard.h.

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

Sets the birthday.

Parameters
bdayThe birthday, ISO 8601 formatted.

Definition at line 289 of file vcard.h.

void setClass ( VCardClassification  vclass)
inline

Sets the "Privacy classification property."

Parameters
vclassThe classification value.

Definition at line 560 of file vcard.h.

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

Sets a "free-form descriptive text".

Parameters
descThe descriptive text.

Definition at line 349 of file vcard.h.

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

Sets the formatted name.

Parameters
nameThe formatted name.

Definition at line 236 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
latThe latitude.
lonThe longitude.

Definition at line 338 of file vcard.cpp.

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

Sets a Jabber ID.

Parameters
jabberidThe (bare) Jabber ID (node@host).

Definition at line 301 of file vcard.h.

void setLogo ( const std::string &  extval)

Sets a URI to a organization logo.

Parameters
extvalThe URI to the logo.

Definition at line 233 of file vcard.cpp.

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

Sets the organization logo directly.

Parameters
typeFormat type parameter.
binvalThe binary logo data.

Definition at line 242 of file vcard.cpp.

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

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

Parameters
mailerThe mailer.

Definition at line 361 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
familyThe family name.
givenThe given name.
middleThe middle name(s)
prefixA name prefix.
suffixA name suffix.

Definition at line 203 of file vcard.cpp.

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

Sets a nickname.

Parameters
nicknameThe nickname.

Definition at line 265 of file vcard.h.

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

Sets a "Commentary note".

Parameters
noteThe note.

Definition at line 337 of file vcard.h.

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

Sets "Organizational name and units property."

Parameters
orgnameThe organization's name.
orgunitsA list of organizational units.

Definition at line 347 of file vcard.cpp.

void setPhoto ( const std::string &  extval)

Sets a URI to a photo.

Parameters
extvalThe URI to the photo.

Definition at line 214 of file vcard.cpp.

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

Sets the photo directly.

Parameters
typeFormat type parameter.
binvalThe binary photo data.

Definition at line 223 of file vcard.cpp.

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

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

Parameters
prodidThe product identifier.

Definition at line 410 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
revThe date of the last revision.

Definition at line 373 of file vcard.h.

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

Sets the person's role.

Parameters
roleThe role.

Definition at line 325 of file vcard.h.

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

Sets the "Sort string property."

Parameters
sortstringThe sort string.

Definition at line 422 of file vcard.h.

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

Sets the person's title.

Parameters
titleThe title.

Definition at line 313 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
tzThe timezone offset.

Definition at line 398 of file vcard.h.

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

Sets the "Unique identifier property."

Parameters
uidThe unique identifier.

Definition at line 385 of file vcard.h.

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

Sets a URL (homepage, etc.).

Parameters
urlThe URL.

Definition at line 277 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.

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 356 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.

const std::string& title ( ) const
inline

Returns the title.

Returns
The title.

Definition at line 319 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.

const std::string& uid ( ) const
inline

Returns the unique identifier.

Returns
The unique identifier.

Definition at line 391 of file vcard.h.

const std::string& url ( ) const
inline

Returns the url.

Returns
The url.

Definition at line 283 of file vcard.h.


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