#ifndef KMINSTALLMAIN_H
#define KMINSTALLMAIN_H

#include <dbus/dbus.h>
#include <sys/stat.h> // 包含 chmod 函数的头文件

#include <cctype>     // 包含 isupper 函数
#include <cstdlib>    // 用于 std::system 函数
#include <functional> // 进度条函数
#include <initializer_list>
#include <iomanip> // For std::fixed and std::setprecision
#include <set>
#include <sstream>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#include "app/KMSubCommand.h"
#include "common/KMContext.h"
#include "common/KMEnv.h"
#include "common/KMFolder.h"
#include "common/KMInstance.h"
#include "common/KMJsonHelper.h"
#include "common/KMOSTreeHandler.h"
#include "common/KMOption.h"
#include "common/KMOptions.h"
#include "common/KMParseDeploy.h"
#include "common/kmtranslation.h"
#include "third-party/simpleini/SimpleIni.h"
#include "common/KMPackageManager.h"
#include "common/KMParseSummaryJson.h"

using namespace std;

/**
 * @brief 开明安装子命令类
 *
 * @authors yushuoqi
 * @example 在线安装: sudo kaiming install top.openkylin.Music
 */
class KMInstall : public KMSubCommand
{
    DECLARE_DYNCREATE(KMInstall);

public:
    KMInstall();
    virtual ~KMInstall();

    int despose(int argc, char **argv) override;
    void init();
    int start(const vector<string> &vectorAppIds);
    int offlineInstall(const vector<string> &vectorAppIds);

private:

    /** 保留插件相关代码 */
    const char **getGLDrivers();
    bool getHaveIntelGPU();
    GHashTable *loadKernelModuleList();
    bool getHaveKernelModule(const char *moduleName);
    const char *getGtkTheme();

private:
    class Options;
    class Private;
    std::shared_ptr<Private> d;
};

#endif // KMINSTALLMAIN_H
