// Copyright (C) 2026 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

#include <utils/id.h>

namespace HarmonyOs::Constants {

inline constexpr char HARMONYOS_SETTINGS_ID[] = "ZZ.HarmonyOS Configurations";
inline constexpr char HARMONYOS_TOOLCHAIN_TYPEID[] = "Qt4ProjectManager.ToolChain.HarmonyOS";
inline constexpr char HARMONYOS_QT_TYPE[] = "Qt4ProjectManager.QtVersion.HarmonyOS";

inline constexpr char HARMONYOS_DEVICE_TYPE[] = "HarmonyOS.Device.Type";
inline constexpr char HARMONYOS_BUILD_DEVICE_TYPE[] = "HarmonyOS.BuildDevice.Type";

// The sshd of the environment that carries the native toolchain, not the system one.
inline constexpr int HARMONYOS_SSH_PORT = 8022;

// The port the application's own debug server listens on, forwarded to the host.
inline constexpr int HARMONYOS_DEBUG_PORT = 8123;
// The port on the device that says a launch is being debugged: an hdc reverse forward
// leaves a listener there for as long as the debug run lasts, and the application asks
// by connecting to it.
inline constexpr int HARMONYOS_GATE_PORT = 8124;
inline constexpr char HARMONYOS_DEBUG_SERVER_PACKAGE[] = "lldbserver";
inline constexpr char HARMONYOS_DEBUG_PLUGIN[] = "qtcdebug";
// Where the packed debug server ends up in the application's own namespace, which is the
// only place on the device a binary of ours may be executed from.
inline constexpr char HARMONYOS_DEBUG_SERVER_PATH[] = "/data/service/hnp/bin/lldb-server";
// The library that holds an application until the debugger releases it, and the byte it
// spins on.
inline constexpr char HARMONYOS_WAIT_LIBRARY[] = "libqtcwait.so";
inline constexpr char HARMONYOS_WAIT_FLAG[] = "qtc_waitForDebugger";

// The port a run offers the application on, when the package holds the runner instead of
// the application: a reverse forward puts Qt Creator's own listener there, and the runner
// asks for what to run by connecting to it.
inline constexpr int HARMONYOS_CHANNEL_PORT = 8126;
// The library that takes the application's place in the package and maps whatever the
// channel offers, so that a run needs no package of its own.
inline constexpr char HARMONYOS_RUNNER_LIBRARY[] = "libqtcrunner.so";

inline const Utils::Id HARMONYOS_SERIAL_NUMBER = "HarmonyOS.SerialNumber";

inline constexpr char HARMONYOS_DEPLOY_CONFIG_ID[] = "HarmonyOS.DeployConfiguration";
inline constexpr char HARMONYOS_MAKE_HAP_STEP_ID[] = "HarmonyOS.MakeHapStep";
inline constexpr char HARMONYOS_PACKAGE_HAP_STEP_ID[] = "HarmonyOS.PackageHapStep";
inline constexpr char HARMONYOS_SIGN_HAP_STEP_ID[] = "HarmonyOS.SignHapStep";
inline constexpr char HARMONYOS_INSTALL_HAP_STEP_ID[] = "HarmonyOS.InstallHapStep";
inline constexpr char HARMONYOS_RUNCONFIG_ID[] = "HarmonyOS.RunConfiguration";

// The ability and module the Qt for HarmonyOS template generates; used to launch.
inline constexpr char HARMONYOS_ABILITY_NAME[] = "QAbility";
inline constexpr char HARMONYOS_MODULE_NAME[] = "entry";

// Kit
inline constexpr char HARMONYOS_KIT_SDK[] = "HarmonyOS.SDK";
inline constexpr char harmonyOsConfigurationId[] = "HarmonyOSConfiguration";

// Environment variables consumed by the ohos-clang mkspec and the deployment tools
inline constexpr char NATIVE_OHOS_SDK_ENV_VAR[] = "NATIVE_OHOS_SDK";
inline constexpr char DEVECO_SDK_HOME_ENV_VAR[] = "DEVECO_SDK_HOME";
inline constexpr char HVIGOR_ENV_VAR[] = "QT_HARMONYOS_HVIGOR";

// harmonydeployqt reads these to sign the .hap. The values come from the DevEco
// signing configuration in the project's harmonyos-build/build-profile.json5.
inline constexpr char SIGNING_CERT_PATH_ENV_VAR[] = "QT_HARMONYOS_SIGNING_CERT_PATH";
inline constexpr char SIGNING_PROFILE_ENV_VAR[] = "QT_HARMONYOS_SIGNING_PROFILE";
inline constexpr char SIGNING_STORE_FILE_ENV_VAR[] = "QT_HARMONYOS_SIGNING_STORE_FILE";
inline constexpr char SIGNING_KEY_ALIAS_ENV_VAR[] = "QT_HARMONYOS_SIGNING_KEY_ALIAS";
inline constexpr char SIGNING_KEY_PASSWORD_ENV_VAR[] = "QT_HARMONYOS_SIGNING_KEY_PASSWORD";
inline constexpr char SIGNING_STORE_PASSWORD_ENV_VAR[] = "QT_HARMONYOS_SIGNING_STORE_PASSWORD";
inline constexpr char SIGNING_ALG_ENV_VAR[] = "QT_HARMONYOS_SIGNING_ALG";

} // namespace HarmonyOs::Constants
