major change: Add security support & Adjust GUI
Change-Id: I7abef37169dec1ef4b68e760dee5214c147c1915
diff --git a/src/browse-contact-dialog.h b/src/browse-contact-dialog.h
new file mode 100644
index 0000000..f13770e
--- /dev/null
+++ b/src/browse-contact-dialog.h
@@ -0,0 +1,90 @@
+/* -*- 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 BROWSE_CONTACT_DIALOG_H
+#define BROWSE_CONTACT_DIALOG_H
+
+#include <QDialog>
+#include <QStringListModel>
+#include <QCloseEvent>
+#include <QTableWidgetItem>
+
+#ifndef Q_MOC_RUN
+#include <ndn-cpp-dev/security/identity-certificate.hpp>
+#include <boost/thread/locks.hpp>
+#include <boost/thread/recursive_mutex.hpp>
+#endif
+
+namespace Ui {
+class BrowseContactDialog;
+}
+
+class BrowseContactDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ explicit
+ BrowseContactDialog(QWidget *parent = 0);
+
+ ~BrowseContactDialog();
+
+protected:
+ void
+ closeEvent(QCloseEvent *e);
+
+private slots:
+ void
+ onSelectionChanged(const QItemSelection &selected,
+ const QItemSelection &deselected);
+
+ void
+ onAddClicked();
+
+ void
+ onDirectAddClicked();
+
+public slots:
+ void
+ onIdCertNameListReady(const QStringList& certNameList);
+
+ void
+ onNameListReady(const QStringList& nameList);
+
+ void
+ onIdCertReady(const ndn::IdentityCertificate& idCert);
+
+signals:
+ void
+ directAddClicked();
+
+ void
+ fetchIdCert(const QString& certName);
+
+ void
+ addContact(const QString& qCertName);
+
+private:
+
+ typedef boost::recursive_mutex RecLock;
+ typedef boost::unique_lock<RecLock> UniqueRecLock;
+
+ Ui::BrowseContactDialog *ui;
+
+ QTableWidgetItem* m_typeHeader;
+ QTableWidgetItem* m_valueHeader;
+
+ QStringListModel* m_contactListModel;
+
+ QStringList m_contactNameList;
+ QStringList m_contactCertNameList;
+};
+
+#endif // BROWSE_CONTACT_DIALOG_H