qTox  Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
Public Slots | Signals | Public Member Functions | Private Attributes | List of all members
Friend Class Reference

#include <friend.h>

Inheritance diagram for Friend:
Inheritance graph
Collaboration diagram for Friend:
Collaboration graph

Public Slots

void onNegotiationComplete ()
 

Signals

void nameChanged (const ToxPk &friendId, const QString &name)
 
void aliasChanged (const ToxPk &friendId, QString alias)
 
void statusChanged (const ToxPk &friendId, Status::Status status)
 
void onlineOfflineChanged (const ToxPk &friendId, bool isOnline)
 
void statusMessageChanged (const ToxPk &friendId, const QString &message)
 
void extensionSupportChanged (ExtensionSet extensions)
 
void loadChatHistory ()
 
- Signals inherited from Contact
void displayedNameChanged (const QString &newName)
 

Public Member Functions

 Friend (uint32_t friendId, const ToxPk &friendPk, const QString &userAlias={}, const QString &userName={})
 
 Friend (const Friend &other)=delete
 
Friendoperator= (const Friend &other)=delete
 
void setName (const QString &name) override
 Friend::setName sets a new username for the friend. More...
 
void setAlias (const QString &name)
 Friend::setAlias sets the alias for the friend. More...
 
QString getDisplayedName () const override
 Friend::getDisplayedName Gets the name that should be displayed for a user. More...
 
bool hasAlias () const
 
QString getUserName () const
 
void setStatusMessage (const QString &message)
 
QString getStatusMessage () const
 
void setEventFlag (bool f) override
 
bool getEventFlag () const override
 
const ToxPkgetPublicKey () const
 
uint32_t getId () const override
 
const ContactIdgetPersistentId () const override
 
void finishNegotiation ()
 
void setStatus (Status::Status s)
 
Status::Status getStatus () const
 
void setExtendedMessageSupport (bool supported)
 
ExtensionSet getSupportedExtensions () const
 
- Public Member Functions inherited from Contact
virtual ~Contact ()=0
 

Private Attributes

QString userName
 
QString userAlias
 
QString statusMessage
 
ToxPk friendPk
 
uint32_t friendId
 
bool hasNewEvents
 
Status::Status friendStatus
 
bool isNegotiating
 
ExtensionSet supportedExtensions
 

Detailed Description

Definition at line 31 of file friend.h.

Constructor & Destructor Documentation

◆ Friend() [1/2]

Friend::Friend ( uint32_t  friendId,
const ToxPk friendPk,
const QString &  userAlias = {},
const QString &  userName = {} 
)

Definition at line 29 of file friend.cpp.

◆ Friend() [2/2]

Friend::Friend ( const Friend other)
delete

Member Function Documentation

◆ aliasChanged

void Friend::aliasChanged ( const ToxPk friendId,
QString  alias 
)
signal
Here is the caller graph for this function:

◆ extensionSupportChanged

void Friend::extensionSupportChanged ( ExtensionSet  extensions)
signal
Here is the caller graph for this function:

◆ finishNegotiation()

void Friend::finishNegotiation ( )

◆ getDisplayedName()

QString Friend::getDisplayedName ( ) const
overridevirtual

Friend::getDisplayedName Gets the name that should be displayed for a user.

Returns
a QString containing either alias, username or public key
Note
This function and corresponding signal should be preferred over getting the name or alias directly.

Implements Contact.

Definition at line 112 of file friend.cpp.

Here is the caller graph for this function:

◆ getEventFlag()

bool Friend::getEventFlag ( ) const
overridevirtual

Implements Contact.

Definition at line 151 of file friend.cpp.

Here is the caller graph for this function:

◆ getId()

uint32_t Friend::getId ( ) const
overridevirtual

Implements Contact.

Definition at line 136 of file friend.cpp.

Here is the caller graph for this function:

◆ getPersistentId()

