• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 OHOS_CLOUD_FILE_CLOUD_FILE_KIT_IMPL_H
17 #define OHOS_CLOUD_FILE_CLOUD_FILE_KIT_IMPL_H
18 
19 #include "cloud_file_kit.h"
20 #include <mutex>
21 
22 namespace OHOS::FileManagement::CloudFile {
23 class CloudFileKitImpl final : public CloudFileKit {
24 public:
25     int32_t GetCloudUserInfo(const int32_t userId, CloudUserInfo &userInfo) override;
26     uint64_t GetRemainSpace(const int32_t userId) override;
27     int32_t GetAppSwitchStatus(const std::string &bundleName, const int32_t userId, bool &switchStatus) override;
28     int32_t ResolveNotificationEvent(const int32_t userId,
29                                      const std::string &extraData,
30                                      std::string &appBundleName,
31                                      std::string &prepareTraceId) override;
32 
33     std::shared_ptr<DataSyncManager> GetDataSyncManager() override;
34     std::shared_ptr<CloudAssetsDownloader> GetCloudAssetsDownloader(const int32_t userId,
35                                                                     const std::string &bundleName) override;
36     std::shared_ptr<CloudDatabase> GetCloudDatabase(const int32_t userId, const std::string &bundleName) override;
37     std::shared_ptr<CloudSyncHelper> GetCloudSyncHelper(const int32_t userId, const std::string &bundleName) override;
38 
39 private:
40     std::mutex dataSyncManagerMutex_;
41     std::shared_ptr<DataSyncManager> dataSyncManager_;
42 
43     std::mutex cloudAssetsDownloaderMutex_;
44     std::shared_ptr<CloudAssetsDownloader> cloudAssetsDownloader_;
45 
46     std::mutex cloudSyncHelperMutex_;
47     std::shared_ptr<CloudSyncHelper> cloudSyncHelper_;
48 
49     std::mutex cloudDatabaseMutex_;
50     std::shared_ptr<CloudDatabase> cloudDatabase_;
51 };
52 } // namespace OHOS::FileManagement::CloudFile
53 
54 #endif // OHOS_CLOUD_FILE_CLOUD_FILE_KIT_IMPL_H