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