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

#include <core.h>

Inheritance diagram for Core:
Inheritance graph
Collaboration diagram for Core:
Collaboration graph

Classes

struct  ToxDeleter
 

Public Types

enum  ToxCoreErrors { ToxCoreErrors::BAD_PROXY, ToxCoreErrors::INVALID_SAVE, ToxCoreErrors::FAILED_TO_START, ToxCoreErrors::ERROR_ALLOC }
 

Public Slots

void start ()
 Starts toxcore and it's event loop, can be called from any thread. More...
 
QByteArray getToxSaveData ()
 Returns the unencrypted tox save data. More...
 
void acceptFriendRequest (const ToxPk &friendPk)
 
void requestFriendship (const ToxId &friendAddress, const QString &message)
 
void groupInviteFriend (uint32_t friendId, int groupId)
 
int createGroup (uint8_t type=TOX_CONFERENCE_TYPE_AV)
 
void removeFriend (uint32_t friendId)
 
void removeGroup (int groupId)
 
void setStatus (Status::Status status)
 
void setUsername (const QString &username)
 
void setStatusMessage (const QString &message)
 
bool sendMessage (uint32_t friendId, const QString &message, ReceiptNum &receipt) override
 
void sendGroupMessage (int groupId, const QString &message) override
 
void sendGroupAction (int groupId, const QString &message) override
 
void changeGroupTitle (int groupId, const QString &title)
 
bool sendAction (uint32_t friendId, const QString &action, ReceiptNum &receipt) override
 
void sendTyping (uint32_t friendId, bool typing)
 
void setNospam (uint32_t nospam)
 Sets the NoSpam value to prevent friend request spam. More...
 

Signals

void connected ()
 
void disconnected ()
 
void friendRequestReceived (const ToxPk &friendPk, const QString &message)
 
void friendAvatarChanged (const ToxPk &friendPk, const QByteArray &pic)
 
void friendAvatarRemoved (const ToxPk &friendPk)
 
void requestSent (const ToxPk &friendPk, const QString &message)
 
void failedToAddFriend (const ToxPk &friendPk, const QString &errorInfo=QString())
 
void usernameSet (const QString &username)
 
void statusMessageSet (const QString &message)
 
void statusSet (Status::Status status)
 
void idSet (const ToxId &id)
 
void failedToSetUsername (const QString &username)
 
void failedToSetStatusMessage (const QString &message)
 
void failedToSetStatus (Status::Status status)
 
void failedToSetTyping (bool typing)
 
void saveRequest ()
 
void fileAvatarOfferReceived (uint32_t friendId, uint32_t fileId, const QByteArray &avatarHash, uint64_t filesize)
 
void friendMessageReceived (uint32_t friendId, const QString &message, bool isAction)
 
void friendAdded (uint32_t friendId, const ToxPk &friendPk)
 
void friendStatusChanged (uint32_t friendId, Status::Status status)
 
void friendStatusMessageChanged (uint32_t friendId, const QString &message)
 
void friendUsernameChanged (uint32_t friendId, const QString &username)
 
void friendTypingChanged (uint32_t friendId, bool isTyping)
 
void friendRemoved (uint32_t friendId)
 
void friendLastSeenChanged (uint32_t friendId, const QDateTime &dateTime)
 
void emptyGroupCreated (int groupnumber, const GroupId groupId, const QString &title=QString())
 
void groupInviteReceived (const GroupInvite &inviteInfo)
 
void groupMessageReceived (int groupnumber, int peernumber, const QString &message, bool isAction)
 
void groupNamelistChanged (int groupnumber, int peernumber, uint8_t change)
 
void groupPeerlistChanged (int groupnumber)
 
void groupPeerNameChanged (int groupnumber, const ToxPk &peerPk, const QString &newName)
 
void groupTitleChanged (int groupnumber, const QString &author, const QString &title)
 
void groupPeerAudioPlaying (int groupnumber, ToxPk peerPk)
 
void groupSentFailed (int groupId)
 
void groupJoined (int groupnumber, GroupId groupId)
 
void actionSentResult (uint32_t friendId, const QString &action, int success)
 
void receiptRecieved (int friedId, ReceiptNum receipt)
 
void failedToRemoveFriend (uint32_t friendId)
 

Public Member Functions

const CoreAVgetAv () const
 
CoreAVgetAv ()
 
void setAv (CoreAV *coreAv)
 
CoreFilegetCoreFile () const
 
Tox * getTox () const
 
CompatibleRecursiveMutex & getCoreLoopLock () const
 
const CoreExtgetExt () const
 
