#pragma once

#include <memory>
#include <filesystem>

#include "AbstractApp.h"
#include "AudioManager.h"
#include "FileLogger.h"
#include "DatabaseManager.h"
#include "NetworkManager.h"
#include "CommandLineArgs.h"

class MainApplication : public AbstractApp
{
public:
    MainApplication();

    ~MainApplication();

    static std::unique_ptr<MainApplication> Create();

    void initialize(CommandLineArgsUPtr commandLineArgs, std::unique_ptr<IApplicationContext> applicationContext=nullptr);

    void run();

    void shutDown();

    CommandLineArgs* getCommandLineArgs() const;

private:
    void runServer();

    void playAudio();

    void convertDocument(const std::string& inputPath, const std::string& outputPath);

    CommandLineArgsUPtr mCommandLineArgs;
    DatabaseManagerPtr mDatabaseManager;
    NetworkManagerUPtr mNetworkManager;
    AudioManagerUPtr mAudioManager;
};

using MainApplicationPtr = std::shared_ptr<MainApplication>;