const ContactId & Friend::getPersistentId ( ) const
overridevirtual

Implements Contact.

Definition at line 141 of file friend.cpp.

◆ getPublicKey()

const ToxPk & Friend::getPublicKey ( ) const

Definition at line 131 of file friend.cpp.

◆ getStatus()

Status::Status Friend::getStatus ( ) const

Definition at line 190 of file friend.cpp.

Here is the caller graph for this function:

◆ getStatusMessage()

QString Friend::getStatusMessage ( ) const

Definition at line 101 of file friend.cpp.

Here is the caller graph for this function:

◆ getSupportedExtensions()

ExtensionSet Friend::getSupportedExtensions ( ) const

Definition at line 206 of file friend.cpp.

Here is the caller graph for this function:

◆ getUserName()

QString Friend::getUserName ( ) const

Definition at line 126 of file friend.cpp.

Here is the caller graph for this function:

◆ hasAlias()

bool Friend::hasAlias ( ) const

Definition at line 121 of file friend.cpp.

◆ loadChatHistory

void Friend::loadChatHistory ( )
signal

◆ nameChanged

void Friend::nameChanged ( const ToxPk friendId,
const QString &  name 
)
signal
Here is the caller graph for this function:

◆ onlineOfflineChanged

void Friend::onlineOfflineChanged ( const ToxPk friendId,
bool  isOnline 
)
signal
Here is the caller graph for this function:

◆ onNegotiationComplete

void Friend::onNegotiationComplete ( )
slot

Definition at line 211 of file friend.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

Friend& Friend::operator= ( const Friend other)
delete

◆ setAlias()

void Friend::setAlias ( const QString &  alias)

Friend::setAlias sets the alias for the friend.

Parameters
aliasnew alias, removes it if set to an empty string

Definition at line 76 of file friend.cpp.

Here is the call graph for this function:

◆ setEventFlag()

void Friend::setEventFlag ( bool  f)
overridevirtual

Implements Contact.

Definition at line 146 of file friend.cpp.

Here is the caller graph for this function:

◆ setExtendedMessageSupport()

void Friend::setExtendedMessageSupport ( bool  supported)

Definition at line 195 of file friend.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setName()

void Friend::setName ( const QString &  _name)
overridevirtual

Friend::setName sets a new username for the friend.

Parameters
_namenew username, sets the public key if _name is empty

Implements Contact.

Definition at line 47 of file friend.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setStatus()

void Friend::setStatus ( Status::Status  s)

Definition at line 156 of file friend.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setStatusMessage()

void Friend::setStatusMessage ( const QString &  message)

Definition at line 93 of file friend.cpp.

Here is the caller graph for this function:

◆ statusChanged

void Friend::statusChanged ( const ToxPk friendId,
Status::Status  status 
)
signal
Here is the caller graph for this function:

◆ statusMessageChanged

void Friend::statusMessageChanged ( const ToxPk friendId,
const QString &  message 
)
signal
Here is the caller graph for this function:

Member Data Documentation

◆ friendId

uint32_t Friend::friendId
private

Definition at line 77 of file friend.h.

◆ friendPk

ToxPk Friend::friendPk
private

Definition at line 76 of file friend.h.

◆ friendStatus

Status::Status Friend::friendStatus
private

Definition at line 79 of file friend.h.

◆ hasNewEvents

bool Friend::hasNewEvents
private

Definition at line 78 of file friend.h.

◆ isNegotiating

bool Friend::isNegotiating
private

Definition at line 80 of file friend.h.

◆ statusMessage

QString Friend::statusMessage
private

Definition at line 75 of file friend.h.

◆ supportedExtensions

ExtensionSet Friend::supportedExtensions
private

Definition at line 81 of file friend.h.

◆ userAlias

QString Friend::userAlias
private

Definition at line 74 of file friend.h.

◆ userName

QString Friend::userName
private

Definition at line 73 of file friend.h.


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