[feat] add HarmonyOS desktop and mobile clients,issue #117

This commit is contained in:
kunkundi
2026-10-16 00:42:55 +08:00
parent 43a0789c1e
commit 45bf6ec4ee
149 changed files with 11587 additions and 93 deletions
@@ -0,0 +1,30 @@
/*
* @Author: DI JUNKUN
* @Date: 2026-10-15
* Copyright (c) 2026 by DI JUNKUN, All Rights Reserved.
*/
#ifndef _HARMONY_TRAY_H_
#define _HARMONY_TRAY_H_
#include <functional>
#include <string>
namespace crossdesk {
// Constructed and invoked on the shared Slint event thread.
class HarmonyTray {
public:
HarmonyTray(std::function<void()> show, std::function<void()> hide,
std::function<void()> settings, std::function<void()> exit,
const std::string& tooltip, int language);
~HarmonyTray();
bool MinimizeToTray();
void RemoveTrayIcon();
static void Dispatch(const std::string& action);
private:
std::function<void()> show_, hide_, settings_, exit_;
bool active_ = false;
};
}
#endif
@@ -0,0 +1,16 @@
/*
* @Author: DI JUNKUN
* @Date: 2026-10-15
* Copyright (c) 2026 by DI JUNKUN, All Rights Reserved.
*/
#ifndef _WINDOW_STATE_H_
#define _WINDOW_STATE_H_
namespace slint { class Window; }
namespace crossdesk {
// GUI-thread query of the native window focus delivered by Harmony ArkUI.
bool IsHarmonyWindowActive(const slint::Window& window);
}
#endif
@@ -0,0 +1,19 @@
/*
* @Author: DI JUNKUN
* @Date: 2026-10-15
* Copyright (c) 2026 by DI JUNKUN, All Rights Reserved.
*/
#ifndef _HARMONY_AUTOSTART_H_
#define _HARMONY_AUTOSTART_H_
namespace crossdesk {
enum class HarmonyAutostartStatus { checking, enabled, disabled, unsupported, failed };
// ArkTS publishes system state; the GUI reads it without waiting on a service.
HarmonyAutostartStatus GetHarmonyAutostartStatus();
void SetHarmonyAutostartStatus(HarmonyAutostartStatus status);
void RefreshHarmonyAutostartStatus();
}
#endif
@@ -0,0 +1,15 @@
/*
* @Author: DI JUNKUN
* @Date: 2026-10-15
* Copyright (c) 2026 by DI JUNKUN, All Rights Reserved.
*/
#ifndef _SYSTEM_SHORTCUTS_H_
#define _SYSTEM_SHORTCUTS_H_
#include <remote_action.h>
namespace crossdesk {
bool SendHarmonySystemShortcut(ServiceCommandFlag command);
}
#endif