1 /*
2     Copyright © 2015-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 GROUPINVITEFORM_H
21 #define GROUPINVITEFORM_H
22 
23 #include "src/widget/gui.h"
24 
25 #include <QWidget>
26 
27 class ContentLayout;
28 class GroupInvite;
29 class GroupInviteWidget;
30 
31 class QGroupBox;
32 class QLabel;
33 class QPushButton;
34 class QScrollArea;
35 class QSignalMapper;
36 
37 namespace Ui {
38 class MainWindow;
39 }
40 
41 class GroupInviteForm : public QWidget
42 {
43     Q_OBJECT
44 public:
45     GroupInviteForm();
46     ~GroupInviteForm();
47 
48     void show(ContentLayout* contentLayout);
49     bool addGroupInvite(const GroupInvite& inviteInfo);
50     bool isShown() const;
51 
52 signals:
53     void groupCreate(uint8_t type);
54     void groupInviteAccepted(const GroupInvite& inviteInfo);
55     void groupInvitesSeen();
56 
57 protected:
58     void showEvent(QShowEvent* event) final override;
59 
60 private:
61     void retranslateUi();
62     void deleteInviteWidget(const GroupInvite& inviteInfo);
63 
64 private:
65     QWidget* headWidget;
66     QLabel* headLabel;
67     QPushButton* createButton;
68     QGroupBox* inviteBox;
69     QList<GroupInviteWidget*> invites;
70     QScrollArea* scroll;
71 };
72 
73 #endif // GROUPINVITEFORM_H
74