• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022-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 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         CLEAN,
32     };
33 
34 public:
35     virtual ~IServiceReverse() = default;
36     virtual void BackupOnBundleStarted(int32_t errCode, std::string bundleName) = 0;
37     virtual void BackupOnFileReady(std::string bundleName, std::string fileName, int fd, int32_t errCode) = 0;
38     virtual void BackupOnResultReport(std::string result, std::string bundleName) = 0;
39     virtual void BackupOnBundleFinished(int32_t errCode, std::string bundleName) = 0;
40     virtual void BackupOnAllBundlesFinished(int32_t errCode) = 0;
41     virtual void BackupOnProcessInfo(std::string bundleName, std::string processInfo) = 0;
42     virtual void BackupOnScanningInfo(std::string scannedInfo) = 0;
43 
44     virtual void RestoreOnBundleStarted(int32_t errCode, std::string bundleName) = 0;
45     virtual void RestoreOnFileReady(std::string bundleName, std::string fileName, int fd, int32_t errCode) = 0;
46     virtual void RestoreOnResultReport(std::string result, std::string bundleName,
47         ErrCode errCode = 0) = 0;
48     virtual void RestoreOnBundleFinished(int32_t errCode, std::string bundleName) = 0;
49     virtual void RestoreOnAllBundlesFinished(int32_t errCode) = 0;
50     virtual void RestoreOnProcessInfo(std::string bundleName, std::string processInfo) = 0;
51 
52     virtual void IncrementalBackupOnBundleStarted(int32_t errCode, std::string bundleName) = 0;
53     virtual void IncrementalBackupOnFileReady(std::string bundleName, std::string fileName, int fd, int manifestFd,
54         int32_t errCode) = 0;
55     virtual void IncrementalBackupOnResultReport(std::string result, std::string bundleName) = 0;
56     virtual void IncrementalBackupOnBundleFinished(int32_t errCode, std::string bundleName) = 0;
57     virtual void IncrementalBackupOnAllBundlesFinished(int32_t errCode) = 0;
58     virtual void IncrementalBackupOnProcessInfo(std::string bundleName, std::string processInfo) = 0;
59     virtual void IncrementalBackupOnScanningInfo(std::string scannedInfo) = 0;
60 
61     virtual void IncrementalRestoreOnBundleStarted(int32_t errCode, std::string bundleName) = 0;
62     virtual void IncrementalRestoreOnFileReady(std::string bundleName,
63                                                std::string fileName,
64                                                int fd,
65                                                int manifestFd, int32_t errCode) = 0;
66     virtual void IncrementalRestoreOnResultReport(std::string result, std::string bundleName,
67         ErrCode errCode = 0) = 0;
68     virtual void IncrementalRestoreOnBundleFinished(int32_t errCode, std::string bundleName) = 0;
69     virtual void IncrementalRestoreOnAllBundlesFinished(int32_t errCode) = 0;
70     virtual void IncrementalRestoreOnProcessInfo(const std::string bundleName, const std::string processInfo) = 0;
71 
72     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.FileManagement.Backup.IServiceReverse")
73 };
74 } // namespace OHOS::FileManagement::Backup
75 
76 #endif // OHOS_FILEMGMT_BACKUP_I_SERVICE_REVERSE_H