Friend Class Reference

A class for friend information storage. More...

#include <friend.h>

List of all members.

Public Member Functions

 Friend ()
 An empty constructor.
 Friend (const Friend &)
 A copy constructor.
 ~Friend ()
 A destructor.
void setFirstName (const QString &val)
 Sets first name of a friend.
QString firstName () const
 Gets first name of a friend.
void setNickName (const QString &val)
 Sets nick name of a friend.
QString nickName () const
 Gets nick name of a friend.
void setLastName (const QString &val)
 Sets last name of a friend.
QString lastName () const
 Gets last name of a friend.
void setOnline (const bool val)
 Sets status of a friend.
bool online () const
 Gets status of a friend.
void setGender (const QString &val)
 Sets gender of a friend.
QString gender () const
 Gets gender of a friend.
void setBirthday (const QString &val)
 Sets birthday of a friend.
QString birthday () const
 Gets birthday of a friend.
void setMobilePhone (const QString &val)
 Sets mobile phone number of a friend.
QString mobilePhone () const
 Gets mobile phone number of a friend.
void setHomePhone (const QString &val)
 Sets home phone number of a friend.
QString homePhone () const
 Gets home phone number of a friend.
void setCity (const QString &val)
 Sets city of a friend.
QString city () const
 Gets city of a friend.
void setCountry (const QString &val)
 Sets country of a friend.
QString country () const
 Gets country of a friend.
void setIcon_url (const QString &val)
 Sets URL of friend's avatar.
QString icon_url () const
 Gets URL of friend's avatar.
void setIcon (const QString &icon)
 Sets path to friend's avatar.
QString icon () const
 Gets path to friend's avatar.
bool isMetaProfile () const
 Checks that profile is a meta profile (contains more than one record).
bool hasFullProfile () const
 Checks that full profile is downloaded.
FriendList getProfileList () const
 Gets list of profiles from meta profile.
void addProfile (const Friend &fr, const bool isMainProfile)
 Add profile for friend.
bool hasProfile (const Friend &fr) const
 Check existence of profile for friend.
bool hasProfile (const QString &serviceId, const QString &ownerId) const
 Check existence of profile for friend.
QString name () const
 Gets friend name as a combination of first, last and nick names.
AlbumList getAlbumList () const
 Loads album list from cache file.
Friendoperator= (const Friend &)
 Overloads assignment operator for Friend classes.
bool operator< (const Friend &fr1) const
 compare names of two friends.
bool operator== (const Friend &fr1) const
 compare names of two friends.
void storeData ()
 Stores friend data to local cache.
bool isEmpty () const

Static Public Member Functions

static FriendList mergeLists (FriendList src1, FriendList src2)
static void setAlbumList (const AlbumList &list, const QString &accountId, const QString &friendId)
 Sets album list and store it to cache file.
static QDomElement toQDomElement (QDomDocument &doc, const Friend &src, const bool addOptionalInfo)
 Store friends data to XML format.
static Friend fromQDomElement (const QDomElement &fr, const QString &accountId, const QString &serviceId)
 Loads friend from XML struct.
static void copyData (Friend *dst, const Friend *src)
 Copies data from one Friend class to another.
static Friend loadData (const QString &serviceId, const QString &accountId, const QString &ownerId)
 Loads friend data from local cache.

Public Attributes

QString ownerId
QString accountId
QString serviceId

Detailed Description

A class for friend information storage.


Constructor & Destructor Documentation

Friend::Friend ( const Friend src  ) 

A copy constructor.

Creates an instance of Friend class based on another Friend.

Parameters:
instance of Friend class

Member Function Documentation

void Friend::addProfile ( const Friend fr,
const bool  isMainProfile 
)

Add profile for friend.

Parameters:
fr new profile for friend
isMainProfile true if this profile is main, otherwise - false
QString Friend::birthday (  )  const

Gets birthday of a friend.

Returns:
birthday of a friend
QString Friend::city (  )  const

Gets city of a friend.

Returns:
city of a friend
void Friend::copyData ( Friend dst,
const Friend src 
) [static]

Copies data from one Friend class to another.

Parameters:
dst destination Friend class
src source Friend instance
QString Friend::country (  )  const

Gets country of a friend.

Returns:
country of a friend
QString Friend::firstName (  )  const

Gets first name of a friend.

Returns:
first name of a friend
Friend Friend::fromQDomElement ( const QDomElement &  fr,
const QString &  accountId,
const QString &  serviceId 
) [static]

Loads friend from XML struct.

Parameters:
fr XML struct with friend data
accountId ID of account to which friend belongs
serviceId ID of service
Returns:
Friend
QString Friend::gender (  )  const

Gets gender of a friend.

Returns:
gender of a friend
AlbumList Friend::getAlbumList (  )  const

