86 lines
1.8 KiB
C
86 lines
1.8 KiB
C
/*----------------------------------------------------------------------------
|
|
* Copyright (c) TJD Technologies Co., Ltd. 2025. All rights reserved.
|
|
*
|
|
* Description: TjdAppStore.h
|
|
*
|
|
* Author: luziquan@ss-tjd.com
|
|
*
|
|
* Create: 2025-03-19
|
|
*--------------------------------------------------------------------------*/
|
|
|
|
#ifndef TJD_APP_STORE_H
|
|
#define TJD_APP_STORE_H
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
#ifdef __cplusplus
|
|
#if __cplusplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
#endif
|
|
|
|
typedef enum
|
|
{
|
|
PKG_OPERATION_TYPE_INSTALL = 0x00,
|
|
PKG_OPERATION_TYPE_UNINSTALL = 0x01,
|
|
} PkgOperationType;
|
|
|
|
|
|
typedef enum
|
|
{
|
|
PKG_STATE_INSTALLED = 0x00,
|
|
PKG_STATE_UNINSTALLED = 0x01,
|
|
PKG_STATE_RUNNING = 0x02,
|
|
} PkgState;
|
|
|
|
/**
|
|
* @brief 操作结果回调
|
|
*
|
|
* @param resultCode 操作结果 , see {@link AppexecfwkErrors}
|
|
* @param resultMessage 操作结果消息 ,为BundleInstallMsg结构体
|
|
*/
|
|
typedef void(*pkgOperationCallback)(const uint8_t resultCode, const void *resultMessage);
|
|
|
|
/**
|
|
* @brief 安装或卸载应用
|
|
*
|
|
* @param type 安装或卸载标识符
|
|
* @param pkgName 应用包名
|
|
* @param isKeepData 卸载时是否保留数据
|
|
* @return bool 操作结果
|
|
*/
|
|
bool TjdAppStorePkgOperation(PkgOperationType type, const char *pkgName, bool isKeepData);
|
|
|
|
/**
|
|
* @brief 查询应用状态
|
|
*
|
|
* @param pkgName 应用包名
|
|
* @param state 应用状态
|
|
* @return bool 查询是否成功
|
|
*/
|
|
bool TjdAppStoreQueryPkgState(const char *pkgName, PkgState *state);
|
|
|
|
/**
|
|
* @brief 更新应用列表的json文件
|
|
*
|
|
* @return bool
|
|
*/
|
|
bool TjdAppStorePkgUpdateList(void);
|
|
|
|
/**
|
|
* @brief 注册应用操作回调
|
|
*
|
|
* @param callback
|
|
*/
|
|
void RegisterPkgOperationCallback(pkgOperationCallback callback);
|
|
|
|
void UnRegisterPkgOperationCallback(pkgOperationCallback callback);
|
|
|
|
#ifdef __cplusplus
|
|
#if __cplusplus
|
|
}
|
|
#endif
|
|
#endif
|
|
#endif |