Changeset View
Changeset View
Standalone View
Standalone View
src/solid/devices/backends/iokit/dadictionary_p.h
- This file was copied from src/solid/devices/backends/iokit/iokitdeviceinterface.h.
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | Copyright 2009 Harald Fernengel <harry@kdevelop.org> | 2 | Copyright 2018 René J.V. Bertin <rjvbertin@gmail.com> | ||
3 | 3 | | |||
4 | This library is free software; you can redistribute it and/or | 4 | This library is free software; you can redistribute it and/or | ||
5 | modify it under the terms of the GNU Lesser General Public | 5 | modify it under the terms of the GNU Lesser General Public | ||
6 | License as published by the Free Software Foundation; either | 6 | License as published by the Free Software Foundation; either | ||
7 | version 2.1 of the License, or (at your option) version 3, or any | 7 | version 2.1 of the License, or (at your option) version 3, or any | ||
8 | later version accepted by the membership of KDE e.V. (or its | 8 | later version accepted by the membership of KDE e.V. (or its | ||
9 | successor approved by the membership of KDE e.V.), which shall | 9 | successor approved by the membership of KDE e.V.), which shall | ||
10 | act as a proxy defined in Section 6 of version 3 of the license. | 10 | act as a proxy defined in Section 6 of version 3 of the license. | ||
11 | 11 | | |||
12 | This library is distributed in the hope that it will be useful, | 12 | This library is distributed in the hope that it will be useful, | ||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | Lesser General Public License for more details. | 15 | Lesser General Public License for more details. | ||
16 | 16 | | |||
17 | You should have received a copy of the GNU Lesser General Public | 17 | You should have received a copy of the GNU Lesser General Public | ||
18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | 18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #ifndef SOLID_BACKENDS_IOKIT_DEVICEINTERFACE_H | 21 | #ifndef SOLID_BACKENDS_IOKIT_DADICTIONARY_H | ||
22 | #define SOLID_BACKENDS_IOKIT_DEVICEINTERFACE_H | 22 | #define SOLID_BACKENDS_IOKIT_DADICTIONARY_H | ||
23 | | ||||
24 | #include <QString> | ||||
23 | 25 | | |||
24 | #include <solid/devices/ifaces/deviceinterface.h> | | |||
25 | #include "iokitdevice.h" | 26 | #include "iokitdevice.h" | ||
26 | 27 | | |||
27 | #include <QtCore/QObject> | 28 | #include <CoreFoundation/CoreFoundation.h> | ||
28 | #include <QtCore/QStringList> | 29 | #include <DiskArbitration/DiskArbitration.h> | ||
29 | 30 | | |||
30 | namespace Solid | 31 | namespace Solid | ||
31 | { | 32 | { | ||
32 | namespace Backends | 33 | namespace Backends | ||
33 | { | 34 | { | ||
34 | namespace IOKit | 35 | namespace IOKit | ||
35 | { | 36 | { | ||
36 | class DeviceInterface : public QObject, virtual public Solid::Ifaces::DeviceInterface | 37 | class DADictionary | ||
37 | { | 38 | { | ||
38 | Q_OBJECT | | |||
39 | Q_INTERFACES(Solid::Ifaces::DeviceInterface) | | |||
40 | public: | 39 | public: | ||
41 | DeviceInterface(IOKitDevice *device); | 40 | DADictionary(const IOKitDevice *device); | ||
42 | virtual ~DeviceInterface(); | 41 | virtual ~DADictionary(); | ||
43 | 42 | | |||
44 | protected: | 43 | bool getDict(); | ||
45 | IOKitDevice *m_device; | 44 | void releaseDict(); | ||
45 | const QString stringForKey(const CFStringRef key); | ||||
46 | CFURLRef cfUrLRefForKey(const CFStringRef key); | ||||
47 | bool boolForKey(const CFStringRef key, bool &value); | ||||
48 | | ||||
49 | const IOKitDevice *device; | ||||
50 | DASessionRef daSession; | ||||
51 | DADiskRef daRef; | ||||
52 | CFDictionaryRef daDict; | ||||
46 | }; | 53 | }; | ||
47 | } | 54 | } | ||
48 | } | 55 | } | ||
49 | } | 56 | } | ||
50 | 57 | | |||
51 | #endif // SOLID_BACKENDS_IOKIT_DEVICEINTERFACE_H | 58 | #endif // SOLID_BACKENDS_IOKIT_DADICTIONARY_H |