CoreExtgetExt ()
 
 ~Core ()
 
uint64_t getMaxMessageSize () const
 
QString getPeerName (const ToxPk &id) const
 
QVector< uint32_t > getFriendList () const
 Returns the list of friendIds in our friendlist, an empty list on error. More...
 
GroupId getGroupPersistentId (uint32_t groupNumber) const override
 
uint32_t getGroupNumberPeers (int groupId) const override
 Get number of peers in the conference. More...
 
QString getGroupPeerName (int groupId, int peerId) const override
 Get the name of a peer of a group. More...
 
ToxPk getGroupPeerPk (int groupId, int peerId) const override
 Get the public key of a peer of a group. More...
 
QStringList getGroupPeerNames (int groupId) const override
 Get the names of the peers of a group. More...
 
bool getGroupAvEnabled (int groupId) const override
 Check, that group has audio or video stream. More...
 
ToxPk getFriendPublicKey (uint32_t friendNumber) const
 Get the public key part of the ToxID only. More...
 
QString getFriendUsername (uint32_t friendNumber) const
 Get the username of a friend. More...
 
bool isFriendOnline (uint32_t friendId) const
 Checks if a friend is online. Unknown friends are considered offline. More...
 
bool hasFriendWithPublicKey (const ToxPk &publicKey) const
 Checks if we have a friend by public key. More...
 
uint32_t joinGroupchat (const GroupInvite &inviteInfo)
 Accept a groupchat invite. More...
 
void quitGroupChat (int groupId) const
 
QString getUsername () const override
 Returns our username, or an empty string on failure. More...
 
Status::Status getStatus () const
 Returns our user status. More...
 
QString getStatusMessage () const
 Returns our status message, or an empty string on failure. More...
 
ToxId getSelfId () const override
 Returns our Tox ID. More...
 
ToxPk getSelfPublicKey () const override
 Gets self public key. More...
 
QPair< QByteArray, QByteArray > getKeypair () const
 Returns our public and private keys. More...
 
void sendFile (uint32_t friendId, QString filename, QString filePath, long long filesize)
 
- Public Member Functions inherited from ICoreFriendMessageSender
 ICoreFriendMessageSender ()=default
 
virtual ~ICoreFriendMessageSender ()
 
 ICoreFriendMessageSender (const ICoreFriendMessageSender &)=default
 
ICoreFriendMessageSenderoperator= (const ICoreFriendMessageSender &)=default
 
 ICoreFriendMessageSender (ICoreFriendMessageSender &&)=default
 
ICoreFriendMessageSenderoperator= (ICoreFriendMessageSender &&)=default
 
virtual bool sendAction (uint32_t friendId, const QString &action, ReceiptNum &receipt)=0
 
virtual bool sendMessage (uint32_t friendId, const QString &message, ReceiptNum &receipt)=0
 
- Public Member Functions inherited from ICoreIdHandler
 ICoreIdHandler ()=default
 
virtual ~ICoreIdHandler ()
 
 ICoreIdHandler (const ICoreIdHandler &)=default
 
ICoreIdHandleroperator= (const ICoreIdHandler &)=default
 
 ICoreIdHandler (ICoreIdHandler &&)=default
 
ICoreIdHandleroperator= (ICoreIdHandler &&)=default
 
- Public Member Functions inherited from ICoreGroupMessageSender
 ICoreGroupMessageSender ()=default
 
virtual ~ICoreGroupMessageSender ()
 
 ICoreGroupMessageSender (const ICoreGroupMessageSender &)=default
 
ICoreGroupMessageSenderoperator= (const ICoreGroupMessageSender &)=default
 
 ICoreGroupMessageSender (ICoreGroupMessageSender &&)=default
 
ICoreGroupMessageSenderoperator= (ICoreGroupMessageSender &&)=default
 
virtual void sendGroupAction (int groupId, const QString &message)=0
 
virtual void sendGroupMessage (int groupId, const QString &message)=0
 
- Public Member Functions inherited from ICoreGroupQuery
 ICoreGroupQuery ()=default
 
virtual ~ICoreGroupQuery ()
 
 ICoreGroupQuery (const ICoreGroupQuery &)=default
 
ICoreGroupQueryoperator= (const ICoreGroupQuery &)=default
 
 ICoreGroupQuery (ICoreGroupQuery &&)=default
 
ICoreGroupQueryoperator= (ICoreGroupQuery &&)=default
 

Static Public Member Functions

static ToxCorePtr makeToxCore (const QByteArray &savedata, const ICoreSettings &settings, IBootstrapListGenerator &bootstrapNodes, ToxCoreErrors *err=nullptr)
 Factory method for the Core object. More...
 

