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 
16 #ifndef OHOS_STORAGE_MANAGER_STORAGE_DAEMON_COMMUNICATION_H
17 #define OHOS_STORAGE_MANAGER_STORAGE_DAEMON_COMMUNICATION_H
18 
19 #include <nocopyable.h>
20 #include "istorage_manager.h"
21 #include "disk/disk_info.h"
22 #include "volume/volume_info.h"
23 
24 namespace OHOS {
25 namespace StorageDaemon {
26 class StorageManagerClient final {
27 public:
28     StorageManagerClient() = default;
29 
30     int32_t NotifyDiskCreated(DiskInfo &diskInfo);
31     int32_t NotifyDiskDestroyed(std::string id);
32 
33     int32_t NotifyVolumeCreated(std::shared_ptr<VolumeInfo> info);
34     int32_t NotifyVolumeMounted(std::shared_ptr<VolumeInfo> volumeInfo);
35     int32_t NotifyVolumeStateChanged(std::string volId, StorageManager::VolumeState state);
36 
37 private:
38     DISALLOW_COPY_AND_MOVE(StorageManagerClient);
39 
40     int32_t GetClient();
41 
42     sptr<OHOS::StorageManager::IStorageManager> storageManager_;
43 };
44 } // StorageManager
45 } // OHOS
46 
47 #endif