qTox  Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
aboutfriend.h
Go to the documentation of this file.
1 /*
2  Copyright © 2019 by The qTox Project Contributors
3 
4  This file is part of qTox, a Qt-based graphical interface for Tox.
5 
6  qTox is libre software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  qTox is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with qTox. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #pragma once
21 
22 #include "iaboutfriend.h"
23 #include "util/interface.h"
25 
26 #include <QObject>
27 
28 class Friend;
29 class IFriendSettings;
30 
31 class AboutFriend : public QObject, public IAboutFriend
32 {
33  Q_OBJECT
34 
35 public:
37 
38  QString getName() const override;
39  QString getStatusMessage() const override;
40  ToxPk getPublicKey() const override;
41 
42  QPixmap getAvatar() const override;
43 
44  QString getNote() const override;
45  void setNote(const QString& note) override;
46 
47  QString getAutoAcceptDir() const override;
48  void setAutoAcceptDir(const QString& path) override;
49 
50  IFriendSettings::AutoAcceptCallFlags getAutoAcceptCall() const override;
51  void setAutoAcceptCall(IFriendSettings::AutoAcceptCallFlags flag) override;
52 
53  bool getAutoGroupInvite() const override;
54  void setAutoGroupInvite(bool enabled) override;
55 
56  bool clearHistory() override;
57  bool isHistoryExistence() override;
58 
59  SIGNAL_IMPL(AboutFriend, nameChanged, const QString&)
60  SIGNAL_IMPL(AboutFriend, statusChanged, const QString&)
61  SIGNAL_IMPL(AboutFriend, publicKeyChanged, const QString&)
62 
63  SIGNAL_IMPL(AboutFriend, avatarChanged, const QPixmap&)
64  SIGNAL_IMPL(AboutFriend, noteChanged, const QString&)
65 
66  SIGNAL_IMPL(AboutFriend, autoAcceptDirChanged, const QString&)
67  SIGNAL_IMPL(AboutFriend, autoAcceptCallChanged, IFriendSettings::AutoAcceptCallFlags)
68  SIGNAL_IMPL(AboutFriend, autoGroupInviteChanged, bool)
69 
70 private:
71  const Friend* const f;
73 };
AboutFriend::isHistoryExistence
bool isHistoryExistence() override
Definition: aboutfriend.cpp:133
AboutFriend::setAutoAcceptCall
void setAutoAcceptCall(IFriendSettings::AutoAcceptCallFlags flag) override
Definition: aboutfriend.cpp:101
AboutFriend::getAutoAcceptDir
QString getAutoAcceptDir() const override
Definition: aboutfriend.cpp:82
ifriendsettings.h
AboutFriend::setNote
void setNote(const QString &note) override
Definition: aboutfriend.cpp:75
AboutFriend
Definition: aboutfriend.h:31
AboutFriend::setAutoGroupInvite
void setAutoGroupInvite(bool enabled) override
Definition: aboutfriend.cpp:114
IAboutFriend
Definition: iaboutfriend.h:27
AboutFriend::getName
QString getName() const override
Definition: aboutfriend.cpp:46
ToxPk
This class represents a Tox Public Key, which is a part of Tox ID.
Definition: toxpk.h:26
Friend
Definition: friend.h:31
AboutFriend::clearHistory
bool clearHistory() override
Definition: aboutfriend.cpp:121
AboutFriend::setAutoAcceptDir
void setAutoAcceptDir(const QString &path) override
Definition: aboutfriend.cpp:88
AboutFriend::getAutoGroupInvite
bool getAutoGroupInvite() const override
Definition: aboutfriend.cpp:108
AboutFriend::settings
IFriendSettings *const settings
Definition: aboutfriend.h:72
IFriendSettings
Definition: ifriendsettings.h:29
AboutFriend::getPublicKey
ToxPk getPublicKey() const override
Definition: aboutfriend.cpp:56
AboutFriend::getStatusMessage
QString getStatusMessage() const override
Definition: aboutfriend.cpp:51
AboutFriend::getNote
QString getNote() const override
Definition: aboutfriend.cpp:69
AboutFriend::f
const Friend *const f
Definition: aboutfriend.h:71
iaboutfriend.h
AboutFriend::getAutoAcceptCall
IFriendSettings::AutoAcceptCallFlags getAutoAcceptCall() const override
Definition: aboutfriend.cpp:95
AboutFriend::getAvatar
QPixmap getAvatar() const override
Definition: aboutfriend.cpp:61
AboutFriend::AboutFriend
AboutFriend(const Friend *f, IFriendSettings *const settings)
Definition: aboutfriend.cpp:27