Static Public Attributes

static const QString TOX_EXT = ".tox"
 

Private Types

using ToxPtr = std::unique_ptr< Tox, ToxDeleter >
 

Private Slots

void process ()
 Processes toxcore events and ensure we stay connected, called by its own timer. More...
 
void onStarted ()
 

Private Member Functions

 Core (QThread *coreThread, IBootstrapListGenerator &_bootstrapNodes, const ICoreSettings &settings)
 
void sendGroupMessageWithType (int groupId, const QString &message, Tox_Message_Type type)
 
bool sendMessageWithType (uint32_t friendId, const QString &message, Tox_Message_Type type, ReceiptNum &receipt)
 
bool checkConnection ()
 
void makeTox (QByteArray savedata, ICoreSettings *s)
 
void loadFriends ()
 
void loadGroups ()
 
void bootstrapDht ()
 Connects us to the Tox network. More...
 
void checkLastOnline (uint32_t friendId)
 
QString getFriendRequestErrorMessage (const ToxId &friendId, const QString &message) const
 Checks that sending friendship request is correct and returns error message accordingly. More...
 

Static Private Member Functions

static void onFriendRequest (Tox *tox, const uint8_t *cUserId, const uint8_t *cMessage, size_t cMessageSize, void *core)
 
static void onFriendMessage (Tox *tox, uint32_t friendId, Tox_Message_Type type, const uint8_t *cMessage, size_t cMessageSize, void *core)
 
static void onFriendNameChange (Tox *tox, uint32_t friendId, const uint8_t *cName, size_t cNameSize, void *core)
 
static void onFriendTypingChange (Tox *tox, uint32_t friendId, bool isTyping, void *core)
 
static void onStatusMessageChanged (Tox *tox, uint32_t friendId, const uint8_t *cMessage, size_t cMessageSize, void *core)
 
static void onUserStatusChanged (Tox *tox, uint32_t friendId, Tox_User_Status userstatus, void *core)
 
static void onConnectionStatusChanged (Tox *tox, uint32_t friendId, Tox_Connection status, void *vCore)
 
static void onGroupInvite (Tox *tox, uint32_t friendId, Tox_Conference_Type type, const uint8_t *cookie, size_t length, void *vCore)
 
static void onGroupMessage (Tox *tox, uint32_t groupId, uint32_t peerId, Tox_Message_Type type, const uint8_t *cMessage, size_t length, void *vCore)
 
static void onGroupPeerListChange (Tox *, uint32_t groupId, void *core)
 
static void onGroupPeerNameChange (Tox *, uint32_t groupId, uint32_t peerId, const uint8_t *name, size_t length, void *core)
 
static void onGroupTitleChange (Tox *tox, uint32_t groupId, uint32_t peerId, const uint8_t *cTitle, size_t length, void *vCore)
 
static void onLosslessPacket (Tox *tox, uint32_t friendId, const uint8_t *data, size_t length, void *core)
 Handling of custom lossless packets received by toxcore. Currently only used to forward toxext packets to CoreExt. More...
 
static void onReadReceiptCallback (Tox *tox, uint32_t friendId, uint32_t receipt, void *core)
 
static void registerCallbacks (Tox *tox)
 Registers all toxcore callbacks. More...
 

Private Attributes

ToxPtr tox
 
std::unique_ptr< CoreFilefile
 
CoreAVav = nullptr
 
std::unique_ptr< CoreExtext
 
QTimer * toxTimer = nullptr
 
CompatibleRecursiveMutex coreLoopLock
 
std::unique_ptr< QThread > coreThread
 
const IBootstrapListGeneratorbootstrapListGenerator
 
const ICoreSettingssettings
 
bool isConnected = false
 
int tolerance = CORE_DISCONNECT_TOLERANCE
 

Detailed Description

Definition at line 59 of file core.h.

Member Typedef Documentation

◆ ToxPtr

using Core::ToxPtr = std::unique_ptr<Tox, ToxDeleter>
private

Definition at line 263 of file core.h.

Member Enumeration Documentation

◆ ToxCoreErrors

enum Core::ToxCoreErrors
strong
Enumerator
BAD_PROXY 
INVALID_SAVE 
FAILED_TO_START 
ERROR_ALLOC 

Definition at line 67 of file core.h.

Constructor & Destructor Documentation

◆ ~Core()

Core::~Core ( )

Definition at line 499 of file core.cpp.

◆ Core()

