20 #ifndef _TDESTORAGEDEVICE_H 21 #define _TDESTORAGEDEVICE_H 23 #include "tdegenericdevice.h" 29 #if __cplusplus >= 201103L 34 Null = 0x0000000000000000ULL,
35 MediaDevice = 0x0000000000000001ULL,
36 Floppy = 0x0000000000000002ULL,
37 CDROM = 0x0000000000000004ULL,
38 CDR = 0x0000000000000008ULL,
39 CDRW = 0x0000000000000010ULL,
40 CDMO = 0x0000000000000020ULL,
41 CDMRRW = 0x0000000000000040ULL,
42 CDMRRWW = 0x0000000000000080ULL,
43 DVDROM = 0x0000000000000100ULL,
44 DVDRAM = 0x0000000000000200ULL,
45 DVDR = 0x0000000000000400ULL,
46 DVDRW = 0x0000000000000800ULL,
47 DVDRDL = 0x0000000000001000ULL,
48 DVDRWDL = 0x0000000000002000ULL,
49 DVDPLUSR = 0x0000000000004000ULL,
50 DVDPLUSRW = 0x0000000000008000ULL,
51 DVDPLUSRDL = 0x0000000000010000ULL,
52 DVDPLUSRWDL = 0x0000000000020000ULL,
53 BDROM = 0x0000000000040000ULL,
54 BDR = 0x0000000000080000ULL,
55 BDRW = 0x0000000000100000ULL,
56 HDDVDROM = 0x0000000000200000ULL,
57 HDDVDR = 0x0000000000400000ULL,
58 HDDVDRW = 0x0000000000800000ULL,
59 Zip = 0x0000000001000000ULL,
60 Jaz = 0x0000000002000000ULL,
61 Camera = 0x0000000004000000ULL,
62 LUKS = 0x0000000008000000ULL,
63 OtherCrypted = 0x0000000010000000ULL,
64 CDAudio = 0x0000000020000000ULL,
65 CDVideo = 0x0000000040000000ULL,
66 DVDVideo = 0x0000000080000000ULL,
67 BDVideo = 0x0000000100000000ULL,
68 Flash = 0x0000000200000000ULL,
69 USB = 0x0000000400000000ULL,
70 Tape = 0x0000000800000000ULL,
71 HDD = 0x0000001000000000ULL,
72 Optical = 0x0000002000000000ULL,
73 RAM = 0x0000004000000000ULL,
74 Loop = 0x0000008000000000ULL,
75 CompactFlash = 0x0000010000000000ULL,
76 MemoryStick = 0x0000020000000000ULL,
77 SmartMedia = 0x0000040000000000ULL,
78 SDMMC = 0x0000080000000000ULL,
79 UnlockedCrypt = 0x0000100000000000ULL,
80 Other = 0x8000000000000000ULL
85 return static_cast<TDEDiskDeviceType>(
static_cast<unsigned long long>(a) | static_cast<unsigned long long>(b));
90 return static_cast<TDEDiskDeviceType>(
static_cast<unsigned long long>(a) & static_cast<unsigned long long>(b));
102 Mountable = 0x00000001,
103 Removable = 0x00000002,
104 Inserted = 0x00000004,
106 UsedByDevice = 0x00000010,
107 UsesDevice = 0x00000020,
108 ContainsFilesystem = 0x00000040,
109 Hotpluggable = 0x00000080,
132 Invalid = 0x00000000,
133 Inactive = 0x00000001,
155 typedef TQValueList<TDELUKSKeySlotStatus::TDELUKSKeySlotStatus> TDELUKSKeySlotStatusList;
159 Invalid = 0x00000000,
160 Success = 0x00000001,
161 LUKSNotSupported = 0x00000002,
162 LUKSNotFound = 0x00000003,
163 InvalidKeyslot = 0x00000004,
164 KeyslotOpFailed = 0x00000005,
169 typedef TQMap<TQString,TQString> TDEStorageMountOptions;
171 class TDECORE_EXPORT TDEStorageDevice :
public TDEGenericDevice
178 TDEStorageDevice(TDEGenericDeviceType::TDEGenericDeviceType dt, TQString dn=TQString::null);
188 TQString diskLabel();
198 TDEDiskDeviceType::TDEDiskDeviceType diskType();
203 TDEDiskDeviceStatus::TDEDiskDeviceStatus diskStatus();
208 bool mediaInserted();
213 TQString fileSystemName();
218 TQString fileSystemUsage();
223 TQStringList holdingDevices();
228 TQStringList slaveDevices();
240 TQString mountDevice(TQString mediaName=TQString::null, TDEStorageMountOptions mountOptions=TDEStorageMountOptions(), TQString* errRet=0,
int* retcode=0);
253 TQString mountEncryptedDevice(TQString passphrase, TQString mediaName=TQString::null, TDEStorageMountOptions mountOptions=TDEStorageMountOptions(), TQString* errRet=0,
int* retcode=0);
263 bool unmountDevice(TQString* errRet,
int* retcode=0);
268 TQString mountPath();
273 unsigned long long deviceSize();
278 TQString deviceFriendlySize();
294 TQString friendlyName();
301 TQString detailedFriendlyName();
308 TQString friendlyDeviceType();
313 bool isDiskOfType(TDEDiskDeviceType::TDEDiskDeviceType tf);
318 bool checkDiskStatus(TDEDiskDeviceStatus::TDEDiskDeviceStatus sf);
326 bool lockDriveMedia(
bool lock);
333 bool ejectDriveMedia();
347 static TQString determineFileSystemType(TQString path);
355 void cryptSetOperationsUnlockPassword(TQByteArray password);
361 void cryptClearOperationsUnlockPassword();
368 bool cryptOperationsUnlockPasswordSet();
380 TDELUKSResult::TDELUKSResult cryptCheckKey(
unsigned int keyslot);
393 TDELUKSResult::TDELUKSResult cryptAddKey(
unsigned int keyslot, TQByteArray password);
403 TDELUKSResult::TDELUKSResult cryptDelKey(
unsigned int keyslot);
408 unsigned int cryptKeySlotCount();
413 TDELUKSKeySlotStatusList cryptKeySlotStatus();
419 TQString cryptKeySlotFriendlyName(TDELUKSKeySlotStatus::TDELUKSKeySlotStatus status);
428 void internalSetDeviceNode(TQString sn);
434 void internalSetDiskLabel(TQString dn);
440 void internalSetDiskUUID(TQString
id);
446 void internalSetDiskType(TDEDiskDeviceType::TDEDiskDeviceType tf);
452 void internalSetDiskStatus(TDEDiskDeviceStatus::TDEDiskDeviceStatus st);
458 void internalSetMediaInserted(
bool inserted);
464 void internalSetFileSystemName(TQString fn);
470 void internalSetFileSystemUsage(TQString fu);
476 void internalSetHoldingDevices(TQStringList hd);
482 void internalSetSlaveDevices(TQStringList sd);
487 void internalInitializeLUKSIfNeeded();
492 void internalGetLUKSKeySlotStatus();
495 TDEDiskDeviceType::TDEDiskDeviceType m_diskType;
496 TDEDiskDeviceStatus::TDEDiskDeviceStatus m_diskStatus;
499 TQString m_fileSystemName;
500 TQString m_fileSystemUsage;
501 bool m_mediaInserted;
502 TQString m_mountPath;
503 TQStringList m_holdingDevices;
504 TQStringList m_slaveDevices;
505 struct crypt_device* m_cryptDevice;
506 TQByteArray m_cryptDevicePassword;
507 TQString m_cryptDeviceType;
508 unsigned int m_cryptKeySlotCount;
509 TDELUKSKeySlotStatusList m_cryptKeyslotStatus;
511 friend class TDEHardwareDevices;
514 #endif // _TDESTORAGEDEVICE_H
StdSizes
These are the standard sizes for icons.