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 OHOS_ABILITY_RUNTIME_IABILITY_INFO_CALLBACK_H 17 #define OHOS_ABILITY_RUNTIME_IABILITY_INFO_CALLBACK_H 18 19 #include "iremote_broker.h" 20 #include "iremote_object.h" 21 #include "want.h" 22 23 namespace OHOS { 24 namespace AppExecFwk { 25 using OHOS::AAFwk::Want; 26 /** 27 * @brief Transfer abilityInfo to the initiator. 28 */ 29 class IAbilityInfoCallback : public IRemoteBroker { 30 public: 31 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.appexecfwk.IAbilityInfoCallback"); 32 33 /** 34 * Notify the initiator of the ability token. 35 * 36 * @param token The token of ability. 37 * @param want The want of ability to start. 38 */ 39 virtual void NotifyAbilityToken(const sptr<IRemoteObject> token, const Want &want) = 0; 40 41 /** 42 * Notify to start specified ability. 43 * 44 * @param callerToken The token of caller. 45 * @param want The want of ability to start. 46 * @param requestCode The request code of start ability. 47 * @param extraParam The extra param of ability to start. 48 */ 49 virtual void NotifyStartSpecifiedAbility(const sptr<IRemoteObject> &callerToken, const Want &want, int requestCode, 50 sptr<Want> &extraParam) = 0; 51 52 virtual void NotifyRestartSpecifiedAbility(const sptr<IRemoteObject> &token) = 0; 53 54 /** 55 * Notify the result of start ability. 56 * 57 * @param want The want of ability to start. 58 * @param result The result of start ability. 59 */ 60 virtual void NotifyStartAbilityResult(const Want &want, int result) = 0; 61 62 enum { 63 Notify_ABILITY_TOKEN = 1, 64 Notify_START_SPECIFIED_ABILITY, 65 Notify_RESTART_SPECIFIED_ABILITY, 66 Notify_START_ABILITY_RESULT, 67 }; 68 }; 69 } // namespace AppExecFwk 70 } // namespace OHOS 71 #endif // OHOS_ABILITY_RUNTIME_IABILITY_INFO_CALLBACK_H 72