/**
 * \file mzml2mzcborcli.h
 * \date 21/11/2025
 * \author Olivier Langella
 * \brief CLI tool to convert mzML to mzCBOR
 */


/*******************************************************************************
 * Copyright (c) 2025 Olivier Langella <Olivier.Langella@universite-paris-saclay.fr>.
 *
 * This file is part of the PAPPSOms++ library.
 *
 *     PAPPSOms++ 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.
 *
 *     PAPPSOms++ 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 a copy of the GNU General Public License
 *     along with PAPPSOms++.  If not, see <http://www.gnu.org/licenses/>.
 *
 ******************************************************************************/


#pragma once

#include <QDebug>
#include <QFileInfo>

#include <QObject>
#include <QCoreApplication>
#include "pappsomspp/core/processing/uimonitor/uimonitorinterface.h"

class Mzml2MzcborCli : public QObject
{
  Q_OBJECT
  public:
  /**
   * Default constructor
   */
  explicit Mzml2MzcborCli(QObject *parent = 0);

  /**
   * Destructor
   */
  virtual ~Mzml2MzcborCli();
  /////////////////////////////////////////////////////////////
  /// Call this to quit application
  /////////////////////////////////////////////////////////////
  void quit();

  signals:
  /////////////////////////////////////////////////////////////
  /// Signal to finish, this is connected to Application Quit
  /////////////////////////////////////////////////////////////
  void finished();

  public slots:
  /////////////////////////////////////////////////////////////
  /// This is the slot that gets called from main to start everything
  /// but, everthing is set up in the Constructor
  /////////////////////////////////////////////////////////////
  void run();

  /////////////////////////////////////////////////////////////
  /// slot that get signal when that application is about to quit
  /////////////////////////////////////////////////////////////
  void aboutToQuitApp();

  private:
  void convertAllMzmlInDir(pappso::UiMonitorInterface &monitor,
                           const QFileInfo &input_dir,
                           const QString &output_str,
                           bool write_index);

  private:
  QCoreApplication *app;
};
