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::Profile ( const Hash aHash)

constructor

◆ ~Profile()

Profile::~Profile ( )

destructor

Member Function Documentation

◆ asJSon()

QByteArray Profile::asJSon ( const MController aController) const

returns profile data as JSon stream

◆ asQVariant()

QVariant Profile::asQVariant ( const MController aController) const

Method for getting profile as JSon / QVariant

◆ displayName()

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

◆ fromJSon()

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

◆ setFromQVariant()

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

◆ iBTCAddress

QString Profile::iBTCAddress

payment addr

◆ iCityCountry

QString Profile::iCityCountry

location of residence

◆ iFamilyName

QString Profile::iFamilyName

family name

◆ iFingerPrint

const Hash Profile::iFingerPrint

profile encryption key fingerprint

◆ iFirstName

QString Profile::iFirstName

given name

◆ iGreetingText

QString Profile::iGreetingText

short hello-world by user

◆ iIsPrivate

bool Profile::iIsPrivate

if set to true, profile is published encrypted

◆ iNickName

QString Profile::iNickName

nickname selected by user

◆ iNodeOfProfile

Node* Profile::iNodeOfProfile

physical contact addr of this profile

◆ iProfilePicture

QImage Profile::iProfilePicture

If V. Lenin is too fine for you

◆ iProfileReaders

QList<Hash> Profile::iProfileReaders

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

◆ iSharedFiles

QList<Hash> Profile::iSharedFiles

Fingerprints of files shared

◆ iStateOfTheWorld

QString Profile::iStateOfTheWorld

State of the world as explained by user..

◆ iTimeOfPublish

quint32 Profile::iTimeOfPublish

seconds since 1-jan-1970

◆ iTrustList

QList<Hash> Profile::iTrustList

Fingerprints of trusted profiles


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