Core::Core ( QThread *  coreThread,
IBootstrapListGenerator _bootstrapNodes,
const ICoreSettings settings 
)
private

Definition at line 486 of file core.cpp.

Here is the caller graph for this function:

Member Function Documentation

◆ acceptFriendRequest

void Core::acceptFriendRequest ( const ToxPk friendPk)
slot

Definition at line 1016 of file core.cpp.

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

◆ actionSentResult

void Core::actionSentResult ( uint32_t  friendId,
const QString &  action,
int  success 
)
signal

◆ bootstrapDht()

void Core::bootstrapDht ( )
private

Connects us to the Tox network.

Definition at line 810 of file core.cpp.

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

◆ changeGroupTitle

void Core::changeGroupTitle ( int  groupId,
const QString &  title 
)
slot

Definition at line 1166 of file core.cpp.

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

◆ checkConnection()

bool Core::checkConnection ( )
private

Definition at line 773 of file core.cpp.

Here is the caller graph for this function:

◆ checkLastOnline()

void Core::checkLastOnline ( uint32_t  friendId)
private

Definition at line 1460 of file core.cpp.

Here is the caller graph for this function:

◆ connected

void Core::connected ( )
signal
Here is the caller graph for this function:

◆ createGroup

int Core::createGroup ( uint8_t  type = TOX_CONFERENCE_TYPE_AV)
slot

Definition at line 1659 of file core.cpp.

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

◆ disconnected

void Core::disconnected ( )
signal
Here is the caller graph for this function:

◆ emptyGroupCreated

void Core::emptyGroupCreated ( int  groupnumber,
const GroupId  groupId,
const QString &  title = QString() 
)
signal
Here is the caller graph for this function:

◆ failedToAddFriend

void Core::failedToAddFriend ( const ToxPk friendPk,
const QString &  errorInfo = QString() 
)
signal
Here is the caller graph for this function:

◆ failedToRemoveFriend

void Core::failedToRemoveFriend ( uint32_t  friendId)
signal
Here is the caller graph for this function:

◆ failedToSetStatus

void Core::failedToSetStatus ( Status::Status  status)
signal

◆ failedToSetStatusMessage

void Core::failedToSetStatusMessage ( const QString &  message)
signal
Here is the caller graph for this function:

◆ failedToSetTyping

void Core::failedToSetTyping ( bool  typing)
signal
Here is the caller graph for this function:

◆ failedToSetUsername

void Core::failedToSetUsername ( const QString &  username)
signal
Here is the caller graph for this function:

◆ fileAvatarOfferReceived

void Core::fileAvatarOfferReceived ( uint32_t  friendId,
uint32_t  fileId,
const QByteArray &  avatarHash,
uint64_t  filesize 
)
signal
Deprecated:
prefer signals using ToxPk
Here is the caller graph for this function:

◆ friendAdded

void Core::friendAdded ( uint32_t  friendId,
const ToxPk friendPk 
)
signal
Here is the caller graph for this function:

◆ friendAvatarChanged

void Core::friendAvatarChanged ( const ToxPk friendPk,
const QByteArray &  pic 
)
signal
Here is the caller graph for this function:

◆ friendAvatarRemoved

void Core::friendAvatarRemoved ( const ToxPk friendPk)
signal
Here is the caller graph for this function:

◆ friendLastSeenChanged

void Core::friendLastSeenChanged ( uint32_t  friendId,
const QDateTime &  dateTime 
)
signal
Here is the caller graph for this function:

◆ friendMessageReceived

void Core::friendMessageReceived ( uint32_t  friendId,
const QString &  message,
bool  isAction 
)
signal
Here is the caller graph for this function:

◆ friendRemoved

void Core::friendRemoved ( uint32_t  friendId)
signal
Here is the caller graph for this function:

◆ friendRequestReceived

void Core::friendRequestReceived ( const ToxPk friendPk,
const QString &  message 
)
signal
Here is the caller graph for this function:

◆ friendStatusChanged

void Core::friendStatusChanged ( uint32_t  friendId,
Status::Status  status 
)
signal
Here is the caller graph for this function:

◆ friendStatusMessageChanged

void Core::friendStatusMessageChanged ( uint32_t  friendId,
const QString &  message 
)
signal
Here is the caller graph for this function:

◆ friendTypingChanged

void Core::friendTypingChanged ( uint32_t  friendId,
bool  isTyping 
)
signal
Here is the caller graph for this function:

◆ friendUsernameChanged

void Core::friendUsernameChanged ( uint32_t  friendId,
const QString &  username 
)
signal
Here is the caller graph for this function:

◆ getAv() [1/2]

