Contact Class Reference

It represents a contact of Bamboo Messenger. More...

#include <contact.h>

List of all members.

Public Types

enum  Status { Offline, Online, Busy, Away }
 Enumeration used to describe contact state. More...

Public Member Functions

 Contact ()
 Default constructor.
 Contact (int ID, const std::string &address, const std::string &pseudo, const Status status)
 Constructor.
 ~Contact ()
 Destructor.
const std::string & getAdresse () const
 Returns contact mail address.
void setAdresse (const std::string &address)
 Sets contact mail address.
void setID (const int iID)
 Sets contact ID.
int getID () const
 Returns contact ID.
const std::string & getPseudo () const
 Returns contact nickname.
void setPseudo (const std::string &pseudo)
 Sets contact nickname.
const Status getStatus () const
 Returns contact status.
void setStatus (const Status status)
 Sets contact status.
std::string toString () const
 Returns a string representation of the answer.
bool operator== (const Contact &contact) const
 Compares two contacts.
bool operator>= (const Contact &contact) const
 Compares two contacts.
bool operator> (const Contact &contact) const
 Compares two contacts.
bool operator< (const Contact &contact) const
 Compares two contacts.
bool operator<= (const Contact &contact) const
 Compares two contacts.

Static Public Member Functions

static Status getStatus (const int statusID)
 Returns Status corresponding to int.
static std::string getStatusAsString (const Status status)
 Returns a string representation of the status.

Static Public Attributes

static const char * ROOT_NODE = "contact"
 Name of the root node representing a Contact.
static const char * CONTACTID_NODE = "contact-id"
 Name of the node for contact id member.
static const char * USERNAME_NODE = "username"
 Name of the node for username member.
static const char * ADDRESS_NODE = "address"
 Name of the node for address member.
static const char * STATE_NODE = "state"
 Name of the node for status member.


Detailed Description

It represents a contact of Bamboo Messenger.

Author:
Sylvain Archenault <sylvain.archenault@laposte.net>

Yves Houpert <yves.houpert@insa-rouen.fr>


Member Enumeration Documentation

enum Contact::Status
 

Enumeration used to describe contact state.

Enumerator:
Offline  Offline state
Online  Online state
Busy  Busy state
Away  Away state


Constructor & Destructor Documentation

Contact::Contact int  ID,
const std::string &  address,
const std::string &  pseudo,
const Status  status
 

Constructor.

 

Parameters:
ID contact ID.
address contact mail adress.
pseudo Contact nickname.


Member Function Documentation

const std::string& Contact::getAdresse  )  const [inline]
 

Returns contact mail address.

Returns:
Contact mail address.

int Contact::getID  )  const [inline]
 

Returns contact ID.

Returns:
Contact ID

const std::string& Contact::getPseudo  )  const [inline]
 

Returns contact nickname.

Returns:
Contact nickname

Contact::Status Contact::getStatus const int  statusID  )  [static]
 

Returns Status corresponding to int.

Parameters:
statusID Int we want the matching status.
Returns:
Status corresponding to the int.

const Status Contact::getStatus  )  const [inline]
 

Returns contact status.

Returns:
Contact status.

std::string Contact::getStatusAsString const Status  status  )  [static]
 

Returns a string representation of the status.

Parameters:
status Status to get string representation.
Returns:
String representation.

bool Contact::operator< const Contact contact  )  const
 

Compares two contacts.

The comparaison is base on contact ID.

Parameters:
contact Contact to compare with.
Returns:
true if this ID is less than the contact ID, false otherwise.

bool Contact::operator<= const Contact contact  )  const
 

Compares two contacts.

The comparaison is base on contact ID.

Parameters:
contact Contact to compare with.
Returns:
true if this ID is less or equal than the contact ID, false otherwise.

bool Contact::operator== const Contact contact  )  const
 

Compares two contacts.

The comparaison is base on contact ID.

Parameters:
contact Contact to compare with.
Returns:
true if IDs are equals, false otherwise.

bool Contact::operator> const Contact contact  )  const
 

Compares two contacts.

The comparaison is base on contact ID.

Parameters:
contact Contact to compare with.
Returns:
true if this ID is greater than the contact ID, false otherwise.

bool Contact::operator>= const Contact contact  )  const
 

Compares two contacts.

The comparaison is base on contact ID.

Parameters:
contact Contact to compare with.
Returns:
true if this ID is greater or equal than the contact ID, false otherwise.

void Contact::setAdresse const std::string &  address  )  [inline]
 

Sets contact mail address.

Parameters:
address New contact mail address

void Contact::setID const int  iID  )  [inline]
 

Sets contact ID.

Parameters:
iID Contact ID.

void Contact::setPseudo const std::string &  pseudo  )  [inline]
 

Sets contact nickname.

Parameters:
pseudo Contact nickname

void Contact::setStatus const Status  status  )  [inline]
 

Sets contact status.

Parameters:
status New contact status.

std::string Contact::toString  )  const
 

Returns a string representation of the answer.

Returns:
String representation.


The documentation for this class was generated from the following files:
Generated on Fri May 19 12:15:55 2006 for Bamboo Ch@t by  doxygen 1.4.6