qTox  Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
friendlist.h
Go to the documentation of this file.
1 /*
2  Copyright © 2014-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 <cstdint>
23 
24 template <class T>
25 class QList;
26 template <class A, class B>
27 class QHash;
28 class Friend;
29 class QByteArray;
30 class QString;
31 class ToxPk;
32 
34 {
35 public:
36  static Friend* addFriend(uint32_t friendId, const ToxPk& friendPk);
37  static Friend* findFriend(const ToxPk& friendPk);
38  static const ToxPk& id2Key(uint32_t friendId);
40  static void removeFriend(const ToxPk& friendPk, bool fake = false);
41  static void clear();
42  static QString decideNickname(const ToxPk& friendPk, const QString& origName);
43 
44 private:
47 };
FriendList
Definition: friendlist.h:33
FriendList::removeFriend
static void removeFriend(const ToxPk &friendPk, bool fake=false)
Definition: friendlist.cpp:62
FriendList::decideNickname
static QString decideNickname(const ToxPk &friendPk, const QString &origName)
Definition: friendlist.cpp:84
FriendList::friendList
static QHash< ToxPk, Friend * > friendList
Definition: friendlist.h:45
QList
Definition: friendlist.h:25
FriendList::addFriend
static Friend * addFriend(uint32_t friendId, const ToxPk &friendPk)
Definition: friendlist.cpp:32
FriendList::findFriend
static Friend * findFriend(const ToxPk &friendPk)
Definition: friendlist.cpp:47
FriendList::getAllFriends
static QList< Friend * > getAllFriends()
Definition: friendlist.cpp:79
ToxPk
This class represents a Tox Public Key, which is a part of Tox ID.
Definition: toxpk.h:26
Friend
Definition: friend.h:31
QHash
Definition: friendlist.h:27
FriendList::id2key
static QHash< uint32_t, ToxPk > id2key
Definition: friendlist.h:46
FriendList::clear
static void clear()
Definition: friendlist.cpp:72
FriendList::id2Key
static const ToxPk & id2Key(uint32_t friendId)
Definition: friendlist.cpp:57