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 #ifndef GROUP_CHATROOM_H 21 #define GROUP_CHATROOM_H 22 23 #include "chatroom.h" 24 25 #include <QObject> 26 27 class IDialogsManager; 28 class Group; 29 class ToxPk; 30 31 class GroupChatroom : public QObject, public Chatroom 32 { 33 Q_OBJECT 34 public: 35 GroupChatroom(Group* group, IDialogsManager* dialogsManager); 36 37 Contact* getContact() override; 38 39 Group* getGroup(); 40 41 bool hasNewMessage() const; 42 void resetEventFlags(); 43 44 bool friendExists(const ToxPk& pk); 45 void inviteFriend(const ToxPk& pk); 46 47 bool possibleToOpenInNewWindow() const; 48 bool canBeRemovedFromWindow() const; 49 void removeGroupFromDialogs(); 50 51 private: 52 Group* group{nullptr}; 53 IDialogsManager* dialogsManager{nullptr}; 54 }; 55 56 #endif /* GROUP_CHATROOM_H */ 57