1 /* 2 * Copyright (C) 2024 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 NOTIFICATION_DISTRIBUTED_EXTENSION_DISTRIBUTED_OPERATION_CONNECTION_H 17 #define NOTIFICATION_DISTRIBUTED_EXTENSION_DISTRIBUTED_OPERATION_CONNECTION_H 18 19 #include "ability_connect_callback_stub.h" 20 21 namespace OHOS { 22 namespace Notification { 23 class DistributedOperationConnection : public AAFwk::AbilityConnectionStub { 24 public: 25 /** 26 * Constructor. 27 * 28 * @param event, Indicates the common event data. 29 */ DistributedOperationConnection(const std::string & eventId,const std::string & inputKey,const std::string & userInput)30 explicit DistributedOperationConnection(const std::string& eventId, 31 const std::string& inputKey, const std::string& userInput) 32 : eventId_(eventId), inputKey_(inputKey), userInput_(userInput) {} 33 34 /** 35 * OnAbilityConnectDone, Ability Manager Service notify caller ability the result of connect. 36 * 37 * @param element, Indicates elementName of service ability. 38 * @param remoteObject, Indicates the session proxy of service ability. 39 * @param resultCode, Returns ERR_OK on success, others on failure. 40 */ 41 void OnAbilityConnectDone( 42 const AppExecFwk::ElementName &element, const sptr<IRemoteObject> &remoteObject, int resultCode) override; 43 44 /** 45 * OnAbilityDisconnectDone, Ability Manager Service notify caller ability the result of disconnect. 46 * 47 * @param element, Indicates elementName of service ability. 48 * @param resultCode, Returns ERR_OK on success, others on failure. 49 */ 50 void OnAbilityDisconnectDone(const AppExecFwk::ElementName &element, int resultCode) override; 51 52 private: 53 std::string eventId_; 54 std::string inputKey_; 55 std::string userInput_; 56 }; 57 } 58 } 59 #endif // NOTIFICATION_DISTRIBUTED_EXTENSION_DISTRIBUTED_OPERATION_CONNECTION_H 60