• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "extension_ability_info.h"
23 #include "iremote_broker.h"
24 
25 namespace OHOS {
26 namespace AppExecFwk {
27 class IBundleResource : public IRemoteBroker {
28 public:
29     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.bundleManager.BundleResource");
30 
31     virtual ErrCode GetBundleResourceInfo(const std::string &bundleName, const uint32_t flags,
32         BundleResourceInfo &bundleResourceInfo, const int32_t appIndex = 0)
33     {
34         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
35     }
36 
37     virtual ErrCode GetLauncherAbilityResourceInfo(const std::string &bundleName, const uint32_t flags,
38         std::vector<LauncherAbilityResourceInfo> &launcherAbilityResourceInfo, const int32_t appIndex = 0)
39     {
40         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
41     }
42 
GetAllBundleResourceInfo(const uint32_t flags,std::vector<BundleResourceInfo> & bundleResourceInfos)43     virtual ErrCode GetAllBundleResourceInfo(const uint32_t flags,
44         std::vector<BundleResourceInfo> &bundleResourceInfos)
45     {
46         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
47     }
48 
GetAllLauncherAbilityResourceInfo(const uint32_t flags,std::vector<LauncherAbilityResourceInfo> & launcherAbilityResourceInfos)49     virtual ErrCode GetAllLauncherAbilityResourceInfo(const uint32_t flags,
50         std::vector<LauncherAbilityResourceInfo> &launcherAbilityResourceInfos)
51     {
52         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
53     }
54 
AddResourceInfoByBundleName(const std::string & bundleName,const int32_t userId)55     virtual ErrCode AddResourceInfoByBundleName(const std::string &bundleName, const int32_t userId)
56     {
57         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
58     }
59 
AddResourceInfoByAbility(const std::string & bundleName,const std::string & moduleName,const std::string & abilityName,const int32_t userId)60     virtual ErrCode AddResourceInfoByAbility(const std::string &bundleName, const std::string &moduleName,
61         const std::string &abilityName, const int32_t userId)
62     {
63         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
64     }
65 
DeleteResourceInfo(const std::string & key)66     virtual ErrCode DeleteResourceInfo(const std::string &key)
67     {
68         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
69     }
70 
71     virtual ErrCode GetExtensionAbilityResourceInfo(const std::string &bundleName,
72         const ExtensionAbilityType extensionAbilityType, const uint32_t flags,
73         std::vector<LauncherAbilityResourceInfo> &extensionAbilityResourceInfo, const int32_t appIndex = 0)
74     {
75         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
76     }
77 };
78 } // AppExecFwk
79 } // OHOS
80 #endif // FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_BUNDLE_RESOURCE_INTERFACE_H
81