1 /* 2 * Copyright (c) 2021 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 #ifndef OHOS_ABILITY_RUNTIME_CONTINUATION_DEVICE_CALLBACK_INTERFACE_H 16 #define OHOS_ABILITY_RUNTIME_CONTINUATION_DEVICE_CALLBACK_INTERFACE_H 17 18 #include <string> 19 20 namespace OHOS { 21 namespace AppExecFwk { 22 class IContinuationDeviceCallback { 23 public: 24 IContinuationDeviceCallback() = default; 25 virtual ~IContinuationDeviceCallback() = default; 26 /** 27 * Called when the user selects a device from the candidate device list. 28 * You can implement your own processing logic in this callback to initiate the ability migration process. 29 * 30 * @param deviceId Indicates the ID of the selected device. 31 * @param deviceType Indicates the type of the selected device, which can be 32 * {@link ExtraParams#DEVICETYPE_SMART_PHONE}, {@link ExtraParams#DEVICETYPE_SMART_PAD}, 33 * {@link ExtraParams#DEVICETYPE_SMART_WATCH}, or {@link ExtraParams#DEVICETYPE_SMART_TV}. 34 */ 35 virtual void OnDeviceConnectDone(const std::string &deviceId, const std::string &deviceType) = 0; 36 37 /** 38 * Called when the Device+ control center disconnects from a specified device. 39 * You can implement your own processing logic in this callback, such as notifying the user of the disconnection. 40 * 41 * @param deviceId Indicates the ID of the disconnected device. 42 */ 43 virtual void OnDeviceDisconnectDone(const std::string &deviceId) = 0; 44 }; 45 } // namespace AppExecFwk 46 } // namespace OHOS 47 #endif // OHOS_ABILITY_RUNTIME_CONTINUATION_DEVICE_CALLBACK_INTERFACE_H 48