/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/*
 * Copyright (c) 2020, 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 CHRONOCHAT_BROWSE_CONTACT_DIALOG_HPP
#define CHRONOCHAT_BROWSE_CONTACT_DIALOG_HPP

#include <QDialog>
#include <QStringListModel>
#include <QCloseEvent>
#include <QTableWidgetItem>

#ifndef Q_MOC_RUN
#include <ndn-cxx/security/certificate.hpp>
#include <boost/thread/locks.hpp>
#include <boost/thread/recursive_mutex.hpp>
#endif

namespace Ui {
class BrowseContactDialog;
} // namespace Ui

namespace chronochat {

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::security::Certificate& 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 chronochat

#endif // CHRONOCHAT_BROWSE_CONTACT_DIALOG_HPP
