| /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| /* |
| * Copyright (c) 2013, Regents of the University of California |
| * Yingdi Yu |
| * |
| * BSD license, See the LICENSE file for more information |
| * |
| * Author: Yingdi Yu <yingdi@cs.ucla.edu> |
| */ |
| |
| #ifndef ADDCONTACTPANEL_H |
| #define ADDCONTACTPANEL_H |
| |
| #include <QDialog> |
| #include <QMetaType> |
| #include "warningdialog.h" |
| |
| #ifndef Q_MOC_RUN |
| #include "endorse-certificate.h" |
| #include "profile.h" |
| #include "contact-manager.h" |
| #endif |
| |
| namespace Ui { |
| class AddContactPanel; |
| } |
| |
| Q_DECLARE_METATYPE(ndn::Name) |
| |
| Q_DECLARE_METATYPE(EndorseCertificate) |
| |
| Q_DECLARE_METATYPE(ndn::Data) |
| |
| class AddContactPanel : public QDialog |
| { |
| Q_OBJECT |
| |
| public: |
| explicit AddContactPanel(ndn::Ptr<ContactManager> contactManager, |
| QWidget *parent = 0); |
| |
| ~AddContactPanel(); |
| |
| private: |
| void |
| displayContactInfo(); |
| |
| bool |
| isCorrectName(const ndn::Name& name); |
| |
| private slots: |
| void |
| onCancelClicked(); |
| |
| void |
| onSearchClicked(); |
| |
| void |
| onAddClicked(); |
| |
| void |
| selfEndorseCertificateFetched(const EndorseCertificate& endorseCertificate); |
| |
| void |
| selfEndorseCertificateFetchFailed(const ndn::Name& identity); |
| |
| void |
| onContactKeyFetched(const EndorseCertificate& endorseCertificate); |
| |
| void |
| onContactKeyFetchFailed(const ndn::Name& identity); |
| |
| void |
| onCollectEndorseFetched(const ndn::Data& data); |
| |
| void |
| onCollectEndorseFetchFailed(const ndn::Name& identity); |
| |
| signals: |
| void |
| newContactAdded(); |
| |
| private: |
| Ui::AddContactPanel *ui; |
| ndn::Name m_searchIdentity; |
| ndn::Ptr<ContactManager> m_contactManager; |
| WarningDialog* m_warningDialog; |
| ndn::Ptr<EndorseCertificate> m_currentEndorseCertificate; |
| ndn::Ptr<ndn::Data> m_currentCollectEndorse; |
| bool m_currentEndorseCertificateReady; |
| bool m_currentCollectEndorseReady; |
| }; |
| |
| #endif // ADDCONTACTPANEL_H |