bug+codestyle: Fix compile bugs and adjust code style

Change-Id: I008bb538441c099fa25b8b967fbf23ffce13a220
diff --git a/src/browse-contact-dialog.hpp b/src/browse-contact-dialog.hpp
new file mode 100644
index 0000000..c1250a8
--- /dev/null
+++ b/src/browse-contact-dialog.hpp
@@ -0,0 +1,94 @@
+/* -*- 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 CHRONOS_BROWSE_CONTACT_DIALOG_HPP
+#define CHRONOS_BROWSE_CONTACT_DIALOG_HPP
+
+#include <QDialog>
+#include <QStringListModel>
+#include <QCloseEvent>
+#include <QTableWidgetItem>
+
+#ifndef Q_MOC_RUN
+#include <ndn-cxx/security/identity-certificate.hpp>
+#include <boost/thread/locks.hpp>
+#include <boost/thread/recursive_mutex.hpp>
+#endif
+
+namespace Ui {
+class BrowseContactDialog;
+}
+
+namespace chronos {
+
+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;
+};
+
+} // namespace chronos
+
+#endif // CHRONOS_BROWSE_CONTACT_DIALOG_HPP