/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
 * Copyright (c) 2013-2017, Regents of the University of California.
 *
 * This file is part of ChronoShare, a decentralized file sharing application over NDN.
 *
 * ChronoShare is free software: you can redistribute it and/or modify it under the terms
 * of the GNU General Public License as published by the Free Software Foundation, either
 * version 3 of the License, or (at your option) any later version.
 *
 * ChronoShare is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 * PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 *
 * You should have received copies of the GNU General Public License along with
 * ChronoShare, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
 *
 * See AUTHORS.md for complete list of ChronoShare authors and contributors.
 */

#ifndef CHRONOSHARE_GUI_CHRONOSHAREGUI_HPP
#define CHRONOSHARE_GUI_CHRONOSHAREGUI_HPP

#include "core/chronoshare-common.hpp"

#include <QApplication>
#include <QCloseEvent>
#include <QDebug>
#include <QDir>
#include <QFileDialog>
#include <QMenu>
#include <QMessageBox>
#include <QProcess>
#include <QSettings>
#include <QSystemTrayIcon>
#include <QtWidgets>

#ifndef Q_MOC_RUN
#include "dispatcher.hpp"
#include "fs-watcher.hpp"
#include "server.hpp"
#endif // Q_MOC_RUN

#if __APPLE__ && HAVE_SPARKLE
#define SPARKLE_SUPPORTED 1
#include "sparkle-auto-update.hpp"
#endif

#include <thread>

namespace ndn {
namespace chronoshare {

class ChronoShareGui : public QDialog
{
  Q_OBJECT

public:
  // constructor
  explicit ChronoShareGui(QWidget* parent = 0);

  // destructor
  ~ChronoShareGui();

private slots:
  // open the shared folder
  void
  openSharedFolder();

  void
  openFile();

  void
  openInWebBrowser();

  void
  updateRecentFilesMenu();

  // open file dialog
  void
  openFileDialog();

  // handle left click of tray icon
  void
  trayIconClicked(QSystemTrayIcon::ActivationReason reason);

  // view chronoshare settings
  void
  viewSettings();

  // change chronoshare settings
  void
  changeSettings();

  void
  onCheckForUpdates();

private:
  void
  checkFileAction(const std::string&, int, int);
  // create actions that result from clicking a menu option
  void
  createActionsAndMenu();

  // create tray icon
  void
  createTrayIcon();

  // set icon image
  void
  setIcon();

  // load persistent settings
  bool
  loadSettings();

  // save persistent settings
  void
  saveSettings();

  // prompt user dialog box
  void
  openMessageBox(QString title, QString text);

  // overload
  void
  openMessageBox(QString title, QString text, QString infotext);

  // capture close event
  void
  closeEvent(QCloseEvent* event);

  // starts/restarts fs watcher and dispatcher
  void
  startBackend(bool restart = false);

private:
  QSystemTrayIcon* m_trayIcon; // tray icon
  QMenu* m_trayIconMenu;       // tray icon menu

  QAction* m_openFolder;   // open the shared folder action
  QAction* m_viewSettings; // chronoShare settings
  QAction* m_changeFolder; // change the shared folder action
  QAction* m_quitProgram;  // quit program action
  QAction* m_checkForUpdates;
  QAction* m_openWeb;
  QMenu* m_recentFilesMenu;
  QAction* m_fileActions[5];

  QString m_dirPath;          // shared directory
  QString m_username;         // username
  QString m_sharedFolderName; // shared folder name

  http::server::server* m_httpServer;
  std::thread m_httpServerThread;

  QLabel* labelUsername;
  QPushButton* button;
  QLabel* labelSharedFolder;
  QLabel* labelSharedFolderPath;
  QLineEdit* editUsername;
  QLineEdit* editSharedFolder;
  QLineEdit* editSharedFolderPath;
  QLabel* label;
  QVBoxLayout* mainLayout;

#ifdef SPARKLE_SUPPORTED
  AutoUpdate* m_autoUpdate;
#endif
  // QString m_settingsFilePath; // settings file path
  // QString m_settings;

  std::thread m_chronoshareThread;
  std::unique_ptr<boost::asio::io_service> m_ioService;
  std::unique_ptr<Face> m_face;
  std::unique_ptr<FsWatcher> m_watcher;
  std::unique_ptr<Dispatcher> m_dispatcher;
};

} // namespace chronoshare
} // namespace ndn

#endif // CHRONOSHARE_GUI_CHRONOSHAREGUI_HPP
