1 /*
2  * Copyright (c) 2021-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 OHOS_FORM_FWK_FORM_ACQUIRE_STATE_CONNECTION_H
17 #define OHOS_FORM_FWK_FORM_ACQUIRE_STATE_CONNECTION_H
18 
19 #include "form_ability_connection.h"
20 #include "want.h"
21 
22 namespace OHOS {
23 namespace AppExecFwk {
24 using WantParams = OHOS::AAFwk::WantParams;
25 using Want = OHOS::AAFwk::Want;
26 
27 /**
28  * @class FormAcquireStateConnection
29  * Form acquire form state connection stub.
30  */
31 class FormAcquireStateConnection : public FormAbilityConnection {
32 public:
33     FormAcquireStateConnection(const std::string &bundleName, const std::string &abilityName, const Want &want,
34                                std::string &provider);
35 
36     virtual ~FormAcquireStateConnection() = default;
37 
38     /**
39      * @brief OnAbilityConnectDone, AbilityMs notify caller ability the result of connect.
40      * @param element service ability's ElementName.
41      * @param remoteObject the session proxy of service ability.
42      * @param resultCode ERR_OK on success, others on failure.
43      */
44     void OnAbilityConnectDone(
45         const AppExecFwk::ElementName &element, const sptr<IRemoteObject> &remoteObject, int resultCode) override;
46 
47 private:
48     Want want_;
49     std::string provider_;
50     DISALLOW_COPY_AND_MOVE(FormAcquireStateConnection);
51 };
52 }  // namespace AppExecFwk
53 }  // namespace OHOS
54 
55 #endif // OHOS_FORM_FWK_FORM_ACQUIRE_STATE_CONNECTION_H
56