/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/*
 * Copyright (c) 2020, Regents of the University of California
 *
 * BSD license, See the LICENSE file for more information
 *
 * Author: Yingdi Yu <yingdi@cs.ucla.edu>
 *         Qiuhan Ding <qiuhanding@cs.ucla.edu>
 */

#ifndef CHRONOCHAT_CONTROLLER_BACKEND_HPP
#define CHRONOCHAT_CONTROLLER_BACKEND_HPP

#include <QString>
#include <QThread>
#include <QStringList>
#include <QMutex>

#ifndef Q_MOC_RUN
#include "common.hpp"
#include "contact-manager.hpp"
#include "invitation.hpp"
#include <ndn-cxx/security/key-chain.hpp>
#include <ndn-cxx/ims/in-memory-storage-persistent.hpp>
#include <ndn-cxx/security/validator-null.hpp>
#include <ndn-cxx/face.hpp>
#include <boost/thread.hpp>
#include <mutex>
#endif

namespace chronochat {

class ControllerBackend : public QThread
{
  Q_OBJECT

public:
  ControllerBackend(QObject* parent = nullptr);

  ~ControllerBackend();

  ContactManager*
  getContactManager()
  {
    return &m_contactManager;
  }

protected:
  void
  run();

private:
  void
  setInvitationListener();

  ndn::Name
  getInvitationRoutingPrefix();

  void
  onInvitationInterest(const ndn::Name& prefix, const ndn::Interest& interest,
                       size_t routingPrefixOffset);

  void
  onInvitationRequestInterest(const ndn::Name& prefix, const ndn::Interest& interest,
                              size_t routingPrefixOffset);

  void
  onInvitationRegisterFailed(const Name& prefix, const std::string& failInfo);

  void
  onInvitationValidated(const Interest& interest);

  void
  onInvitationValidationFailed(const Interest& interest,
                               const ndn::security::ValidationError& failureInfo);

  void
  onLocalPrefix(const ndn::ConstBufferPtr& data);

  void
  onLocalPrefixError(uint32_t code, const std::string& msg);

  void
  updateLocalPrefix(const Name& localPrefix);

  void
  onRequestResponse(const Interest& interest, const Data& data);

  void
  onRequestTimeout(const Interest& interest, int& resendTimes);

signals:
  void
  identityUpdated(const QString& identity);

  void
  localPrefixUpdated(const QString& localPrefix);

  void
  invitationValidated(QString alias, QString chatroom, ndn::Name invitationINterest);

  void
  invitationRequestReceived(QString alias, QString chatroom, ndn::Name invitationRequestInterest);

  void
  startChatroomOnInvitation(chronochat::Invitation invitation, bool secured);

  void
  startChatroom(const QString& chatroomName, bool secured);

  void
  invitationRequestResult(const std::string& msg);

  void
  nfdError();

public slots:
  void
  shutdown();

  void
  addChatroom(QString chatroom);

  void
  removeChatroom(QString chatroom);

  void
  onUpdateLocalPrefixAction();

  void
  onIdentityChanged(const QString& identity);

  void
  onInvitationResponded(const ndn::Name& invitationName, bool accepted);

  void
  onInvitationRequestResponded(const ndn::Name& invitationName, bool accepted);

  void
  onSendInvitationRequest(const QString& chatroomName, const QString& prefix);

  void
  onNfdReconnect();

private slots:
  void
  onContactIdListReady(const QStringList& list);

private:
  bool m_isNfdConnected;
  bool m_shouldResume;
  ndn::Face m_face;

  Name m_identity;  //TODO: set/get

  Name m_localPrefix;

  // Contact Manager
  ContactManager m_contactManager;

  // Security related;
  ndn::KeyChain m_keyChain;
  shared_ptr<ndn::security::Validator> m_validator;
  ndn::security::ValidatorNull m_nullValidator;

  // RegisteredPrefixId
  ndn::ScopedRegisteredPrefixHandle m_invitationListenerHandle;
  ndn::ScopedRegisteredPrefixHandle m_requestListenerHandle;

  // ChatRoomList
  QStringList m_chatDialogList;

  QMutex m_mutex;
  std::mutex m_resumeMutex;
  std::mutex m_nfdConnectionMutex;

  ndn::InMemoryStoragePersistent m_ims;
};

} // namespace chronochat

#endif // CHRONOCHAT_CONTROLLER_BACKEND_HPP