Loads album list from cache file.

Returns:
album list
FriendList Friend::getProfileList (  )  const

Gets list of profiles from meta profile.

Returns:
list of profiles from meta profile
bool Friend::hasFullProfile (  )  const

Checks that full profile is downloaded.

Returns:
bool true if full profile downloaded, otherwise - false
bool Friend::hasProfile ( const QString &  serviceId,
const QString &  ownerId 
) const

Check existence of profile for friend.

Parameters:
serviceId ID of service
ownerId ID of friend
Returns:
bool true if friend has profile, otherwise - false
bool Friend::hasProfile ( const Friend fr  )  const

Check existence of profile for friend.

Parameters:
fr friend source profile
Returns:
bool true if friend has profile, otherwise - false
QString Friend::homePhone (  )  const

Gets home phone number of a friend.

Returns:
home phone number of a friend
QString Friend::icon (  )  const

Gets path to friend's avatar.

Returns:
path to friend's avatar
QString Friend::icon_url (  )  const

Gets URL of friend's avatar.

Returns:
URL of friend's avatar
bool Friend::isMetaProfile (  )  const

Checks that profile is a meta profile (contains more than one record).

Returns:
bool true if profile contains more than one record, otherwise - false
QString Friend::lastName (  )  const

Gets last name of a friend.

Returns:
last name of a friend
Friend Friend::loadData ( const QString &  serviceId,
const QString &  accountId,
const QString &  ownerId 
) [static]

Loads friend data from local cache.

Parameters:
serviceId ID of service
accountId ID of account to which friend belongs
ownerId ID of friend
Returns:
new instance of Friend class
FriendList Friend::mergeLists ( FriendList  src1,
FriendList  src2 
) [static]

Merges two lists, creates metaprofiles for duplicate items.

Parameters:
src1 The first list
src2 The second list
Returns:
New friend list
QString Friend::mobilePhone (  )  const

Gets mobile phone number of a friend.

Returns:
mobile phone number of a friend
QString Friend::name (  )  const

Gets friend name as a combination of first, last and nick names.

Returns:
friend name as a combination of first, last and nick names
QString Friend::nickName (  )  const

Gets nick name of a friend.

Returns:
nick name of a friend
bool Friend::online (  )  const

Gets status of a friend.

Returns:
bool true if friend is online, otherwise false
Friend & Friend::operator= ( const Friend src  ) 

Overloads assignment operator for Friend classes.

Parameters:
Friend source Friend instance
void Friend::setAlbumList ( const AlbumList list,
const QString &  accountId,
const QString &  friendId 
) [static]

Sets album list and store it to cache file.

Parameters:
list album list
accountId ID of account to which friend belongs
friendId ID of album master friend
void Friend::setBirthday ( const QString &  val  ) 

Sets birthday of a friend.

Parameters:
val birthday of a friend
void Friend::setCity ( const QString &  val  ) 

Sets city of a friend.

Parameters:
val city of a friend
void Friend::setCountry ( const QString &  val  ) 

Sets country of a friend.

Parameters:
val country of a friend
void Friend::setFirstName ( const QString &  val  ) 

Sets first name of a friend.

Parameters:
val first name of a friend
void Friend::setGender ( const QString &  val  ) 

Sets gender of a friend.

Parameters:
val gender of a friend
void Friend::setHomePhone ( const QString &  val  ) 

Sets home phone number of a friend.

Parameters:
val home phone number of a friend
void Friend::setIcon ( const QString &  icon  ) 

Sets path to friend's avatar.

Parameters:
icon path to friend's avatar
void Friend::setIcon_url ( const QString &  val  ) 

Sets URL of friend's avatar.

Parameters:
val URL of a friend's avatar
void Friend::setLastName ( const QString &  val  ) 

Sets last name of a friend.

Parameters:
val last name of a friend
void Friend::setMobilePhone ( const QString &  val  ) 

Sets mobile phone number of a friend.

Parameters:
val mobile phone number of a friend
void Friend::setNickName ( const QString &  val  ) 

Sets nick name of a friend.

Parameters:
val nick of a friend
void Friend::setOnline ( const bool  val  ) 

Sets status of a friend.

Parameters:
val status of a friend
QDomElement Friend::toQDomElement ( QDomDocument &  doc,
const Friend src,
const bool  addOptionalInfo 
) [static]

Store friends data to XML format.

Parameters:
doc root XML document
src source Friend entity
addOptionalInfo true if proceed XML file should contain additional fields; otherwise - false
Returns:
XML structure

Member Data Documentation

a name of account for this friend (not stored in cache)

QString Friend::ownerId

friend ID from service

ID of service


The documentation for this class was generated from the following files:
Generated on Tue Jul 19 11:01:25 2011 for mysocials-core by  doxygen 1.6.3