• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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_SERVICES_DBMS_INCLUDE_DISTRIBUTED_BMS_INTERFACE_H
17 #define FOUNDATION_APPEXECFWK_SERVICES_DBMS_INCLUDE_DISTRIBUTED_BMS_INTERFACE_H
18 
19 #include <string>
20 #include <vector>
21 
22 #include "distributed_bundle_info.h"
23 #include "element_name.h"
24 #include "iremote_broker.h"
25 #include "remote_ability_info.h"
26 
27 namespace OHOS {
28 namespace AppExecFwk {
29 class IDistributedBms : public IRemoteBroker {
30 public:
31     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.appexecfwk.IDistributedbms");
32 
33     /**
34      * @brief get remote ability info
35      * @param elementName Indicates the elementName.
36      * @param remoteAbilityInfo Indicates the remote ability info.
37      * @return Returns result code when get remote ability info.
38      */
39     virtual int32_t GetRemoteAbilityInfo(
40         const OHOS::AppExecFwk::ElementName &elementName, RemoteAbilityInfo &remoteAbilityInfo) = 0;
41 
42     /**
43      * @brief get remote ability info
44      * @param elementName Indicates the elementName.
45      * @param localeInfo Indicates the localeInfo.
46      * @param remoteAbilityInfo Indicates the remote ability info.
47      * @return Returns result code when get remote ability info.
48      */
49     virtual int32_t GetRemoteAbilityInfo(const OHOS::AppExecFwk::ElementName &elementName,
50         const std::string &localeInfo, RemoteAbilityInfo &remoteAbilityInfo) = 0;
51 
52     /**
53      * @brief get remote ability infos
54      * @param elementNames Indicates the elementNames.
55      * @param remoteAbilityInfos Indicates the remote ability infos.
56      * @return Returns result code when get remote ability infos.
57      */
58     virtual int32_t GetRemoteAbilityInfos(
59         const std::vector<ElementName> &elementNames, std::vector<RemoteAbilityInfo> &remoteAbilityInfos) = 0;
60 
61     /**
62      * @brief get remote ability infos
63      * @param elementNames Indicates the elementNames.
64      * @param localeInfo Indicates the localeInfo.
65      * @param remoteAbilityInfos Indicates the remote ability infos.
66      * @return Returns result code when get remote ability infos.
67      */
68     virtual int32_t GetRemoteAbilityInfos(const std::vector<ElementName> &elementNames, const std::string &localeInfo,
69         std::vector<RemoteAbilityInfo> &remoteAbilityInfos) = 0;
70 
71     /**
72      * @brief get ability info
73      * @param elementName Indicates the elementName.
74      * @param remoteAbilityInfo Indicates the remote ability info.
75      * @return Returns result code when get ability info.
76      */
77     virtual int32_t GetAbilityInfo(
78         const OHOS::AppExecFwk::ElementName &elementName, RemoteAbilityInfo &remoteAbilityInfo) = 0;
79 
80     /**
81      * @brief get ability info
82      * @param elementName Indicates the elementName.
83      * @param localeInfo Indicates the localeInfo.
84      * @param remoteAbilityInfo Indicates the remote ability info.
85      * @return Returns result code when get ability info.
86      */
87     virtual int32_t GetAbilityInfo(const OHOS::AppExecFwk::ElementName &elementName, const std::string &localeInfo,
88         RemoteAbilityInfo &remoteAbilityInfo) = 0;
89 
90     /**
91      * @brief get ability infos
92      * @param elementNames Indicates the elementNames.
93      * @param remoteAbilityInfos Indicates the remote ability infos.
94      * @return Returns result code when get ability infos.
95      */
96     virtual int32_t GetAbilityInfos(
97         const std::vector<ElementName> &elementNames, std::vector<RemoteAbilityInfo> &remoteAbilityInfos) = 0;
98 
99     /**
100      * @brief get ability infos
101      * @param elementNames Indicates the elementNames.
102      * @param localeInfo Indicates the localeInfo.
103      * @param remoteAbilityInfos Indicates the remote ability infos.
104      * @return Returns result code when get ability infos.
105      */
106     virtual int32_t GetAbilityInfos(const std::vector<ElementName> &elementNames, const std::string &localeInfo,
107         std::vector<RemoteAbilityInfo> &remoteAbilityInfos) = 0;
108 
109     virtual bool GetDistributedBundleInfo(const std::string &networkId, const std::string &bundleName,
110         DistributedBundleInfo &distributedBundleInfo) = 0;
111 
112     enum class Message {
113         GET_REMOTE_ABILITY_INFO = 0,
114         GET_REMOTE_ABILITY_INFOS,
115         GET_ABILITY_INFO,
116         GET_ABILITY_INFOS,
117         GET_REMOTE_ABILITY_INFO_WITH_LOCALE,
118         GET_REMOTE_ABILITY_INFOS_WITH_LOCALE,
119         GET_ABILITY_INFO_WITH_LOCALE,
120         GET_ABILITY_INFOS_WITH_LOCALE,
121         GET_DISTRIBUTED_BUNDLE_INFO,
122     };
123 };
124 }  // namespace AppExecFwk
125 }  // namespace OHOS
126 #endif  // FOUNDATION_APPEXECFWK_SERVICES_DBMS_INCLUDE_DISTRIBUTED_BMS_INTERFACE_H