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_EVENT_NOTIFY_CONNECTION_H 17 #define OHOS_FORM_FWK_FORM_EVENT_NOTIFY_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 FormEventNotifyConnection 27 * Form Event Notify Connection Stub. 28 */ 29 class FormEventNotifyConnection : public FormAbilityConnection { 30 public: 31 FormEventNotifyConnection(const std::vector<int64_t> formEvents, const int32_t formVisibleType, 32 const std::string &bundleName, const std::string &abilityName); 33 virtual ~FormEventNotifyConnection() = 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( 43 const AppExecFwk::ElementName &element, const sptr<IRemoteObject> &remoteObject, int resultCode) override; 44 45 private: 46 std::vector<int64_t> formEvents_; 47 int32_t formVisibleType_ = 0; 48 DISALLOW_COPY_AND_MOVE(FormEventNotifyConnection); 49 }; 50 } // namespace AppExecFwk 51 } // namespace OHOS 52 53 #endif // OHOS_FORM_FWK_FORM_EVENT_NOTIFY_CONNECTION_H 54