20 #ifndef _TDESTORAGEDEVICE_H 21 #define _TDESTORAGEDEVICE_H 23 #include "tdegenericdevice.h" 24 #include "tqvariant.h" 30 #if __cplusplus >= 201103L 35 Null = 0x0000000000000000ULL,
36 MediaDevice = 0x0000000000000001ULL,
37 Floppy = 0x0000000000000002ULL,
38 CDROM = 0x0000000000000004ULL,
39 CDR = 0x0000000000000008ULL,
40 CDRW = 0x0000000000000010ULL,
41 CDMO = 0x0000000000000020ULL,
42 CDMRRW = 0x0000000000000040ULL,
43 CDMRRWW = 0x0000000000000080ULL,
44 DVDROM = 0x0000000000000100ULL,
45 DVDRAM = 0x0000000000000200ULL,
46 DVDR = 0x0000000000000400ULL,
47 DVDRW = 0x0000000000000800ULL,
48 DVDRDL = 0x0000000000001000ULL,
49 DVDRWDL = 0x0000000000002000ULL,
50 DVDPLUSR = 0x0000000000004000ULL,
51 DVDPLUSRW = 0x0000000000008000ULL,
52 DVDPLUSRDL = 0x0000000000010000ULL,
53 DVDPLUSRWDL = 0x0000000000020000ULL,
54 BDROM = 0x0000000000040000ULL,
55 BDR = 0x0000000000080000ULL,
56 BDRW = 0x0000000000100000ULL,
57 HDDVDROM = 0x0000000000200000ULL,
58 HDDVDR = 0x0000000000400000ULL,
59 HDDVDRW = 0x0000000000800000ULL,
60 Zip = 0x0000000001000000ULL,
61 Jaz = 0x0000000002000000ULL,
62 Camera = 0x0000000004000000ULL,
63 LUKS = 0x0000000008000000ULL,
64 OtherCrypted = 0x0000000010000000ULL,
65 CDAudio = 0x0000000020000000ULL,
66 CDVideo = 0x0000000040000000ULL,
67 DVDVideo = 0x0000000080000000ULL,
68 BDVideo = 0x0000000100000000ULL,
69 Flash = 0x0000000200000000ULL,
70 USB = 0x0000000400000000ULL,
71 Tape = 0x0000000800000000ULL,
72 HDD = 0x0000001000000000ULL,
73 Optical = 0x0000002000000000ULL,
74 RAM = 0x0000004000000000ULL,
75 Loop = 0x0000008000000000ULL,
76 CompactFlash = 0x0000010000000000ULL,
77 MemoryStick = 0x0000020000000000ULL,
78 SmartMedia = 0x0000040000000000ULL,
79 SDMMC = 0x0000080000000000ULL,
80 UnlockedCrypt = 0x0000100000000000ULL,
81 Other = 0x8000000000000000ULL
86 return static_cast<TDEDiskDeviceType>(
static_cast<unsigned long long>(a) | static_cast<unsigned long long>(b));
91 return static_cast<TDEDiskDeviceType>(
static_cast<unsigned long long>(a) & static_cast<unsigned long long>(b));
103 Mountable = 0x00000001,
104 Removable = 0x00000002,
105 Inserted = 0x00000004,
107 UsedByDevice = 0x00000010,
108 UsesDevice = 0x00000020,
109 ContainsFilesystem = 0x00000040,
110 Hotpluggable = 0x00000080,
133 Invalid = 0x00000000,
134 Inactive = 0x00000001,
156 typedef TQValueList<TDELUKSKeySlotStatus::TDELUKSKeySlotStatus> TDELUKSKeySlotStatusList;
160 Invalid = 0x00000000,
161 Success = 0x00000001,
162 LUKSNotSupported = 0x00000002,
163 LUKSNotFound = 0x00000003,
164 InvalidKeyslot = 0x00000004,
165 KeyslotOpFailed = 0x00000005,
170 typedef TQMap<TQString, TQString> TDEStorageMountOptions;
172 class TDECORE_EXPORT TDEStorageDevice :
public TDEGenericDevice
179 TDEStorageDevice(TDEGenericDeviceType::TDEGenericDeviceType dt, TQString dn=TQString::null);
189 TQString diskLabel();
199 TDEDiskDeviceType::TDEDiskDeviceType diskType();
204 TDEDiskDeviceStatus::TDEDiskDeviceStatus diskStatus();
209 bool mediaInserted();
214 TQString fileSystemName();
219 TQString fileSystemUsage();
224 TQStringList holdingDevices();
229 TQStringList slaveDevices();
239 TQStringVariantMap mountDevice(TQString mediaName = TQString::null,
240 TDEStorageMountOptions mountOptions = TDEStorageMountOptions());
251 TQStringVariantMap mountEncryptedDevice(TQString passphrase, TQString mediaName = TQString::null,
252 TDEStorageMountOptions mountOptions = TDEStorageMountOptions());
259 TQStringVariantMap unmountDevice();
264 TQString mountPath();
269 unsigned long long deviceSize();
274 TQString deviceFriendlySize();
290 TQString friendlyName();
297 TQString detailedFriendlyName();
304 TQString friendlyDeviceType();
309 bool isDiskOfType(TDEDiskDeviceType::TDEDiskDeviceType tf);
314 bool checkDiskStatus(TDEDiskDeviceStatus::TDEDiskDeviceStatus sf);
322 bool lockDriveMedia(
bool lock);
329 bool ejectDriveMedia();
343 static TQString determineFileSystemType(TQString path);
351 void cryptSetOperationsUnlockPassword(TQByteArray password);
357 void cryptClearOperationsUnlockPassword();
364 bool cryptOperationsUnlockPasswordSet();
376 TDELUKSResult::TDELUKSResult cryptCheckKey(
unsigned int keyslot);
389 TDELUKSResult::TDELUKSResult cryptAddKey(
unsigned int keyslot, TQByteArray password);
399 TDELUKSResult::TDELUKSResult cryptDelKey(
unsigned int keyslot);
404 unsigned int cryptKeySlotCount();
409 TDELUKSKeySlotStatusList cryptKeySlotStatus();
415 TQString cryptKeySlotFriendlyName(TDELUKSKeySlotStatus::TDELUKSKeySlotStatus status);
424 void internalSetDeviceNode(TQString sn);
430 void internalSetDiskLabel(TQString dn);
436 void internalSetDiskUUID(TQString
id);
442 void internalSetDiskType(TDEDiskDeviceType::TDEDiskDeviceType tf);
448 void internalSetDiskStatus(TDEDiskDeviceStatus::TDEDiskDeviceStatus st);
454 void internalSetMediaInserted(
bool inserted);
460 void internalSetFileSystemName(TQString fn);
466 void internalSetFileSystemUsage(TQString fu);
472 void internalSetHoldingDevices(TQStringList hd);
478 void internalSetSlaveDevices(TQStringList sd);
483 void internalInitializeLUKSIfNeeded();
488 void internalGetLUKSKeySlotStatus();
491 TDEDiskDeviceType::TDEDiskDeviceType m_diskType;
492 TDEDiskDeviceStatus::TDEDiskDeviceStatus m_diskStatus;
495 TQString m_fileSystemName;
496 TQString m_fileSystemUsage;
497 bool m_mediaInserted;
498 TQString m_mountPath;
499 TQStringList m_holdingDevices;
500 TQStringList m_slaveDevices;
501 struct crypt_device* m_cryptDevice;
502 TQByteArray m_cryptDevicePassword;
503 TQString m_cryptDeviceType;
504 unsigned int m_cryptKeySlotCount;
505 TDELUKSKeySlotStatusList m_cryptKeyslotStatus;
507 friend class TDEHardwareDevices;
510 #endif // _TDESTORAGEDEVICE_H
StdSizes
These are the standard sizes for icons.