1ce968135Sopenharmony_ci/*
2ce968135Sopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd.
3ce968135Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4ce968135Sopenharmony_ci * you may not use this file except in compliance with the License.
5ce968135Sopenharmony_ci * You may obtain a copy of the License at
6ce968135Sopenharmony_ci *
7ce968135Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8ce968135Sopenharmony_ci *
9ce968135Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10ce968135Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11ce968135Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12ce968135Sopenharmony_ci * See the License for the specific language governing permissions and
13ce968135Sopenharmony_ci * limitations under the License.
14ce968135Sopenharmony_ci */
15ce968135Sopenharmony_ci#ifndef WALLPAPER_SERVICES_WALLPAPER_COMMON_H
16ce968135Sopenharmony_ci#define WALLPAPER_SERVICES_WALLPAPER_COMMON_H
17ce968135Sopenharmony_ci
18ce968135Sopenharmony_ci#include <string>
19ce968135Sopenharmony_ci
20ce968135Sopenharmony_ci#include "errors.h"
21ce968135Sopenharmony_ci
22ce968135Sopenharmony_cinamespace OHOS {
23ce968135Sopenharmony_cinamespace WallpaperMgrService {
24ce968135Sopenharmony_ci#define WALLPAPER_SERVICE_NAME "WallpaperMgrService"
25ce968135Sopenharmony_cistatic const std::string WALLPAPER_BUNDLE_NAME = "ohos";
26ce968135Sopenharmony_cistatic const std::string WALLPAPER_PERMISSION_NAME_GET_WALLPAPER = "ohos.permission.GET_WALLPAPER";
27ce968135Sopenharmony_cistatic const std::string WALLPAPER_PERMISSION_NAME_SET_WALLPAPER = "ohos.permission.SET_WALLPAPER";
28ce968135Sopenharmony_cistatic const std::string WALLPAPER_PERMISSION_NAME_CAPTURE_SCREEN = "ohos.permission.CAPTURE_SCREEN";
29ce968135Sopenharmony_ci
30ce968135Sopenharmony_cistatic const std::string TEST_LABEL = "test label";
31ce968135Sopenharmony_cistatic const std::string TEST_DESCRIPTION = "test description";
32ce968135Sopenharmony_ci
33ce968135Sopenharmony_cistruct ApiInfo {
34ce968135Sopenharmony_ci    bool needException;
35ce968135Sopenharmony_ci    bool isSystemApi;
36ce968135Sopenharmony_ci};
37ce968135Sopenharmony_ci
38ce968135Sopenharmony_cienum WallpaperModule {
39ce968135Sopenharmony_ci    WALLPAPER_MODULE_SERVICE_ID = 0x07,
40ce968135Sopenharmony_ci};
41ce968135Sopenharmony_ci// time error offset, used only in this file.
42ce968135Sopenharmony_ciconstexpr ErrCode WALLPAPER_ERR_OFFSET = ErrCodeOffset(SUBSYS_SMALLSERVICES, WALLPAPER_MODULE_SERVICE_ID);
43ce968135Sopenharmony_ci
44ce968135Sopenharmony_cienum ErrorCode : int32_t {
45ce968135Sopenharmony_ci    E_OK = WALLPAPER_ERR_OFFSET,
46ce968135Sopenharmony_ci    E_SA_DIED,
47ce968135Sopenharmony_ci    E_READ_PARCEL_ERROR,
48ce968135Sopenharmony_ci    E_WRITE_PARCEL_ERROR,
49ce968135Sopenharmony_ci    E_PUBLISH_FAIL,
50ce968135Sopenharmony_ci    E_TRANSACT_ERROR,
51ce968135Sopenharmony_ci    E_DEAL_FAILED,
52ce968135Sopenharmony_ci    E_PARAMETERS_INVALID,
53ce968135Sopenharmony_ci    E_SET_RTC_FAILED,
54ce968135Sopenharmony_ci    E_NOT_FOUND,
55ce968135Sopenharmony_ci    E_NO_PERMISSION,
56ce968135Sopenharmony_ci    E_FILE_ERROR,
57ce968135Sopenharmony_ci    E_IMAGE_ERRCODE,
58ce968135Sopenharmony_ci    E_NO_MEMORY,
59ce968135Sopenharmony_ci    E_NOT_SYSTEM_APP,
60ce968135Sopenharmony_ci    E_USER_IDENTITY_ERROR,
61ce968135Sopenharmony_ci    E_CHECK_DESCRIPTOR_ERROR,
62ce968135Sopenharmony_ci    E_UNKNOWN,
63ce968135Sopenharmony_ci};
64ce968135Sopenharmony_ciusing JsCallbackOffset = bool (*)(int32_t, int32_t);
65ce968135Sopenharmony_ci} // namespace WallpaperMgrService
66ce968135Sopenharmony_ci} // namespace OHOS
67ce968135Sopenharmony_ci
68ce968135Sopenharmony_ci#endif // WALLPAPER_SERVICES_WALLPAPER_COMMON_H