2026-05-16 13:58:12 +08:00
|
|
|
#pragma once
|
|
|
|
|
#ifndef __WFASSOC_H__
|
|
|
|
|
#define __WFASSOC_H__
|
|
|
|
|
|
2026-05-18 13:33:57 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
#include <cstddef>
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
#else // __cplusplus
|
2026-05-16 13:58:12 +08:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
#include <stdint.h>
|
2026-05-18 13:33:57 +08:00
|
|
|
#endif // __cplusplus
|
2026-05-16 13:58:12 +08:00
|
|
|
|
|
|
|
|
|
2026-05-18 13:33:57 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
using CStyleString = const char*;
|
|
|
|
|
using Token = uint64_t;
|
|
|
|
|
using HICON = void*;
|
|
|
|
|
#else // __cplusplus
|
2026-05-16 13:58:12 +08:00
|
|
|
typedef const char *CStyleString;
|
|
|
|
|
typedef uint64_t Token;
|
2026-05-18 13:33:57 +08:00
|
|
|
typedef void *HICON;
|
|
|
|
|
#endif // __cplusplus
|
2026-05-16 13:58:12 +08:00
|
|
|
|
|
|
|
|
|
2026-05-18 13:33:57 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
enum class Scope : uint32_t {
|
|
|
|
|
User = 0u,
|
|
|
|
|
System = 1u
|
|
|
|
|
};
|
|
|
|
|
enum class View : uint32_t {
|
|
|
|
|
User = 0u,
|
|
|
|
|
System = 1u,
|
|
|
|
|
Hybrid = 2u
|
|
|
|
|
};
|
|
|
|
|
#else // __cplusplus
|
|
|
|
|
typedef uint32_t Scope;
|
|
|
|
|
static const Scope SCOPE_USER = 0u;
|
|
|
|
|
static const Scope SCOPE_SYSTEM = 1u;
|
2026-05-16 13:58:12 +08:00
|
|
|
typedef uint32_t View;
|
2026-05-18 13:33:57 +08:00
|
|
|
static const View VIEW_USER = 0u;
|
|
|
|
|
static const View VIEW_SYSTEM = 1u;
|
|
|
|
|
static const View VIEW_HYBRID = 2u;
|
|
|
|
|
#endif // __cplusplus
|
2026-05-16 13:58:12 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
2026-05-18 13:33:57 +08:00
|
|
|
namespace wfassoc {
|
2026-05-16 13:58:12 +08:00
|
|
|
extern "C" {
|
|
|
|
|
#endif // __cplusplus
|
|
|
|
|
|
|
|
|
|
bool WFStartup(void);
|
|
|
|
|
|
|
|
|
|
bool WFShutdown(void);
|
|
|
|
|
|
|
|
|
|
CStyleString WFGetLastError(void);
|
|
|
|
|
|
|
|
|
|
bool WFHasPrivilege(void);
|
|
|
|
|
|
2026-05-18 13:33:57 +08:00
|
|
|
Token WFInvalidToken(void);
|
|
|
|
|
|
2026-05-16 13:58:12 +08:00
|
|
|
bool WFSchemaCreate(Token *out_schema);
|
|
|
|
|
|
|
|
|
|
bool WFSchemaDestroy(Token in_schema);
|
|
|
|
|
|
|
|
|
|
bool WFSchemaSetIdentifier(Token in_schema, CStyleString in_value);
|
|
|
|
|
|
|
|
|
|
bool WFSchemaSetPath(Token in_schema, CStyleString in_value);
|
|
|
|
|
|
|
|
|
|
bool WFSchemaSetClsid(Token in_schema, CStyleString in_value);
|
|
|
|
|
|
|
|
|
|
bool WFSchemaSetName(Token in_schema, CStyleString in_value);
|
|
|
|
|
|
|
|
|
|
bool WFSchemaSetIcon(Token in_schema, CStyleString in_value);
|
|
|
|
|
|
|
|
|
|
bool WFSchemaSetBehavior(Token in_schema, CStyleString in_value);
|
|
|
|
|
|
|
|
|
|
bool WFSchemaAddStr(Token in_schema, CStyleString in_name, CStyleString in_value);
|
|
|
|
|
|
|
|
|
|
bool WFSchemaAddIcon(Token in_schema, CStyleString in_name, CStyleString in_value);
|
|
|
|
|
|
|
|
|
|
bool WFSchemaAddBehavior(Token in_schema, CStyleString in_name, CStyleString in_value);
|
|
|
|
|
|
|
|
|
|
bool WFSchemaAddExt(Token in_schema,
|
|
|
|
|
CStyleString in_ext,
|
|
|
|
|
CStyleString in_ext_name,
|
|
|
|
|
CStyleString in_ext_icon,
|
|
|
|
|
CStyleString in_ext_behavior);
|
|
|
|
|
|
|
|
|
|
bool WFProgramCreate(Token in_schema, Token *out_program);
|
|
|
|
|
|
|
|
|
|
bool WFProgramDestroy(Token in_program);
|
|
|
|
|
|
2026-05-18 13:33:57 +08:00
|
|
|
bool WFProgramRegister(Token in_program, Scope in_scope);
|
|
|
|
|
|
|
|
|
|
bool WFProgramUnregister(Token in_program, Scope in_scope);
|
|
|
|
|
|
|
|
|
|
bool WFProgramIsRegistered(Token in_program, Scope in_scope, bool *out_is_registered);
|
|
|
|
|
|
|
|
|
|
bool WFProgramLinkExt(Token in_program, Scope in_scope, size_t in_index);
|
|
|
|
|
|
|
|
|
|
bool WFProgramUnlinkExt(Token in_program, Scope in_scope, size_t in_index);
|
2026-05-16 13:58:12 +08:00
|
|
|
|
2026-05-18 13:33:57 +08:00
|
|
|
bool WFProgramQueryExt(Token in_program, View in_view, size_t in_index, Token *out_ext_status);
|
2026-05-16 13:58:12 +08:00
|
|
|
|
2026-05-18 13:33:57 +08:00
|
|
|
bool WFExtStatusDestroy(Token in_ext_status);
|
2026-05-16 13:58:12 +08:00
|
|
|
|
2026-05-18 13:33:57 +08:00
|
|
|
bool WFExtStatuGetName(Token in_ext_status, CStyleString *out_name);
|
2026-05-16 13:58:12 +08:00
|
|
|
|
2026-05-18 13:33:57 +08:00
|
|
|
bool WFExtStatuGetIcon(Token in_ext_status, HICON *out_icon);
|
2026-05-16 13:58:12 +08:00
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
} // extern "C"
|
2026-05-18 13:33:57 +08:00
|
|
|
} // namespace wfassoc
|
2026-05-16 13:58:12 +08:00
|
|
|
#endif // __cplusplus
|
|
|
|
|
|
2026-05-18 13:33:57 +08:00
|
|
|
#endif // __WFASSOC_H__
|