CoreAV* Core::getAv ( )

◆ getAv() [2/2]

CoreAV * Core::getAv ( ) const

Definition at line 703 of file core.cpp.

Here is the caller graph for this function:

◆ getCoreFile()

CoreFile * Core::getCoreFile ( ) const

Definition at line 718 of file core.cpp.

Here is the caller graph for this function:

◆ getCoreLoopLock()

CompatibleRecursiveMutex & Core::getCoreLoopLock ( ) const

Definition at line 728 of file core.cpp.

◆ getExt() [1/2]

CoreExt* Core::getExt ( )

◆ getExt() [2/2]

CoreExt * Core::getExt ( ) const

Definition at line 733 of file core.cpp.

Here is the caller graph for this function:

◆ getFriendList()

QVector< uint32_t > Core::getFriendList ( ) const

Returns the list of friendIds in our friendlist, an empty list on error.

Definition at line 1474 of file core.cpp.

Here is the caller graph for this function:

◆ getFriendPublicKey()

ToxPk Core::getFriendPublicKey ( uint32_t  friendNumber) const

Get the public key part of the ToxID only.

Definition at line 1722 of file core.cpp.

◆ getFriendRequestErrorMessage()

QString Core::getFriendRequestErrorMessage ( const ToxId friendId,
const QString &  message 
) const
private

Checks that sending friendship request is correct and returns error message accordingly.

Parameters
friendIdId of a friend which request is destined to
messageFriendship request message
Returns
Returns empty string if sending request is correct, according error message otherwise

Definition at line 1035 of file core.cpp.

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

◆ getFriendUsername()

QString Core::getFriendUsername ( uint32_t  friendNumber) const

Get the username of a friend.

Definition at line 1740 of file core.cpp.

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

◆ getGroupAvEnabled()

bool Core::getGroupAvEnabled ( int  groupId) const
overridevirtual

Check, that group has audio or video stream.

Parameters
groupIdId of group to check
Returns
True for AV groups, false for text-only groups

Implements ICoreGroupQuery.

Definition at line 1598 of file core.cpp.

Here is the caller graph for this function:

◆ getGroupNumberPeers()

uint32_t Core::getGroupNumberPeers ( int  groupId) const
overridevirtual

Get number of peers in the conference.

Returns
The number of peers in the conference. UINT32_MAX on failure.

Implements ICoreGroupQuery.

Definition at line 1502 of file core.cpp.

Here is the caller graph for this function:

◆ getGroupPeerName()

QString Core::getGroupPeerName ( int  groupId,
int  peerId 
) const
overridevirtual

Get the name of a peer of a group.

Implements ICoreGroupQuery.

Definition at line 1518 of file core.cpp.

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

◆ getGroupPeerNames()

QStringList Core::getGroupPeerNames ( int  groupId) const
overridevirtual

Get the names of the peers of a group.

Implements ICoreGroupQuery.

Definition at line 1557 of file core.cpp.

Here is the call graph for this function:

◆ getGroupPeerPk()

ToxPk Core::getGroupPeerPk ( int  groupId,
int  peerId 
) const
overridevirtual

Get the public key of a peer of a group.

Implements ICoreGroupQuery.

Definition at line 1540 of file core.cpp.

Here is the caller graph for this function:

◆ getGroupPersistentId()

GroupId Core::getGroupPersistentId ( uint32_t  groupNumber) const
overridevirtual

Implements ICoreGroupQuery.

Definition at line 1484 of file core.cpp.

Here is the caller graph for this function:

◆ getKeypair()

QPair< QByteArray, QByteArray > Core::getKeypair ( ) const

Returns our public and private keys.

Definition at line 1283 of file core.cpp.

◆ getMaxMessageSize()

uint64_t Core::getMaxMessageSize ( ) const

Definition at line 1758 of file core.cpp.

Here is the caller graph for this function:

◆ getPeerName()

QString Core::getPeerName ( const ToxPk id) const

Definition at line 1773 of file core.cpp.

Here is the call graph for this function:

◆ getSelfId()

ToxId Core::getSelfId ( ) const
overridevirtual

Returns our Tox ID.

Implements ICoreIdHandler.

Definition at line 1258 of file core.cpp.

Here is the caller graph for this function:

◆ getSelfPublicKey()

ToxPk Core::getSelfPublicKey ( ) const
overridevirtual

Gets self public key.

Returns
Self PK

Implements ICoreIdHandler.

Definition at line 1271 of file core.cpp.

Here is the caller graph for this function:

◆ getStatus()

Status::Status Core::getStatus ( ) const

