/* Copyright (c) 2006-2015 by Jakob Schröter This file is part of the gloox library. http://camaya.net/gloox This software is distributed under a license. The full license agreement can be found in the file LICENSE in this distribution. This software may not be copied, modified, sold or distributed other than expressed in the named license agreement. This software is distributed without any warranty. */ #ifndef VCARD_H__ #define VCARD_H__ #include "gloox.h" #include "stanzaextension.h" namespace gloox { class Tag; /** * @brief A VCard abstraction. * * See @link gloox::VCardManager VCardManager @endlink for info on how to * fetch VCards. * * @author Jakob Schröter * @since 0.8 */ class GLOOX_API VCard : public StanzaExtension { public: /** * Addressing type indicators. * @note @c AddrTypeDom and @c AddrTypeIntl are mutually exclusive. If both are present, * @c AddrTypeDom takes precendence. * @note Also note that not all adress types are applicable everywhere. For example, * @c AddrTypeIsdn does not make sense for a postal address. Check @xep{0054} * for details. */ enum AddressType { AddrTypeHome = 1, /**< Home address. */ AddrTypeWork = 2, /**< Work address. */ AddrTypePref = 4, /**< Preferred address. */ AddrTypeX400 = 8, /**< X.400 address. */ AddrTypeInet = 16, /**< Internet address. */ AddrTypeParcel = 32, /**< Parcel address. */ AddrTypePostal = 64, /**< Postal address. */ AddrTypeDom = 128, /**< Domestic(?) address. */ AddrTypeIntl = 256, /**< International(?) address. */ AddrTypeVoice = 512, /**< Voice number. */ AddrTypeFax = 1024, /**< Fax number. */ AddrTypePager = 2048, /**< Pager. */ AddrTypeMsg = 4096, /**< MSG(?) */ AddrTypeCell = 8192, /**< Cell phone number. */ AddrTypeVideo = 16384, /**< Video chat(?). */ AddrTypeBbs = 32768, /**< BBS. */ AddrTypeModem = 65536, /**< Modem. */ AddrTypeIsdn = 131072, /**< ISDN. */ AddrTypePcs = 262144 /**< PCS. */ }; /** * A person's full name. */ struct Name { std::string family; /**< Family name. */ std::string given; /**< Given name. */ std::string middle; /**< Middle name. */ std::string prefix; /**< Name prefix. */ std::string suffix; /**< Name suffix. */ }; /** * Classifies the VCard. */ enum VCardClassification { ClassNone = 0, /**< Not classified. */ ClassPublic = 1, /**< Public. */ ClassPrivate = 2, /**< Private. */ ClassConfidential = 4 /**< Confidential. */ }; /** * Describes an email field. */ struct Email { std::string userid; /**< Email address. */ bool home; /**< Whether this is a personal address. */ bool work; /**< Whether this is a work address. */ bool internet; /**< Whether this is an internet address(?). */ bool pref; /**< Whether this is the preferred address. */ bool x400; /**< Whether this is an X.400 address. */ }; /** * A list of email fields. */ typedef std::list EmailList; /** * Describes a telephone number entry. */ struct Telephone { std::string number; /**< The phone number. */ bool home; /**< Whether this is a personal number. */ bool work; /**< Whether this is a work number. */ bool voice; /**< Whether this is a voice number. */ bool fax; /**< Whether this is a fax number. */ bool pager; /**< Whether this is a pager. */ bool msg; /**< MSG(?) */ bool cell; /**< Whether this is a cell phone. */ bool video; /**< Whether this is a video chat(?). */ bool bbs; /**< Whether this is a BBS. */ bool modem; /**< Whether this is a modem. */ bool isdn; /**< Whether this is a ISDN line(?) */ bool pcs; /**< PCS(?) */ bool pref; /**< Whether this is the preferred number. */ }; /** * A list of telephone entries. */ typedef std::list TelephoneList; /** * Describes an address entry. */ struct Address { std::string pobox; /**< Pobox. */ std::string extadd; /**< Extended address. */ std::string street; /**< Street. */ std::string locality; /**< Locality. */ std::string region; /**< Region. */ std::string pcode; /**< Postal code. */ std::string ctry; /**< Country. */ bool home; /**< Whether this is a personal address. */ bool work; /**< Whether this is a work address. */ bool postal; /**< Whether this is a postal address(?). */ bool parcel; /**< Whether this is a arcel address(?). */ bool pref; /**< Whether this is the preferred address. */ bool dom; /**< Whether this is a domestic(?) address. */ bool intl; /**< Whether this is an international(?) address. */ }; /** * Describes an address label. */ struct Label { StringList lines; /**< A list of lines. */ bool home; /**< Whether this is a personal address. */ bool work; /**< Whether this is a work address. */ bool postal; /**< Whether this is a postal address(?). */ bool parcel; /**< Whether this is a arcel address(?). */ bool pref; /**< Whether this is the preferred address. */ bool dom; /**< Whether this is a domestic(?) address. */ bool intl; /**< Whether this is an international(?) address. */ }; /** * Describes geo information. */ struct Geo { std::string latitude; /**< Longitude. */ std::string longitude; /**< Latitude. */ }; /** * Describes organization information. */ struct Org { std::string name; /**< The organizations name. */ StringList units; /**< A list of units in the organization * (the VCard's owner belongs to?). */ }; /** * Describes photo/logo information. */ struct Photo { std::string extval; /**< The photo is not stored inside the VCard. This is a hint (URL?) * where to look for it. */ std::string binval; /**< This is the photo (binary). */ std::string type; /**< This is a hint at the mime-type. May be forged! */ }; /** * A list of address entries. */ typedef std::list
AddressList; /** * A list of address labels. */ typedef std::list