1cb7eb8c9Sopenharmony_ci/*
2cb7eb8c9Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd.
3cb7eb8c9Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4cb7eb8c9Sopenharmony_ci * you may not use this file except in compliance with the License.
5cb7eb8c9Sopenharmony_ci * You may obtain a copy of the License at
6cb7eb8c9Sopenharmony_ci *
7cb7eb8c9Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8cb7eb8c9Sopenharmony_ci *
9cb7eb8c9Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10cb7eb8c9Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11cb7eb8c9Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12cb7eb8c9Sopenharmony_ci * See the License for the specific language governing permissions and
13cb7eb8c9Sopenharmony_ci * limitations under the License.
14cb7eb8c9Sopenharmony_ci */
15cb7eb8c9Sopenharmony_ci
16cb7eb8c9Sopenharmony_ci#ifndef OHOS_CLOUD_DISK_SERVICE_NOTIFY_H
17cb7eb8c9Sopenharmony_ci#define OHOS_CLOUD_DISK_SERVICE_NOTIFY_H
18cb7eb8c9Sopenharmony_ci
19cb7eb8c9Sopenharmony_ci#include <list>
20cb7eb8c9Sopenharmony_ci#include <string>
21cb7eb8c9Sopenharmony_ci
22cb7eb8c9Sopenharmony_ci#include "clouddisk_notify_const.h"
23cb7eb8c9Sopenharmony_ci#include "dataobs_mgr_client.h"
24cb7eb8c9Sopenharmony_ci#include "nocopyable.h"
25cb7eb8c9Sopenharmony_ci
26cb7eb8c9Sopenharmony_cinamespace OHOS::FileManagement::CloudDisk {
27cb7eb8c9Sopenharmony_ciusing namespace std;
28cb7eb8c9Sopenharmony_ciusing ChangeInfo = OHOS::AAFwk::ChangeInfo;
29cb7eb8c9Sopenharmony_ci
30cb7eb8c9Sopenharmony_cistruct CacheNotifyInfo {
31cb7eb8c9Sopenharmony_ci    NotifyType notifyType;
32cb7eb8c9Sopenharmony_ci    mutable list<Uri> uriList;
33cb7eb8c9Sopenharmony_ci    mutable list<bool> isDirList;
34cb7eb8c9Sopenharmony_ci};
35cb7eb8c9Sopenharmony_ci
36cb7eb8c9Sopenharmony_ciclass CloudDiskNotify final : public NoCopyable {
37cb7eb8c9Sopenharmony_cipublic:
38cb7eb8c9Sopenharmony_ci    static CloudDiskNotify &GetInstance();
39cb7eb8c9Sopenharmony_ci    void TryNotify(const NotifyParamDisk &paramDisk, const ParamDiskOthers &paramOthers = {});
40cb7eb8c9Sopenharmony_ci    void TryNotifyService(const NotifyParamService &paramService, const ParamServiceOther &paramOthers = {});
41cb7eb8c9Sopenharmony_ci    int32_t GetDeleteNotifyData(const vector<NativeRdb::ValueObject> &deleteIds,
42cb7eb8c9Sopenharmony_ci                                vector<NotifyData> &notifyDataList,
43cb7eb8c9Sopenharmony_ci                                const ParamServiceOther &paramOthers);
44cb7eb8c9Sopenharmony_ci    void AddNotify(const NotifyData &notifyData);
45cb7eb8c9Sopenharmony_ci    void NotifyChangeOuter();
46cb7eb8c9Sopenharmony_ci
47cb7eb8c9Sopenharmony_ciprivate:
48cb7eb8c9Sopenharmony_ci    CloudDiskNotify() = default;
49cb7eb8c9Sopenharmony_ci    ~CloudDiskNotify() = default;
50cb7eb8c9Sopenharmony_ci    list<CacheNotifyInfo> nfList_;
51cb7eb8c9Sopenharmony_ci    mutex mutex_;
52cb7eb8c9Sopenharmony_ci};
53cb7eb8c9Sopenharmony_ci} // namespace OHOS::FileManagement::CloudDisk
54cb7eb8c9Sopenharmony_ci
55cb7eb8c9Sopenharmony_ci#endif // OHOS_CLOUD_DISK_SERVICE_NOTIFY_H