Returns our user status.

Definition at line 1320 of file core.cpp.

Here is the caller graph for this function:

◆ getStatusMessage()

QString Core::getStatusMessage ( ) const

Returns our status message, or an empty string on failure.

Definition at line 1302 of file core.cpp.

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

◆ getTox()

Tox * Core::getTox ( ) const

Definition at line 723 of file core.cpp.

◆ getToxSaveData

QByteArray Core::getToxSaveData ( )
slot

Returns the unencrypted tox save data.

Definition at line 1378 of file core.cpp.

◆ getUsername()

QString Core::getUsername ( ) const
overridevirtual

Returns our username, or an empty string on failure.

Implements ICoreIdHandler.

Definition at line 1217 of file core.cpp.

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

◆ groupInviteFriend

void Core::groupInviteFriend ( uint32_t  friendId,
int  groupId 
)
slot

Definition at line 1650 of file core.cpp.

Here is the caller graph for this function:

◆ groupInviteReceived

void Core::groupInviteReceived ( const GroupInvite inviteInfo)
signal
Here is the caller graph for this function:

◆ groupJoined

void Core::groupJoined ( int  groupnumber,
GroupId  groupId 
)
signal
Here is the caller graph for this function:

◆ groupMessageReceived

void Core::groupMessageReceived ( int  groupnumber,
int  peernumber,
const QString &  message,
bool  isAction 
)
signal
Here is the caller graph for this function:

◆ groupNamelistChanged

void Core::groupNamelistChanged ( int  groupnumber,
int  peernumber,
uint8_t  change 
)
signal

◆ groupPeerAudioPlaying

void Core::groupPeerAudioPlaying ( int  groupnumber,
ToxPk  peerPk 
)
signal
Here is the caller graph for this function:

◆ groupPeerlistChanged

void Core::groupPeerlistChanged ( int  groupnumber)
signal
Here is the caller graph for this function:

◆ groupPeerNameChanged

void Core::groupPeerNameChanged ( int  groupnumber,
const ToxPk peerPk,
const QString &  newName 
)
signal
Here is the caller graph for this function:

◆ groupSentFailed

void Core::groupSentFailed ( int  groupId)
signal
Here is the caller graph for this function:

◆ groupTitleChanged

void Core::groupTitleChanged ( int  groupnumber,
const QString &  author,
const QString &  title 
)
signal
Here is the caller graph for this function:

◆ hasFriendWithPublicKey()

bool Core::hasFriendWithPublicKey ( const ToxPk publicKey) const

Checks if we have a friend by public key.

Definition at line 1706 of file core.cpp.

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

◆ idSet

void Core::idSet ( const ToxId id)
signal
Here is the caller graph for this function:

◆ isFriendOnline()

bool Core::isFriendOnline ( uint32_t  friendId) const

Checks if a friend is online. Unknown friends are considered offline.

Definition at line 1693 of file core.cpp.

Here is the caller graph for this function:

◆ joinGroupchat()

uint32_t Core::joinGroupchat ( const GroupInvite inviteInfo)

Accept a groupchat invite.

Parameters
inviteInfoObject which contains info about group invitation
Returns
Conference number on success, UINT32_MAX on failure.

Definition at line 1614 of file core.cpp.

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

◆ loadFriends()

void Core::loadFriends ( )
private

Definition at line 1389 of file core.cpp.

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

◆ loadGroups()

void Core::loadGroups ( )
private

Definition at line 1421 of file core.cpp.

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

◆ makeTox()

void Core::makeTox ( QByteArray  savedata,
ICoreSettings s 
)
private

◆ makeToxCore()

ToxCorePtr Core::makeToxCore ( const QByteArray &  savedata,
const ICoreSettings settings,
IBootstrapListGenerator bootstrapNodes,
ToxCoreErrors err = nullptr 
)
static

Factory method for the Core object.

Parameters
savedataempty if new profile or saved data else
settingsSettings specific to Core
Returns
nullptr or a Core object ready to start

Definition at line 539 of file core.cpp.

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

◆ onConnectionStatusChanged()

void Core::onConnectionStatusChanged ( Tox *  tox,
uint32_t  friendId,
Tox_Connection  status,
void *  vCore 
)
staticprivate

Definition at line 910 of file core.cpp.

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

◆ onFriendMessage()

void Core::onFriendMessage ( Tox *  tox,
uint32_t  friendId,
Tox_Message_Type  type,
const uint8_t *  cMessage,
size_t  cMessageSize,
void *  core 
)
staticprivate

Definition at line 861 of file core.cpp.

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

