Classified ads
Public Member Functions | Public Attributes | List of all members
Profile Class Reference

Carrier-class for user-profile data. More...

#include <profile.h>

Inheritance diagram for Profile:
Inheritance graph
[legend]
Collaboration diagram for Profile:
Collaboration graph
[legend]

Public Member Functions

 Profile (const Hash &aHash)
 
 ~Profile ()
 
QString displayName () const
 
QByteArray asJSon (const MController &aController) const
 
QVariant asQVariant (const MController &aController) const
 
bool setFromQVariant (const QVariantMap &aJSonAsQVariant, const MController &aController, bool aOmitImage=false)
 
bool fromJSon (const QByteArray &aJSonBytes, const MController &aController, bool aOmitImage=false)
 

Public Attributes

const Hash iFingerPrint
 
QString iNickName
 
QString iGreetingText
 
QString iFirstName
 
QString iFamilyName
 
QString iCityCountry
 
QString iBTCAddress
 
QString iStateOfTheWorld
 
bool iIsPrivate
 
quint32 iTimeOfPublish
 
QList< HashiProfileReaders
 
QImage iProfilePicture
 
QList< HashiSharedFiles
 
NodeiNodeOfProfile
 
QList< HashiTrustList
 

Detailed Description

Carrier-class for user-profile data.

Instances of this class are stored and retrieved using ProfileModel.

Constructor & Destructor Documentation

Profile::Profile ( const Hash aHash)

constructor

Profile::~Profile ( )

destructor

Member Function Documentation

QByteArray Profile::asJSon ( const MController aController) const

returns profile data as JSon stream

QVariant Profile::asQVariant ( const MController aController) const

Method for getting profile as JSon / QVariant

QString Profile::displayName ( ) const

method for string that is shown to user about the profile. displays nickname or real name etc. or hash fingerprint if no other data avail. the string returned by this method must be no longer than 160 bytes in utf-8. some chinese glyphs take up to 4 bytes so lets here limit max-len to 40 characters.

Returns
string to display to user
bool Profile::fromJSon ( const QByteArray &  aJSonBytes,
const MController aController,
bool  aOmitImage = false 
)

parses json into members

Parameters
aJSonBytesis json text supposedly containing the profile data
aControllerapplication controller
aOmitImageif set to true, possible image will not be loaded from data ; in cases where we know that we'll need only subset of information and no image, we can skip this costly operation
bool Profile::setFromQVariant ( const QVariantMap &  aJSonAsQVariant,
const MController aController,
bool  aOmitImage = false 
)

reverse of asQVariant()

Parameters
aJSonAsQVariantis qvariant supposedly containing the profile data
aControllerapplication controller
aOmitImageif set to true, possible image will not be loaded from data ; in cases where we know that we'll need only subset of information and no image, we can skip this costly operation
Returns
true if QVariant looked like profile

Member Data Documentation

QString Profile::iBTCAddress

payment addr

QString Profile::iCityCountry

location of residence

QString Profile::iFamilyName

family name

const Hash Profile::iFingerPrint

profile encryption key fingerprint

QString Profile::iFirstName

given name

QString Profile::iGreetingText

short hello-world by user

bool Profile::iIsPrivate

if set to true, profile is published encrypted

QString Profile::iNickName

nickname selected by user

Node* Profile::iNodeOfProfile

physical contact addr of this profile

QImage Profile::iProfilePicture

If V. Lenin is too fine for you

QList<Hash> Profile::iProfileReaders

in case of private profile, list of reader encryption key fingerprints

QList<Hash> Profile::iSharedFiles

Fingerprints of files shared

QString Profile::iStateOfTheWorld

State of the world as explained by user..

quint32 Profile::iTimeOfPublish

seconds since 1-jan-1970

QList<Hash> Profile::iTrustList

Fingerprints of trusted profiles


The documentation for this class was generated from the following file: