1 /* 2 * Copyright (c) 2022-2023 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_FILEMGMT_BACKUP_I_SERVICE_REVERSE_H 17 #define OHOS_FILEMGMT_BACKUP_I_SERVICE_REVERSE_H 18 19 #include <cstdint> 20 21 #include "i_service_reverse_ipc_interface_code.h" 22 #include "iremote_broker.h" 23 24 namespace OHOS::FileManagement::Backup { 25 class IServiceReverse : public IRemoteBroker { 26 public: 27 enum class Scenario { 28 UNDEFINED, 29 BACKUP, 30 RESTORE, 31 }; 32 33 public: 34 virtual void BackupOnFileReady(std::string bundleName, std::string fileName, int fd) = 0; 35 virtual void BackupOnBundleStarted(int32_t errCode, std::string bundleName) = 0; 36 virtual void BackupOnBundleFinished(int32_t errCode, std::string bundleName) = 0; 37 virtual void BackupOnAllBundlesFinished(int32_t errCode) = 0; 38 39 virtual void RestoreOnBundleStarted(int32_t errCode, std::string bundleName) = 0; 40 virtual void RestoreOnBundleFinished(int32_t errCode, std::string bundleName) = 0; 41 virtual void RestoreOnAllBundlesFinished(int32_t errCode) = 0; 42 virtual void RestoreOnFileReady(std::string bundleName, std::string fileName, int fd) = 0; 43 44 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.FileManagement.Backup.IServiceReverse") 45 }; 46 } // namespace OHOS::FileManagement::Backup 47 48 #endif // OHOS_FILEMGMT_BACKUP_I_SERVICE_REVERSE_H