[PVR][Estuary] Timer settings dialog: Show client name in timer type selection dialog...
[xbmc.git] / xbmc / storage / IStorageProvider.h
blobaa9ecaf6524e508a1b61c1b09798144fc863216d
1 /*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include "MediaSource.h"
13 #include <memory>
14 #include <string>
15 #include <vector>
16 #ifdef HAS_DVD_DRIVE
17 #include "cdioSupport.h"
18 #endif
20 namespace MEDIA_DETECT
22 namespace STORAGE
24 /*! \brief Abstracts a generic storage device type*/
25 enum class Type
27 UNKNOWN, /*!< the storage type is unknown */
28 OPTICAL /*!< an optical device (e.g. DVD or Bluray) */
31 /*! \brief Abstracts a generic storage device */
32 struct StorageDevice
34 /*! Device name/label */
35 std::string label{};
36 /*! Device mountpoint/path */
37 std::string path{};
38 /*! The storage type (e.g. OPTICAL) */
39 STORAGE::Type type{STORAGE::Type::UNKNOWN};
41 } // namespace STORAGE
42 } // namespace MEDIA_DETECT
44 class IStorageEventsCallback
46 public:
47 virtual ~IStorageEventsCallback() = default;
49 /*! \brief Callback executed when a new storage device is added
50 * @param device the storage device
52 virtual void OnStorageAdded(const MEDIA_DETECT::STORAGE::StorageDevice& device) = 0;
54 /*! \brief Callback executed when a new storage device is safely removed
55 * @param device the storage device
57 virtual void OnStorageSafelyRemoved(const MEDIA_DETECT::STORAGE::StorageDevice& device) = 0;
59 /*! \brief Callback executed when a new storage device is unsafely removed
60 * @param device the storage device
62 virtual void OnStorageUnsafelyRemoved(const MEDIA_DETECT::STORAGE::StorageDevice& device) = 0;
65 class IStorageProvider
67 public:
68 virtual ~IStorageProvider() = default;
70 virtual void Initialize() = 0;
71 virtual void Stop() = 0;
73 virtual void GetLocalDrives(VECSOURCES &localDrives) = 0;
74 virtual void GetRemovableDrives(VECSOURCES &removableDrives) = 0;
75 virtual std::string GetFirstOpticalDeviceFileName()
77 #ifdef HAS_DVD_DRIVE
78 return std::string(MEDIA_DETECT::CLibcdio::GetInstance()->GetDeviceFileName());
79 #else
80 return "";
81 #endif
84 virtual bool Eject(const std::string& mountpath) = 0;
86 virtual std::vector<std::string> GetDiskUsage() = 0;
88 virtual bool PumpDriveChangeEvents(IStorageEventsCallback *callback) = 0;
90 /**\brief Called by media manager to create platform storage provider
92 * This method used to create platform specified storage provider
94 static std::unique_ptr<IStorageProvider> CreateInstance();