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