Yingdi Yu | 24ca96f | 2013-10-22 23:42:16 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| 2 | /* |
| 3 | * Copyright (c) 2013, Regents of the University of California |
| 4 | * Yingdi Yu |
| 5 | * |
| 6 | * BSD license, See the LICENSE file for more information |
| 7 | * |
| 8 | * Author: Yingdi Yu <yingdi@cs.ucla.edu> |
| 9 | */ |
| 10 | |
| 11 | #ifndef INVITATIONDIALOG_H |
| 12 | #define INVITATIONDIALOG_H |
| 13 | |
| 14 | #include <QDialog> |
| 15 | |
Yingdi Yu | 978b3ae | 2013-10-23 11:50:51 -0700 | [diff] [blame] | 16 | #ifndef Q_MOC_RUN |
| 17 | #include <ndn.cxx/data.h> |
| 18 | #include <ndn.cxx/security/certificate/identity-certificate.h> |
| 19 | #endif |
| 20 | |
Yingdi Yu | 24ca96f | 2013-10-22 23:42:16 -0700 | [diff] [blame] | 21 | namespace Ui { |
| 22 | class InvitationDialog; |
| 23 | } |
| 24 | |
| 25 | class InvitationDialog : public QDialog |
| 26 | { |
| 27 | Q_OBJECT |
| 28 | |
| 29 | public: |
| 30 | explicit InvitationDialog(QWidget *parent = 0); |
| 31 | ~InvitationDialog(); |
| 32 | |
| 33 | void |
| 34 | setMsg(const std::string& inviter, const std::string& chatroom); |
| 35 | |
| 36 | inline void |
| 37 | setInterestName(const ndn::Name& interestName) |
| 38 | { m_interestName = interestName; } |
| 39 | |
Yingdi Yu | 978b3ae | 2013-10-23 11:50:51 -0700 | [diff] [blame] | 40 | inline void |
| 41 | setIdentityCertificate(const ndn::Ptr<ndn::security::IdentityCertificate> identityCertificate) |
| 42 | { m_identityCertificate = identityCertificate; } |
| 43 | |
Yingdi Yu | 24ca96f | 2013-10-22 23:42:16 -0700 | [diff] [blame] | 44 | signals: |
| 45 | void |
Yingdi Yu | 978b3ae | 2013-10-23 11:50:51 -0700 | [diff] [blame] | 46 | invitationAccepted(const ndn::Name& interestName, |
| 47 | const ndn::security::IdentityCertificate& identityCertificate, |
| 48 | QString inviter, |
| 49 | QString chatroom); |
Yingdi Yu | 24ca96f | 2013-10-22 23:42:16 -0700 | [diff] [blame] | 50 | |
| 51 | void |
| 52 | invitationRejected(const ndn::Name& interestName); |
| 53 | |
| 54 | private slots: |
| 55 | void |
| 56 | onOkClicked(); |
| 57 | |
| 58 | void |
| 59 | onCancelClicked(); |
| 60 | |
| 61 | |
| 62 | private: |
| 63 | Ui::InvitationDialog *ui; |
Yingdi Yu | 978b3ae | 2013-10-23 11:50:51 -0700 | [diff] [blame] | 64 | std::string m_inviter; |
| 65 | std::string m_chatroom; |
Yingdi Yu | 24ca96f | 2013-10-22 23:42:16 -0700 | [diff] [blame] | 66 | ndn::Name m_interestName; |
Yingdi Yu | 978b3ae | 2013-10-23 11:50:51 -0700 | [diff] [blame] | 67 | ndn::Ptr<ndn::security::IdentityCertificate> m_identityCertificate; |
Yingdi Yu | 24ca96f | 2013-10-22 23:42:16 -0700 | [diff] [blame] | 68 | }; |
| 69 | |
| 70 | #endif // INVITATIONDIALOG_H |