blob: 1536464758a6806439ca335b1ff992f4267bd1ed [file] [log] [blame]
Yingdi Yud59b5932013-10-16 13:16:49 -07001/* -*- 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
Yingdi Yua4898752013-10-15 20:31:37 -070011#ifndef ADDCONTACTPANEL_H
12#define ADDCONTACTPANEL_H
13
14#include <QDialog>
Yingdi Yuc29fb982013-10-20 19:43:10 -070015#include <QMetaType>
16#include "warningdialog.h"
Yingdi Yua4898752013-10-15 20:31:37 -070017
Yingdi Yud59b5932013-10-16 13:16:49 -070018#ifndef Q_MOC_RUN
19#include "endorse-certificate.h"
Yingdi Yu79c25a22013-10-21 13:38:38 -070020#include "profile.h"
Yingdi Yu0b82a4e2013-10-18 11:29:25 -070021#include "contact-manager.h"
Yingdi Yud59b5932013-10-16 13:16:49 -070022#endif
23
Yingdi Yua4898752013-10-15 20:31:37 -070024namespace Ui {
25class AddContactPanel;
26}
27
Yingdi Yuc29fb982013-10-20 19:43:10 -070028Q_DECLARE_METATYPE(ndn::Name)
29
30Q_DECLARE_METATYPE(EndorseCertificate)
31
Yingdi Yua4898752013-10-15 20:31:37 -070032class AddContactPanel : public QDialog
33{
Yingdi Yu0b82a4e2013-10-18 11:29:25 -070034 Q_OBJECT
Yingdi Yua4898752013-10-15 20:31:37 -070035
36public:
Yingdi Yu0b82a4e2013-10-18 11:29:25 -070037 explicit AddContactPanel(ndn::Ptr<ContactManager> contactManager,
38 QWidget *parent = 0);
39
40 ~AddContactPanel();
Yingdi Yua4898752013-10-15 20:31:37 -070041
Yingdi Yud59b5932013-10-16 13:16:49 -070042private slots:
43 void
44 onCancelClicked();
45
46 void
47 onSearchClicked();
48
49 void
50 onAddClicked();
51
Yingdi Yuaa8d7692013-10-18 17:05:02 -070052 void
Yingdi Yuc29fb982013-10-20 19:43:10 -070053 selfEndorseCertificateFetched(const EndorseCertificate& endorseCertificate);
54
55 void
56 selfEndorseCertificateFetchFailed(const ndn::Name& identity);
Yingdi Yuaa8d7692013-10-18 17:05:02 -070057
Yingdi Yu79c25a22013-10-21 13:38:38 -070058signals:
59 void
60 newContactAdded();
61
Yingdi Yua4898752013-10-15 20:31:37 -070062private:
Yingdi Yud59b5932013-10-16 13:16:49 -070063 Ui::AddContactPanel *ui;
Yingdi Yuaa8d7692013-10-18 17:05:02 -070064 ndn::Name m_searchIdentity;
Yingdi Yu0b82a4e2013-10-18 11:29:25 -070065 ndn::Ptr<ContactManager> m_contactManager;
Yingdi Yuc29fb982013-10-20 19:43:10 -070066 WarningDialog* m_warningDialog;
Yingdi Yu79c25a22013-10-21 13:38:38 -070067 ndn::Ptr<EndorseCertificate> m_currentEndorseCertificate;
Yingdi Yua4898752013-10-15 20:31:37 -070068};
69
70#endif // ADDCONTACTPANEL_H