mysocials-core 1.0
Public Member Functions | Static Public Member Functions | Public Attributes

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 isFullProfile () 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.
void storeData ()
 Stores friend data to local cache.

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:
instanceof Friend class

Member Function Documentation

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

Add profile for friend.

Parameters:
frnew profile for friend
isMainProfiletrue 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:
dstdestination Friend class
srcsource 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:
frXML struct with friend data
accountIdID of account to which friend belongs
serviceIdID 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::hasProfile ( const Friend fr) const

Check existence of profile for friend.

Parameters:
frfriend source profile
Returns:
bool true if friend has profile, otherwise - false
bool Friend::hasProfile ( const QString &  serviceId,
const QString &  ownerId 
) const

Check existence of profile for friend.

Parameters:
serviceIdID of service
ownerIdID of friend
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::isFullProfile ( ) const

Checks that full profile is downloaded.

Returns:
bool true if full profile downloaded, otherwise - false
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:
serviceIdID of service
accountIdID of account to which friend belongs
ownerIdID 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:
src1The first list
src2The 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:
Friendsource 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:
listalbum list
accountIdID of account to which friend belongs
friendIdID of album master friend
void Friend::setBirthday ( const QString &  val)

Sets birthday of a friend.

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

Sets city of a friend.

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

Sets country of a friend.

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

Sets first name of a friend.

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

Sets gender of a friend.

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

Sets home phone number of a friend.

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

Sets path to friend's avatar.

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

Sets URL of friend's avatar.

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

Sets last name of a friend.

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

Sets mobile phone number of a friend.

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

Sets nick name of a friend.

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

Sets status of a friend.

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

Store friends data to XML format.

Parameters:
docroot XML document
srcsource Friend entity
addOptionalInfotrue 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: