1 /*
2  * Copyright (c) 2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_BUNDLE_RESOURCE_INTERFACE_H
17 #define FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_BUNDLE_RESOURCE_INTERFACE_H
18 
19 #include "appexecfwk_errors.h"
20 #include "bundle_resource/bundle_resource_info.h"
21 #include "bundle_resource/launcher_ability_resource_info.h"
22 #include "iremote_broker.h"
23 
24 namespace OHOS {
25 namespace AppExecFwk {
26 class IBundleResource : public IRemoteBroker {
27 public:
28     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.bundleManager.BundleResource");
29 
30     virtual ErrCode GetBundleResourceInfo(const std::string &bundleName, const uint32_t flags,
31         BundleResourceInfo &bundleResourceInfo, const int32_t appIndex = 0)
32     {
33         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
34     }
35 
36     virtual ErrCode GetLauncherAbilityResourceInfo(const std::string &bundleName, const uint32_t flags,
37         std::vector<LauncherAbilityResourceInfo> &launcherAbilityResourceInfo, const int32_t appIndex = 0)
38     {
39         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
40     }
41 
GetAllBundleResourceInfo(const uint32_t flags,std::vector<BundleResourceInfo> & bundleResourceInfos)42     virtual ErrCode GetAllBundleResourceInfo(const uint32_t flags,
43         std::vector<BundleResourceInfo> &bundleResourceInfos)
44     {
45         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
46     }
47 
GetAllLauncherAbilityResourceInfo(const uint32_t flags,std::vector<LauncherAbilityResourceInfo> & launcherAbilityResourceInfos)48     virtual ErrCode GetAllLauncherAbilityResourceInfo(const uint32_t flags,
49         std::vector<LauncherAbilityResourceInfo> &launcherAbilityResourceInfos)
50     {
51         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
52     }
53 
AddResourceInfoByBundleName(const std::string & bundleName,const int32_t userId)54     virtual ErrCode AddResourceInfoByBundleName(const std::string &bundleName, const int32_t userId)
55     {
56         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
57     }
58 
AddResourceInfoByAbility(const std::string & bundleName,const std::string & moduleName,const std::string & abilityName,const int32_t userId)59     virtual ErrCode AddResourceInfoByAbility(const std::string &bundleName, const std::string &moduleName,
60         const std::string &abilityName, const int32_t userId)
61     {
62         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
63     }
64 
DeleteResourceInfo(const std::string & key)65     virtual ErrCode DeleteResourceInfo(const std::string &key)
66     {
67         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
68     }
69 };
70 } // AppExecFwk
71 } // OHOS
72 #endif // FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_BUNDLE_RESOURCE_INTERFACE_H
73