26 |
26 |
27 void TMsPrintDrive::FormatDriveInfo(TDes& aBuffer, const TDriveInfo& aDriveInfo) |
27 void TMsPrintDrive::FormatDriveInfo(TDes& aBuffer, const TDriveInfo& aDriveInfo) |
28 { |
28 { |
29 // Append battery, media and drive information to aBuffer |
29 // Append battery, media and drive information to aBuffer |
30 // Define descriptor constants using the _LIT macro |
30 // Define descriptor constants using the _LIT macro |
31 _LIT(KFormatString,"Type=0x%02x,Battery=0x%02x,DriveAtt=0x%02x,MediaAtt=0x%02x\r\n"); |
31 _LIT(KFormatString,"Type=0x%02x,Connection Bus=0x%02x,DriveAtt=0x%02x,MediaAtt=0x%02x\r\n"); |
32 _LIT(KBatLow,"Battery low\r\n"); |
32 _LIT(KConnectionBusInternal,"Connection Bus is Internal\r\n"); |
33 _LIT(KBatGood,"Battery good\r\n"); |
33 _LIT(KConnectionBusUsb,"Connection Bus is USB\r\n"); |
34 _LIT(KBatNotSupported,"Battery not supported\r\n"); |
34 _LIT(KConnectionBusUnknown,"Connection Bus is Unknown\r\n"); |
35 _LIT(KNotPresent,"No media present\r\n"); |
35 _LIT(KNotPresent,"No media present\r\n"); |
36 _LIT(KFloppy,"Media is floppy disk\r\n"); |
36 _LIT(KFloppy,"Media is floppy disk\r\n"); |
37 _LIT(KHard,"Media is hard disk\r\n"); |
37 _LIT(KHard,"Media is hard disk\r\n"); |
38 _LIT(KCDROM,"Media is CD-ROM\r\n"); |
38 _LIT(KCDROM,"Media is CD-ROM\r\n"); |
39 _LIT(KRam,"Media is RAM\r\n"); |
39 _LIT(KRam,"Media is RAM\r\n"); |
47 _LIT(KROMDrive," ROM"); |
47 _LIT(KROMDrive," ROM"); |
48 _LIT(KRedirected," redirected"); |
48 _LIT(KRedirected," redirected"); |
49 _LIT(KSubstituted," substituted"); |
49 _LIT(KSubstituted," substituted"); |
50 _LIT(KInternal," internal"); |
50 _LIT(KInternal," internal"); |
51 _LIT(KRemovable," removable"); |
51 _LIT(KRemovable," removable"); |
|
52 _LIT(KExternal," external"); |
52 _LIT(KMediaAtts,"\r\nMedia attributes:"); |
53 _LIT(KMediaAtts,"\r\nMedia attributes:"); |
53 _LIT(KDynamic," dynamic"); |
54 _LIT(KDynamic," dynamic"); |
54 _LIT(KDual," dual-density"); |
55 _LIT(KDual," dual-density"); |
55 _LIT(KFormattable," formattable"); |
56 _LIT(KFormattable," formattable"); |
56 _LIT(KLockable," lockable"); |
57 _LIT(KLockable," lockable"); |
58 _LIT(KHasPassword," has password"); |
59 _LIT(KHasPassword," has password"); |
59 _LIT(KWriteProtected," write-protected"); |
60 _LIT(KWriteProtected," write-protected"); |
60 _LIT(KNewLine,"\r\n"); |
61 _LIT(KNewLine,"\r\n"); |
61 |
62 |
62 aBuffer.AppendFormat(KFormatString, TInt(aDriveInfo.iType), |
63 aBuffer.AppendFormat(KFormatString, TInt(aDriveInfo.iType), |
63 TInt(aDriveInfo.iBattery), |
64 TInt(aDriveInfo.iConnectionBusType), |
64 TInt(aDriveInfo.iDriveAtt), |
65 TInt(aDriveInfo.iDriveAtt), |
65 TInt(aDriveInfo.iMediaAtt)); |
66 TInt(aDriveInfo.iMediaAtt)); |
66 |
67 |
67 switch (aDriveInfo.iBattery) |
68 switch (aDriveInfo.iConnectionBusType) |
68 { |
69 { |
69 case EBatLow: |
70 case EConnectionBusInternal: |
70 aBuffer.Append(KBatLow); |
71 aBuffer.Append(KConnectionBusInternal); |
71 break; |
72 break; |
72 case EBatGood: |
73 case EConnectionBusUsb: |
73 aBuffer.Append(KBatGood); |
74 aBuffer.Append(KConnectionBusUsb); |
74 break; |
75 break; |
75 default: |
76 default: |
76 aBuffer.Append(KBatNotSupported); |
77 aBuffer.Append(KConnectionBusUnknown); |
77 } |
78 } |
78 |
79 |
79 switch (aDriveInfo.iType) |
80 switch (aDriveInfo.iType) |
80 { |
81 { |
81 case EMediaNotPresent: |
82 case EMediaNotPresent: |
120 aBuffer.Append(KSubstituted); |
121 aBuffer.Append(KSubstituted); |
121 if (aDriveInfo.iDriveAtt & KDriveAttInternal) |
122 if (aDriveInfo.iDriveAtt & KDriveAttInternal) |
122 aBuffer.Append(KInternal); |
123 aBuffer.Append(KInternal); |
123 if (aDriveInfo.iDriveAtt & KDriveAttRemovable) |
124 if (aDriveInfo.iDriveAtt & KDriveAttRemovable) |
124 aBuffer.Append(KRemovable); |
125 aBuffer.Append(KRemovable); |
|
126 if (aDriveInfo.iDriveAtt & KDriveAttExternal) |
|
127 aBuffer.Append(KExternal); |
125 aBuffer.Append(KMediaAtts); |
128 aBuffer.Append(KMediaAtts); |
126 if (aDriveInfo.iMediaAtt & KMediaAttVariableSize) |
129 if (aDriveInfo.iMediaAtt & KMediaAttVariableSize) |
127 aBuffer.Append(KDynamic); |
130 aBuffer.Append(KDynamic); |
128 if (aDriveInfo.iMediaAtt & KMediaAttDualDensity) |
131 if (aDriveInfo.iMediaAtt & KMediaAttDualDensity) |
129 aBuffer.Append(KDual); |
132 aBuffer.Append(KDual); |