kodi
Win32StorageProvider.h
1 /*
2  * Copyright (C) 2005-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "storage/IStorageProvider.h"
12 #include "utils/Job.h"
13 
14 #include <vector>
15 
16 #include <Cfgmgr32.h>
17 
18 enum Drive_Types
19 {
20  ALL_DRIVES = 0,
21  LOCAL_DRIVES,
22  REMOVABLE_DRIVES,
23  DVD_DRIVES
24 };
25 
27 {
28 public:
29  virtual ~CWin32StorageProvider() { }
30 
31  virtual void Initialize();
32  virtual void Stop() { }
33 
34  virtual void GetLocalDrives(VECSOURCES &localDrives);
35  virtual void GetRemovableDrives(VECSOURCES &removableDrives);
36  virtual std::string GetFirstOpticalDeviceFileName();
37 
38  virtual bool Eject(const std::string& mountpath);
39 
40  virtual std::vector<std::string> GetDiskUsage();
41 
42  virtual bool PumpDriveChangeEvents(IStorageEventsCallback *callback);
43 
44  static void SetEvent() { xbevent = true; }
45  static bool xbevent;
46 
47 private:
48  static void GetDrivesByType(VECSOURCES &localDrives, Drive_Types eDriveType=ALL_DRIVES, bool bonlywithmedia=false);
49  static DEVINST GetDrivesDevInstByDiskNumber(long DiskNumber);
50 };
51 
52 class CDetectDisc : public CJob
53 {
54 public:
55  CDetectDisc(const std::string &strPath, const bool bautorun);
56  bool DoWork();
57 
58 private:
59  std::string m_strPath;
60  bool m_bautorun;
61 };
62 
Base class for jobs that are executed asynchronously.
Definition: Job.h:109
Definition: IStorageProvider.h:65
Definition: Win32StorageProvider.h:52
Definition: Win32StorageProvider.h:26
Definition: IStorageProvider.h:44