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

#ifndef CHRONOCHAT_DISCOVERY_PANEL_HPP
#define CHRONOCHAT_DISCOVERY_PANEL_HPP

#include <QDialog>
#include <QStringListModel>

#ifndef Q_MOC_RUN
#include "chatroom-info.hpp"
#endif

namespace Ui {
class DiscoveryPanel;
}

namespace chronochat {

class DiscoveryPanel : public QDialog
{
  Q_OBJECT

public:
  explicit
  DiscoveryPanel(QWidget* parent = 0);

  virtual
  ~DiscoveryPanel();

private:
  void
  resetPanel();

  void
  refreshPanel();

signals:
  /**
   * @brief get chatroom info from discovery backend
   *
   * @param chatroomName the name of chatroom we want to get info from
   */
  void
  waitForChatroomInfo(const QString& chatroomName);

  /**
   * @brief send warning if strange things happen
   *
   * @param msg the message that print in the warning
   */
  void
  warning(const QString& msg);

  /**
   * @brief join the chatroom the user clicked
   *
   * This function will be called if the join button is clicked. The join button is enabled
   * when there is no trust model for the chatroom.
   * The user will join the chatroom he choose directly.
   *
   * @param chatroomName the chatroom to join
   * @param secured if security is enabled in this chatroom
   */
  void
  startChatroom(const QString& chatroomName, bool secured);

public slots:
  /**
   * @brief reset the panel when identity is updated
   *
   */
  void
  onIdentityUpdated(const QString& identity);

  /**
   * @brief print the chatroom list on the panel
   *
   * @param list list of chatroom name get from discovery backend
   */
  void
  onChatroomListReady(const QStringList& list);

  /**
   * @brief print the chatroom info on the panel
   *
   * @param info chatroom info get from discovery backend
   */
  void
  onChatroomInfoReady(const ChatroomInfo& info);

private slots:
  void
  onSelectedChatroomChanged(const QItemSelection& selected,
                     const QItemSelection& deselected);

  void
  onSelectedParticipantChanged(const QItemSelection& selected,
                                const QItemSelection& deselected);

  void
  onJoinClicked();

private:
  Ui::DiscoveryPanel* ui;

  // Models.
  QStringListModel* m_chatroomListModel;
  QStringListModel* m_rosterListModel;

  // Internal data structure.
  QStringList m_chatroomList;
  QStringList m_rosterList;
  QString     m_chatroom;
  QString     m_participant;
};

} // namespace chronochat

#endif // CHRONOCHAT_DISCOVERY_PANEL_HPP
