qTox
Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
|
Implement interface, that provides invormation about self profile. Also, provide methods to work with profile file. More...
#include <profileinfo.h>
Public Member Functions | |
ProfileInfo (Core *core, Profile *profile) | |
ProfileInfo constructor. More... | |
bool | setPassword (const QString &password) override |
Set a user password for profile. More... | |
bool | deletePassword () override |
Delete a user password for profile. More... | |
bool | isEncrypted () const override |
Check if current profile is encrypted. More... | |
void | copyId () const override |
Copy self ToxId to clipboard. More... | |
void | setUsername (const QString &name) override |
Set self user name. More... | |
void | setStatusMessage (const QString &status) override |
Set self status message. More... | |
QString | getProfileName () const override |
Get name of tox profile file. More... | |
RenameResult | renameProfile (const QString &name) override |
Rename profile file. More... | |
SaveResult | exportProfile (const QString &path) const override |
Save profile in custom place. More... | |
QStringList | removeProfile () override |
Remove profile. More... | |
void | logout () override |
Log out from current profile. More... | |
void | copyQr (const QImage &image) const override |
Copy image to clipboard. More... | |
SaveResult | saveQr (const QImage &image, const QString &path) const override |
Save image to file. More... | |
SetAvatarResult | setAvatar (const QString &path) override |
Set self avatar. More... | |
void | removeAvatar () override |
Remove self avatar. More... | |
![]() | |
IProfileInfo ()=default | |
virtual | ~IProfileInfo () |
IProfileInfo (const IProfileInfo &)=default | |
IProfileInfo & | operator= (const IProfileInfo &)=default |
IProfileInfo (IProfileInfo &&)=default | |
IProfileInfo & | operator= (IProfileInfo &&)=default |
DECLARE_SIGNAL (idChanged, const ToxId &) | |
DECLARE_SIGNAL (usernameChanged, const QString &) | |
DECLARE_SIGNAL (statusMessageChanged, const QString &) | |
Private Member Functions | |
IProfileInfo::SetAvatarResult | createAvatarFromFile (QFile &file, QByteArray &avatar) |
Create an avatar from an image file. More... | |
IProfileInfo::SetAvatarResult | byteArrayToPng (QByteArray inData, QByteArray &outPng) |
Create a png from image data. More... | |
IProfileInfo::SetAvatarResult | scalePngToAvatar (QByteArray &avatar) |
Private Attributes | |
Profile *const | profile |
Core *const | core |
Additional Inherited Members | |
![]() | |
enum | RenameResult { RenameResult::OK, RenameResult::EmptyName, RenameResult::ProfileAlreadyExists, RenameResult::Error } |
enum | SaveResult { SaveResult::OK, SaveResult::EmptyPath, SaveResult::NoWritePermission, SaveResult::Error } |
enum | SetAvatarResult { SetAvatarResult::OK, SetAvatarResult::EmptyPath, SetAvatarResult::CanNotOpen, SetAvatarResult::CanNotRead, SetAvatarResult::TooLarge } |
Implement interface, that provides invormation about self profile. Also, provide methods to work with profile file.
Definition at line 32 of file profileinfo.h.
ProfileInfo constructor.
Definition at line 46 of file profileinfo.cpp.
|
private |
Create a png from image data.
inData | byte array from an image file. |
outPng | byte array which the png will be written to. |
Definition at line 334 of file profileinfo.cpp.
|
overridevirtual |
Copy self ToxId to clipboard.
Implements IProfileInfo.
Definition at line 88 of file profileinfo.cpp.
|
overridevirtual |
Copy image to clipboard.
image | Image to copy. |
Implements IProfileInfo.
Definition at line 240 of file profileinfo.cpp.
|
private |
Create an avatar from an image file.
file | Image file, which should be the new avatar. |
avatar | Output avatar of correct file type and size. |
Definition at line 316 of file profileinfo.cpp.
|
overridevirtual |
Delete a user password for profile.
Implements IProfileInfo.
Definition at line 70 of file profileinfo.cpp.
|
overridevirtual |
Save profile in custom place.
path | Path to save profile. |
Implements IProfileInfo.
Definition at line 196 of file profileinfo.cpp.
|
overridevirtual |
Get name of tox profile file.
Implements IProfileInfo.
Definition at line 121 of file profileinfo.cpp.
|
overridevirtual |
Check if current profile is encrypted.
Implements IProfileInfo.
Definition at line 80 of file profileinfo.cpp.
|
overridevirtual |
Log out from current profile.
Implements IProfileInfo.
Definition at line 228 of file profileinfo.cpp.
|
overridevirtual |
Remove self avatar.
Implements IProfileInfo.
Definition at line 384 of file profileinfo.cpp.
|
overridevirtual |
Remove profile.
Implements IProfileInfo.
Definition at line 218 of file profileinfo.cpp.
|
overridevirtual |
Rename profile file.
name | New profile name. |
Implements IProfileInfo.
Definition at line 157 of file profileinfo.cpp.
|
overridevirtual |
Save image to file.
image | Image to save. |
path | Path to save. |
Implements IProfileInfo.
Definition at line 251 of file profileinfo.cpp.
|
private |
Definition at line 360 of file profileinfo.cpp.
|
overridevirtual |
Set self avatar.
path | Path to image, which should be the new avatar. |
Implements IProfileInfo.
Definition at line 291 of file profileinfo.cpp.
|
overridevirtual |
Set a user password for profile.
password | New password. |
Implements IProfileInfo.
Definition at line 60 of file profileinfo.cpp.
|
overridevirtual |
Set self status message.
status | New status message. |
Implements IProfileInfo.
Definition at line 112 of file profileinfo.cpp.
|
overridevirtual |
Set self user name.
name | New name. |
Implements IProfileInfo.
Definition at line 103 of file profileinfo.cpp.
|
private |
Definition at line 68 of file profileinfo.h.
|
private |
Definition at line 67 of file profileinfo.h.