◆ onFriendNameChange()

void Core::onFriendNameChange ( Tox *  tox,
uint32_t  friendId,
const uint8_t *  cName,
size_t  cNameSize,
void *  core 
)
staticprivate

Definition at line 869 of file core.cpp.

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

◆ onFriendRequest()

void Core::onFriendRequest ( Tox *  tox,
const uint8_t *  cUserId,
const uint8_t *  cMessage,
size_t  cMessageSize,
void *  core 
)
staticprivate

Definition at line 853 of file core.cpp.

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

◆ onFriendTypingChange()

void Core::onFriendTypingChange ( Tox *  tox,
uint32_t  friendId,
bool  isTyping,
void *  core 
)
staticprivate

Definition at line 876 of file core.cpp.

Here is the caller graph for this function:

◆ onGroupInvite()

void Core::onGroupInvite ( Tox *  tox,
uint32_t  friendId,
Tox_Conference_Type  type,
const uint8_t *  cookie,
size_t  length,
void *  vCore 
)
staticprivate

Definition at line 939 of file core.cpp.

Here is the caller graph for this function:

◆ onGroupMessage()

void Core::onGroupMessage ( Tox *  tox,
uint32_t  groupId,
uint32_t  peerId,
Tox_Message_Type  type,
const uint8_t *  cMessage,
size_t  length,
void *  vCore 
)
staticprivate

Definition at line 961 of file core.cpp.

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

◆ onGroupPeerListChange()

void Core::onGroupPeerListChange ( Tox *  ,
uint32_t  groupId,
void *  core 
)
staticprivate

Definition at line 970 of file core.cpp.

Here is the caller graph for this function:

◆ onGroupPeerNameChange()

void Core::onGroupPeerNameChange ( Tox *  ,
uint32_t  groupId,
uint32_t  peerId,
const uint8_t *  name,
size_t  length,
void *  core 
)
staticprivate

Definition at line 978 of file core.cpp.

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

◆ onGroupTitleChange()

void Core::onGroupTitleChange ( Tox *  tox,
uint32_t  groupId,
uint32_t  peerId,
const uint8_t *  cTitle,
size_t  length,
void *  vCore 
)
staticprivate

Definition at line 988 of file core.cpp.

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

◆ onLosslessPacket()

void Core::onLosslessPacket ( Tox *  tox,
uint32_t  friendId,
const uint8_t *  data,
size_t  length,
void *  core 
)
staticprivate

Handling of custom lossless packets received by toxcore. Currently only used to forward toxext packets to CoreExt.

Definition at line 1004 of file core.cpp.

Here is the caller graph for this function:

◆ onReadReceiptCallback()

void Core::onReadReceiptCallback ( Tox *  tox,
uint32_t  friendId,
uint32_t  receipt,
void *  core 
)
staticprivate

Definition at line 1011 of file core.cpp.

Here is the caller graph for this function:

◆ onStarted

void Core::onStarted ( )
privateslot

Definition at line 669 of file core.cpp.

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

◆ onStatusMessageChanged()

void Core::onStatusMessageChanged ( Tox *  tox,
uint32_t  friendId,
const uint8_t *  cMessage,
size_t  cMessageSize,
void *  core 
)
staticprivate

Definition at line 881 of file core.cpp.

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

◆ onUserStatusChanged()

void Core::onUserStatusChanged ( Tox *  tox,
uint32_t  friendId,
Tox_User_Status  userstatus,
void *  core 
)
staticprivate

Definition at line 889 of file core.cpp.

Here is the caller graph for this function:

◆ process

void Core::process ( )
privateslot

Processes toxcore events and ensure we stay connected, called by its own timer.

Definition at line 746 of file core.cpp.

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

◆ quitGroupChat()

void Core::quitGroupChat ( int  groupId) const

◆ receiptRecieved

void Core::receiptRecieved ( int  friedId,
ReceiptNum  receipt 
)
signal
Here is the caller graph for this function:

◆ registerCallbacks()

void Core::registerCallbacks ( Tox *  tox)
staticprivate

Registers all toxcore callbacks.

Parameters
toxTox instance to register the callbacks on

Definition at line 515 of file core.cpp.

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

◆ removeFriend

void Core::removeFriend ( uint32_t  friendId)
slot

Definition at line 1179 of file core.cpp.

Here is the caller graph for this function:

◆ removeGroup

void Core::removeGroup ( int  groupId)
slot

Definition at line 1194 of file core.cpp.

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

◆ requestFriendship

void Core::requestFriendship ( const ToxId friendAddress,
const QString &  message 
)
slot

Definition at line 1059 of file core.cpp.

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

◆ requestSent

void Core::requestSent ( const ToxPk friendPk,
const QString &  message 
)
signal
Here is the caller graph for this function:

◆ saveRequest

void Core::saveRequest ( )
signal
Here is the caller graph for this function:

◆ sendAction

bool Core::sendAction ( uint32_t  friendId,
const QString &  action,
ReceiptNum receipt 
)
overrideslot

Definition at line 1114 of file core.cpp.

Here is the call graph for this function:

◆ sendFile()

void Core::sendFile ( uint32_t  friendId,
QString  filename,
QString  filePath,
long long  filesize 
)

◆ sendGroupAction

void Core::sendGroupAction ( int  groupId,
const QString &  message 
)
overrideslot

Definition at line 1159 of file core.cpp.

Here is the call graph for this function:

◆ sendGroupMessage

void Core::sendGroupMessage ( int  groupId,
const QString &  message 
)
overrideslot

Definition at line 1152 of file core.cpp.

Here is the call graph for this function:

◆ sendGroupMessageWithType()

void Core::sendGroupMessageWithType ( int  groupId,
const QString &  message,
Tox_Message_Type  type 
)
private

Definition at line 1131 of file core.cpp.

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

◆ sendMessage

bool Core::sendMessage ( uint32_t  friendId,
const QString &  message,
ReceiptNum receipt 
)
overrideslot

Definition at line 1108 of file core.cpp.

Here is the call graph for this function:

◆ sendMessageWithType()

bool Core::sendMessageWithType ( uint32_t  friendId,
const QString &  message,
Tox_Message_Type  type,
ReceiptNum receipt 
)
private

Definition at line 1086 of file core.cpp.

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

◆ sendTyping

void Core::sendTyping ( uint32_t  friendId,
bool  typing 
)
slot

Definition at line 1120 of file core.cpp.

Here is the caller graph for this function:

◆ setAv()

void Core::setAv ( CoreAV coreAv)

Definition at line 713 of file core.cpp.

◆ setNospam

void Core::setNospam ( uint32_t  nospam)
slot

Sets the NoSpam value to prevent friend request spam.

Parameters
nospaman arbitrary which becomes part of the Tox ID

Definition at line 1804 of file core.cpp.

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

◆ setStatus

void Core::setStatus ( Status::Status  status)
slot

Definition at line 1347 of file core.cpp.

Here is the caller graph for this function:

◆ setStatusMessage

void Core::setStatusMessage ( const QString &  message)
slot

Definition at line 1327 of file core.cpp.

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

◆ setUsername

void Core::setUsername ( const QString &  username)
slot

Definition at line 1235 of file core.cpp.

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

◆ start

void Core::start ( )
slot

Starts toxcore and it's event loop, can be called from any thread.

Definition at line 698 of file core.cpp.

◆ statusMessageSet

void Core::statusMessageSet ( const QString &  message)
signal
Here is the caller graph for this function:

◆ statusSet

void Core::statusSet ( Status::Status  status)
signal
Here is the caller graph for this function:

◆ usernameSet

void Core::usernameSet ( const QString &  username)
signal
Here is the caller graph for this function:

Member Data Documentation

◆ av

CoreAV* Core::av = nullptr
private

Definition at line 267 of file core.h.

◆ bootstrapListGenerator

const IBootstrapListGenerator& Core::bootstrapListGenerator
private

Definition at line 274 of file core.h.

◆ coreLoopLock

CompatibleRecursiveMutex Core::coreLoopLock
mutableprivate

Definition at line 271 of file core.h.

◆ coreThread

std::unique_ptr<QThread> Core::coreThread
private

Definition at line 273 of file core.h.

◆ ext

std::unique_ptr<CoreExt> Core::ext
private

Definition at line 268 of file core.h.

◆ file

std::unique_ptr<CoreFile> Core::file
private

Definition at line 266 of file core.h.

◆ isConnected

bool Core::isConnected = false
private

Definition at line 276 of file core.h.

◆ settings

const ICoreSettings& Core::settings
private

Definition at line 275 of file core.h.

◆ tolerance

int Core::tolerance = CORE_DISCONNECT_TOLERANCE
private

Definition at line 277 of file core.h.

◆ tox

ToxPtr Core::tox
private

Definition at line 264 of file core.h.

◆ TOX_EXT

const QString Core::TOX_EXT = ".tox"
static

Definition at line 89 of file core.h.

◆ toxTimer

QTimer* Core::toxTimer = nullptr
private

Definition at line 269 of file core.h.


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