blob: f6776c092b2c9cb5586f97fec989d65a1406c5a0 [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 Yu0b82a4e2013-10-18 11:29:25 -070020#include "contact-manager.h"
Yingdi Yud59b5932013-10-16 13:16:49 -070021#endif
22
Yingdi Yua4898752013-10-15 20:31:37 -070023namespace Ui {
24class AddContactPanel;
25}
26
Yingdi Yuc29fb982013-10-20 19:43:10 -070027Q_DECLARE_METATYPE(ndn::Name)
28
29Q_DECLARE_METATYPE(EndorseCertificate)
30
Yingdi Yua4898752013-10-15 20:31:37 -070031class AddContactPanel : public QDialog
32{
Yingdi Yu0b82a4e2013-10-18 11:29:25 -070033 Q_OBJECT
Yingdi Yua4898752013-10-15 20:31:37 -070034
35public:
Yingdi Yu0b82a4e2013-10-18 11:29:25 -070036 explicit AddContactPanel(ndn::Ptr<ContactManager> contactManager,
37 QWidget *parent = 0);
38
39 ~AddContactPanel();
Yingdi Yua4898752013-10-15 20:31:37 -070040
Yingdi Yud59b5932013-10-16 13:16:49 -070041private slots:
42 void
43 onCancelClicked();
44
45 void
46 onSearchClicked();
47
48 void
49 onAddClicked();
50
Yingdi Yuaa8d7692013-10-18 17:05:02 -070051 void
Yingdi Yuc29fb982013-10-20 19:43:10 -070052 selfEndorseCertificateFetched(const EndorseCertificate& endorseCertificate);
53
54 void
55 selfEndorseCertificateFetchFailed(const ndn::Name& identity);
Yingdi Yuaa8d7692013-10-18 17:05:02 -070056
Yingdi Yua4898752013-10-15 20:31:37 -070057private:
Yingdi Yud59b5932013-10-16 13:16:49 -070058 Ui::AddContactPanel *ui;
Yingdi Yuaa8d7692013-10-18 17:05:02 -070059 ndn::Name m_searchIdentity;
Yingdi Yu0b82a4e2013-10-18 11:29:25 -070060 ndn::Ptr<ContactManager> m_contactManager;
Yingdi Yuc29fb982013-10-20 19:43:10 -070061 WarningDialog* m_warningDialog;
Yingdi Yua4898752013-10-15 20:31:37 -070062};
63
64#endif // ADDCONTACTPANEL_H