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

#include <vcard.h>

Inheritance diagram for VCard:
Inheritance graph
[legend]

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 (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 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 setPhotoUri (const std::string &extval)
void setPhoto (const std::string &type=EmptyString, const std::string &binval=EmptyString)
const Photophoto () const
void setLogo (const std::string &extval)
void setLogo (const std::string &type=EmptyString, const std::string &binval=EmptyString)
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)
void addLabel (const StringList &lines, int type)
const AddressListaddresses () const
const LabelListlabels () 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)
const VCardClassificationclassification () const
virtual const std::string & filterString () const
virtual StanzaExtensionnewInstance (const Tag *tag) const
virtual Tagtag () const
virtual StanzaExtensionclone () const
- Public Member Functions inherited from StanzaExtension
 StanzaExtension (int type)
virtual ~StanzaExtension ()
virtual StanzaembeddedStanza () const
virtual TagembeddedTag () const
int extensionType () 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 34 of file vcard.h.

Member Typedef Documentation

typedef std::list<Address> AddressList

A list of address entries.

Definition at line 204 of file vcard.h.

typedef std::list<Email> EmailList

A list of email fields.

Definition at line 107 of file vcard.h.

typedef std::list<Label> LabelList

A list of address labels.

Definition at line 209 of file vcard.h.

typedef std::list<Telephone> TelephoneList

A list of telephone entries.

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

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 ( )

Constructor.

Definition at line 43 of file vcard.cpp.

VCard ( const Tag vcard)

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

Parameters
vcardThe VCard-Tag.

Definition at line 50 of file vcard.cpp.

virtual ~VCard ( )
inlinevirtual

Virtual destructor.

Definition at line 225 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 307 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 291 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 335 of file vcard.cpp.

const AddressList& addresses ( ) const
inline

Returns a list of addresses.

Returns
A list of addresses.

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

const std::string& bday ( ) const
inline

Returns the birthday.

Returns
The birthday.

Definition at line 292 of file vcard.h.

const VCardClassification& classification ( ) const
inline

Returns information about classification.

Returns
Info about the classification.

Definition at line 565 of file vcard.h.

virtual StanzaExtension* clone ( ) const
inlinevirtual

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.

const std::string& desc ( ) const
inline

Returns the "free-form descriptive text".

Returns
The descriptive text.

Definition at line 352 of file vcard.h.

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.

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

const std::string& formattedname ( ) const
inline

Returns the formatted name.

Returns
The formatted name.

Definition at line 237 of file vcard.h.

const Geo& geo ( ) const
inline

Returns geo location information.

Returns
Info about the geo location.

Definition at line 540 of file vcard.h.

const std::string& jabberid ( ) const
inline

Returns the Jabber ID.

Returns
The Jabber ID.

Definition at line 304 of file vcard.h.

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.

const Photo& logo ( ) const
inline

Returns logo information.

Returns
Info about the logo.

Definition at line 465 of file vcard.h.

const std::string& mailer ( ) const
inline

Returns the mailer.

Returns
The mailer.

Definition at line 364 of file vcard.h.

const Name& name ( ) const
inline

Returns a full name.

Returns
A full name.

Definition at line 256 of file vcard.h.

virtual StanzaExtension* newInstance ( const Tag tag) const
inlinevirtual

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

{
return new FooExtension( tag );
}
Returns
The derived extension's new instance.

Implements StanzaExtension.

Definition at line 571 of file vcard.h.

const std::string& nickname ( ) const
inline

Returns the nickname.

Returns
The nickname.

Definition at line 268 of file vcard.h.

const std::string& note ( ) const
inline

Returns the note.

Returns
The note.

Definition at line 340 of file vcard.h.

const Org& org ( ) const
inline

Returns organization information.

Returns
Info about the organization.

Definition at line 553 of file vcard.h.

const Photo& photo ( ) const
inline

Returns photo information.

Returns
Info about the photo.

Definition at line 445 of file vcard.h.

const std::string& prodid ( ) const
inline

Returns the product identifier.

Returns
The product identifier.

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

const std::string& role ( ) const
inline

Returns the role.

Returns
The role.

Definition at line 328 of file vcard.h.

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

Sets the birthday.

Parameters
bdayThe birthday, ISO 8601 formatted.

Definition at line 286 of file vcard.h.

void setClass ( VCardClassification  vclass)
inline

Sets the "Privacy classification property."

Parameters
vclassThe classification value.

Definition at line 559 of file vcard.h.

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

Sets a "free-form descriptive text".

Parameters
descThe descriptive text.

Definition at line 346 of file vcard.h.

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

Sets the formatted name.

Parameters
nameThe formatted name.

Definition at line 231 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 377 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 298 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 265 of file vcard.cpp.

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

Sets the organization logo directly.

Parameters
typeFormat type parameter.
binvalThe binary logo data.
Note
To remove the logo from the VCard call this function without any parameters.

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

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

Definition at line 227 of file vcard.cpp.

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

Sets a nickname.

Parameters
nicknameThe nickname.

Definition at line 262 of file vcard.h.

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

Sets a "Commentary note".

Parameters
noteThe note.

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

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

Sets the photo directly.

Parameters
typeFormat type parameter.
binvalThe binary photo data.
Note
To remove the photo from the VCard call this function without any parameters.

Definition at line 248 of file vcard.cpp.

void setPhotoUri ( const std::string &  extval)

Sets a URI to a photo.

Parameters
extvalThe URI to the photo.

Definition at line 239 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 407 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 370 of file vcard.h.

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

Sets the person's role.

Parameters
roleThe role.

Definition at line 322 of file vcard.h.

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

Sets the "Sort string property."

Parameters
sortstringThe sort string.

Definition at line 419 of file vcard.h.

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

Sets the person's title.

Parameters
titleThe title.

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

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

Sets the "Unique identifier property."

Parameters
uidThe unique identifier.

Definition at line 382 of file vcard.h.

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

Sets a URL (homepage, etc.).

Parameters
urlThe URL.

Definition at line 274 of file vcard.h.

const std::string& sortstring ( ) const
inline

Returns the sort string.

Returns
The sort string.

Definition at line 425 of file vcard.h.

Tag * tag ( ) const
virtual

Returns a Tag representation of the extension.

Returns
A Tag representation of the extension.

Implements StanzaExtension.

Definition at line 401 of file vcard.cpp.

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.

const std::string& title ( ) const
inline

Returns the title.

Returns
The title.

Definition at line 316 of file vcard.h.

const std::string& tz ( ) const
inline

Returns the timezone offset.

Returns
The timezone offset.

Definition at line 401 of file vcard.h.

const std::string& uid ( ) const
inline

Returns the unique identifier.

Returns
The unique identifier.

Definition at line 388 of file vcard.h.

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: