/* -*- 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 ADDCONTACTPANEL_H
#define ADDCONTACTPANEL_H

#include <QDialog>
#include <QMetaType>
#include "warningdialog.h"

#ifndef Q_MOC_RUN
#include "endorse-certificate.h"
#include "profile.h"
#include "contact-manager.h"
#endif

namespace Ui {
class AddContactPanel;
}

Q_DECLARE_METATYPE(ndn::Name)

Q_DECLARE_METATYPE(chronos::EndorseCertificate)

Q_DECLARE_METATYPE(ndn::Data)

class AddContactPanel : public QDialog
{
  Q_OBJECT

public:
  explicit AddContactPanel(ndn::shared_ptr<chronos::ContactManager> contactManager,
                           QWidget *parent = 0);

  ~AddContactPanel();

private:
  void
  displayContactInfo();

  bool
  isCorrectName(const ndn::Name& name);

  // static bool
  // isSameBlob(const ndn::Blob& blobA, const ndn::Blob& blobB);

private slots:
  void
  onCancelClicked();
  
  void
  onSearchClicked();

  void
  onAddClicked();

  void
  selfEndorseCertificateFetched(const chronos::EndorseCertificate& endorseCertificate);

  void
  selfEndorseCertificateFetchFailed(const ndn::Name& identity);

  void
  onContactKeyFetched(const chronos::EndorseCertificate& endorseCertificate);

  void
  onContactKeyFetchFailed(const ndn::Name& identity);

  void
  onCollectEndorseFetched(const ndn::Data& data);

  void
  onCollectEndorseFetchFailed(const ndn::Name& identity);

signals:
  void
  newContactAdded();

private:

  Ui::AddContactPanel *ui;
  ndn::Name m_searchIdentity;
  ndn::shared_ptr<chronos::ContactManager> m_contactManager;
  WarningDialog* m_warningDialog;
  ndn::shared_ptr<chronos::EndorseCertificate> m_currentEndorseCertificate;
  ndn::shared_ptr<ndn::Data> m_currentCollectEndorse;
  bool m_currentEndorseCertificateReady;
  bool m_currentCollectEndorseReady;
};

#endif // ADDCONTACTPANEL_H
