Sayonara Player
MTP_Storage.h
1 
2 /* Copyright (C) 2011-2016 Lucio Carreras
3  *
4  * This file is part of sayonara player
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10 
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15 
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 
21 
22 
23 #ifndef MTP_STORAGE_H
24 #define MTP_STORAGE_H
25 
26 #include "MTP_Typedefs.h"
27 #include <QHash>
28 
34 {
35 
36 
37 public:
38 
39  MTP_Storage(MTPIntern_Device* device=nullptr, MTPIntern_Storage* storage=nullptr);
40  virtual ~MTP_Storage();
41 
42  quint32 id() const;
43  quint64 free_space() const;
44  quint64 max_space() const;
45  QString name() const;
46  QString identifier() const;
47 
48  QList<MTP_FolderPtr> folders();
49  QList<MTP_FilePtr> files_of_folder(quint32 folder_id) const;
50 
51  void remove_id(quint32 id);
52 
53 
54 private:
55  quint32 _id;
56  quint64 _free_space;
57  quint64 _max_space;
58  QString _name;
59  QString _identifier;
60 
61  MTPIntern_Storage* _storage=nullptr;
62  MTPIntern_Device* _device=nullptr;
63  QList<MTP_FolderPtr> _folders;
64 
65  QHash<quint32, QList<MTP_FilePtr>> _files;
66 
67 };
68 
69 
70 
71 
72 
73 #endif // MTP_STORAGE_H
The MTP_Storage class.
Definition: MTP_Storage.h:33
LIBMTP_mtpdevice_t MTPIntern_Device
MTPIntern_Device.
Definition: MTP_Typedefs.h:63
LIBMTP_devicestorage_t MTPIntern_Storage
MTPIntern_Storage.
Definition: MTP_Typedefs.h:111