1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include "ResourceHandler.h" |
|
17 |
|
18 #include <techview/eiktxlbm.h> //CTextListBoxModel |
|
19 |
|
20 void CResourceList::ConstructL(TInt aTablePosition) |
|
21 { |
|
22 // Create the basic list box |
|
23 iListBox = new(ELeave) CEikColumnListBox; |
|
24 iListBox->ConstructL( this ); //This view is parent. No flags. Also constructs the associated list box model and item drawer for the list box. |
|
25 |
|
26 iListBox->SetContainerWindowL( *this ); |
|
27 iListBox->CreateScrollBarFrameL( ); |
|
28 iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto); |
|
29 |
|
30 iListBox->SetPosition(TPoint(iBorder, aTablePosition + iBorder)); |
|
31 |
|
32 iListBox->SetSize(Rect().Size()-TSize(0, aTablePosition) -TSize(iBorder*2,iBorder*2)); |
|
33 |
|
34 iListBox->ActivateL(); |
|
35 |
|
36 iModel = iListBox->Model(); |
|
37 |
|
38 iTextArray = iModel->ItemTextArray(); |
|
39 iListBoxItems = static_cast<CDesCArray*>(iTextArray); |
|
40 iListBoxData = STATIC_CAST(CColumnListBoxItemDrawer*,iListBox->View()->ItemDrawer())->ColumnData(); |
|
41 |
|
42 } |
|
43 |
|
44 CResourceList::~CResourceList() |
|
45 { |
|
46 delete iListBox; |
|
47 iModel = NULL; |
|
48 iTextArray = NULL; |
|
49 iListBoxItems = NULL; |
|
50 iListBoxData = NULL; |
|
51 } |
|
52 |
|
53 CCoeControl* CResourceList::GetListBox() const |
|
54 { |
|
55 return iListBox; |
|
56 } |
|
57 |
|
58 void CResourceList::EmptyList() |
|
59 { |
|
60 iListBoxItems->Reset(); |
|
61 iListBox->Reset(); |
|
62 } |
|
63 |
|
64 #ifdef UIQ |
|
65 #define CW_Id 40 |
|
66 #define CW_HalId 35 |
|
67 #define CW_DriveAtt 35 |
|
68 #define CW_Short 45 |
|
69 #define CW_UID 75 |
|
70 #define CW_ExT_R 50 |
|
71 #define CW_Medium 60 |
|
72 #define CW_Long 90 |
|
73 #define CW_Priority 60 |
|
74 #define CW_ProcessId 70 |
|
75 #define CW_Read 50 |
|
76 #define CW_Writeable 70 |
|
77 #define CW_Dynamic 60 |
|
78 #define CW_List 60 |
|
79 #define CW_DriveSize 70 |
|
80 #define CW_Count 80 |
|
81 #define CW_MemSize 90 |
|
82 #define CW_HalName 200 |
|
83 #define CW_MutexName 280 |
|
84 #define CW_Media 120 |
|
85 #define CW_Name 135 |
|
86 #define CW_ProcessName 220 |
|
87 #define CW_ExitCat 80 |
|
88 #define CW_ChunkName 380 |
|
89 #define CW_SemName 300 |
|
90 #define CW_ThreadName 370 |
|
91 #define CW_LongName 250 |
|
92 #define CW_Message 250 |
|
93 #define CW_FileName 400 |
|
94 #define GapWidth 10 |
|
95 #endif |
|
96 #ifdef TV |
|
97 #define CW_Id 25 |
|
98 #define CW_HalId 45 |
|
99 #define CW_DriveAtt 60 |
|
100 #define CW_Short 60 |
|
101 #define CW_UID 100 |
|
102 #define CW_Medium 90 |
|
103 #define CW_Long 115 |
|
104 #define CW_Priority 85 |
|
105 #define CW_ProcessId 95 |
|
106 #define CW_Writeable 90 |
|
107 #define CW_Read 70 |
|
108 #define CW_Name 195 |
|
109 #define CW_ProcessName 195 |
|
110 #define CW_ExitCat 185 |
|
111 #define CW_ChunkName 350 |
|
112 #define CW_SemName 305 |
|
113 #define CW_HalName 260 |
|
114 #define CW_ThreadName 380 |
|
115 #define CW_LongName 380 |
|
116 #define CW_Message 380 |
|
117 #define CW_ExT_R 70 |
|
118 #define CW_MutexName 305 |
|
119 #define CW_FileName 500 |
|
120 #define CW_Media 140 |
|
121 #define CW_List 150 |
|
122 #define CW_Dynamic 100 |
|
123 #define CW_Count 115 |
|
124 #define CW_MemSize 130 |
|
125 #define GapWidth 25 |
|
126 #endif |
|
127 |
|
128 void CResourceList::SetUpProcessTable() |
|
129 { |
|
130 // deal with the columns |
|
131 iListBoxData->SetColumnWidthPixelL( 0, CW_Id ); |
|
132 iListBoxData->SetColumnWidthPixelL( 1, CW_ProcessName ); |
|
133 iListBoxData->SetColumnAlignmentL( 1, CGraphicsContext::ELeft); |
|
134 iListBoxData->SetColumnWidthPixelL( 2, CW_Medium ); //Priority |
|
135 iListBoxData->SetColumnAlignmentL( 2, CGraphicsContext::ERight); |
|
136 iListBoxData->SetColumnWidthPixelL( 3, CW_Short ); //Prot? |
|
137 iListBoxData->SetColumnAlignmentL( 3, CGraphicsContext::ERight); |
|
138 iListBoxData->SetColumnWidthPixelL( 4, CW_Short ); //Sys? |
|
139 iListBoxData->SetColumnAlignmentL( 4, CGraphicsContext::ERight); |
|
140 iListBoxData->SetColumnWidthPixelL( 5, CW_Short ); //Owner Id |
|
141 iListBoxData->SetColumnAlignmentL( 5, CGraphicsContext::ERight); |
|
142 iListBoxData->SetColumnWidthPixelL( 6, CW_Medium ); //Exit T. |
|
143 iListBoxData->SetColumnAlignmentL( 6, CGraphicsContext::ERight); |
|
144 iListBoxData->SetColumnWidthPixelL( 7, CW_Short ); // Exit R |
|
145 iListBoxData->SetColumnAlignmentL( 7, CGraphicsContext::ERight); |
|
146 iListBoxData->SetColumnWidthPixelL( 8, CW_Short ); // Exit C |
|
147 iListBoxData->SetColumnAlignmentL( 8, CGraphicsContext::ERight); |
|
148 iListBoxData->SetColumnWidthPixelL( 9, CW_UID ); // Uid 0 |
|
149 iListBoxData->SetColumnAlignmentL( 9, CGraphicsContext::ERight); |
|
150 iListBoxData->SetColumnWidthPixelL( 10, CW_UID ); //Uid 1 |
|
151 iListBoxData->SetColumnAlignmentL( 10, CGraphicsContext::ERight); |
|
152 iListBoxData->SetColumnWidthPixelL( 11, CW_UID + GapWidth ); // Uid 2 |
|
153 iListBoxData->SetColumnAlignmentL( 11, CGraphicsContext::ERight); |
|
154 iListBoxData->SetColumnHorizontalGapL(11, GapWidth); |
|
155 iListBoxData->SetColumnWidthPixelL( 12, CW_FileName ); // File Name |
|
156 iListBoxData->SetColumnHorizontalGapL(12, GapWidth); |
|
157 |
|
158 TBuf<1000> titles(_L("Id\tName\tPriority\tProt?\tSys?\tOwner\tExit T.\tExit R.\tExit C.\tUid 0\tUid 1\tUid 2\tExecutable File")); |
|
159 iListBoxItems->AppendL(titles); |
|
160 } |
|
161 |
|
162 void CResourceList::SetUpThreadTable() |
|
163 { |
|
164 iListBoxData->SetColumnWidthPixelL( 0, CW_Id ); |
|
165 iListBoxData->SetColumnWidthPixelL( 1, CW_ThreadName ); |
|
166 iListBoxData->SetColumnAlignmentL( 1, CGraphicsContext::ELeft); |
|
167 iListBoxData->SetColumnWidthPixelL( 2, CW_Priority ); //Priority |
|
168 iListBoxData->SetColumnAlignmentL( 2, CGraphicsContext::ERight); |
|
169 iListBoxData->SetColumnWidthPixelL( 3, CW_ProcessId ); //ProcessId |
|
170 iListBoxData->SetColumnAlignmentL( 3, CGraphicsContext::ERight); |
|
171 iListBoxData->SetColumnWidthPixelL( 4, CW_Medium ); //Stack Sz |
|
172 iListBoxData->SetColumnAlignmentL( 4, CGraphicsContext::ERight); |
|
173 iListBoxData->SetColumnWidthPixelL( 5, CW_Medium ); //Heap Sz |
|
174 iListBoxData->SetColumnAlignmentL( 5, CGraphicsContext::ERight); |
|
175 iListBoxData->SetColumnWidthPixelL( 6, CW_Short ); //Prot? |
|
176 iListBoxData->SetColumnAlignmentL( 6, CGraphicsContext::ERight); |
|
177 iListBoxData->SetColumnWidthPixelL( 7, CW_Short ); //Sys? |
|
178 iListBoxData->SetColumnAlignmentL( 7, CGraphicsContext::ERight); |
|
179 iListBoxData->SetColumnWidthPixelL( 8, CW_Medium ); //Exit T. |
|
180 iListBoxData->SetColumnAlignmentL( 8, CGraphicsContext::ERight); |
|
181 iListBoxData->SetColumnWidthPixelL( 9, CW_Short ); //Exit R. |
|
182 iListBoxData->SetColumnAlignmentL( 9, CGraphicsContext::ERight); |
|
183 iListBoxData->SetColumnWidthPixelL( 10, CW_Short ); //Exit C. |
|
184 iListBoxData->SetColumnAlignmentL( 10, CGraphicsContext::ERight); |
|
185 |
|
186 TBuf<1000> titles(_L("Id\tName\tPriority\tProcess\tStack Sz\tHeap Sz\tProt?\tSys?\tExit T.\tExit R.\tExit C.")); |
|
187 iListBoxItems->AppendL(titles); |
|
188 } |
|
189 |
|
190 void CResourceList::SetUpChunkTable() |
|
191 { |
|
192 iListBoxData->SetColumnWidthPixelL( 0, CW_ChunkName ); |
|
193 iListBoxData->SetColumnWidthPixelL( 1, CW_Medium ); |
|
194 iListBoxData->SetColumnAlignmentL(1, CGraphicsContext::ERight); |
|
195 iListBoxData->SetColumnWidthPixelL( 2, CW_Medium + GapWidth ); |
|
196 iListBoxData->SetColumnAlignmentL(2, CGraphicsContext::ERight); |
|
197 iListBoxData->SetColumnHorizontalGapL( 2, GapWidth); |
|
198 iListBoxData->SetColumnWidthPixelL( 3, CW_Read ); |
|
199 iListBoxData->SetColumnAlignmentL( 3, CGraphicsContext::ELeft); |
|
200 iListBoxData->SetColumnWidthPixelL( 4, CW_Writeable ); |
|
201 iListBoxData->SetColumnAlignmentL( 4, CGraphicsContext::ELeft); |
|
202 |
|
203 TBuf<1000> titles(_L("Name\tSize\tMax Size\tRead-/\tWrite-able")); |
|
204 iListBoxItems->AppendL(titles); |
|
205 } |
|
206 |
|
207 void CResourceList::SetUpSemaphoreTable() |
|
208 { |
|
209 iListBoxData->SetColumnWidthPixelL( 0, CW_SemName ); |
|
210 iListBoxData->SetColumnWidthPixelL( 1, CW_Count ); |
|
211 iListBoxData->SetColumnAlignmentL(1, CGraphicsContext::ERight); |
|
212 iListBoxData->SetColumnWidthPixelL( 2, CW_Count ); |
|
213 iListBoxData->SetColumnAlignmentL(2, CGraphicsContext::ERight); |
|
214 |
|
215 TBuf<1000> titles(_L("Name\tHex Count\tDec Count")); |
|
216 iListBoxItems->AppendL(titles); |
|
217 } |
|
218 |
|
219 void CResourceList::SetUpMutexTable() |
|
220 { |
|
221 iListBoxData->SetColumnWidthPixelL( 0, CW_MutexName ); |
|
222 iListBoxData->SetColumnWidthPixelL( 1, CW_Count ); |
|
223 iListBoxData->SetColumnAlignmentL(1, CGraphicsContext::ERight); |
|
224 iListBoxData->SetColumnWidthPixelL( 2, CW_Count ); |
|
225 iListBoxData->SetColumnAlignmentL(2, CGraphicsContext::ERight); |
|
226 |
|
227 TBuf<1000> titles(_L("Name\tHex Count\tDec Count")); |
|
228 iListBoxItems->AppendL(titles); |
|
229 } |
|
230 |
|
231 |
|
232 void CResourceList::SetUpDriveTable() |
|
233 { |
|
234 iListBoxData->SetColumnWidthPixelL( 0, CW_Short ); |
|
235 iListBoxData->SetColumnWidthPixelL( 1, CW_Long ); |
|
236 iListBoxData->SetColumnAlignmentL( 1, CGraphicsContext::ELeft); |
|
237 iListBoxData->SetColumnHorizontalGapL( 1, GapWidth); |
|
238 iListBoxData->SetColumnWidthPixelL( 2, CW_Short + GapWidth ); |
|
239 iListBoxData->SetColumnAlignmentL( 2, CGraphicsContext::ELeft); |
|
240 iListBoxData->SetColumnHorizontalGapL(2, GapWidth); |
|
241 iListBoxData->SetColumnWidthPixelL( 3, CW_Media ); //Media |
|
242 iListBoxData->SetColumnAlignmentL( 3, CGraphicsContext::ELeft); |
|
243 iListBoxData->SetColumnWidthPixelL( 4, CW_DriveAtt ); //Attr. |
|
244 iListBoxData->SetColumnAlignmentL( 4, CGraphicsContext::ELeft); |
|
245 iListBoxData->SetColumnWidthPixelL( 5, CW_MemSize ); |
|
246 iListBoxData->SetColumnAlignmentL(5, CGraphicsContext::ERight); |
|
247 iListBoxData->SetColumnWidthPixelL( 6, CW_MemSize ); |
|
248 iListBoxData->SetColumnAlignmentL(6, CGraphicsContext::ERight); |
|
249 #if defined(WINS) |
|
250 iListBoxData->SetColumnWidthPixelL( 7, CW_Message ); |
|
251 iListBoxData->SetColumnAlignmentL(7, CGraphicsContext::ELeft); |
|
252 #endif |
|
253 |
|
254 TBuf<1000> titles(_L("Drive\tVol. name\tNo.\tMedia\tAtt.\tSize (bytes)\tFree (bytes)")); |
|
255 #if defined(WINS) |
|
256 titles.Append(_L("\t(not retrievable in WINS)")); |
|
257 #endif |
|
258 iListBoxItems->AppendL(titles); |
|
259 } |
|
260 |
|
261 void CResourceList::SetUpHalTable() |
|
262 { |
|
263 iListBoxData->SetColumnWidthPixelL( 0, CW_HalId ); |
|
264 iListBoxData->SetColumnWidthPixelL( 1, CW_HalName ); |
|
265 iListBoxData->SetColumnAlignmentL(1, CGraphicsContext::ELeft); |
|
266 iListBoxData->SetColumnWidthPixelL( 2, CW_Dynamic ); |
|
267 iListBoxData->SetColumnAlignmentL( 2, CGraphicsContext::ECenter); |
|
268 iListBoxData->SetColumnWidthPixelL( 3, CW_MemSize ); |
|
269 iListBoxData->SetColumnAlignmentL(3, CGraphicsContext::ERight); |
|
270 iListBoxData->SetColumnWidthPixelL( 4, CW_MemSize ); |
|
271 iListBoxData->SetColumnAlignmentL(4, CGraphicsContext::ERight); |
|
272 |
|
273 TBuf<1000> titles(_L("No.\tName\tDynamic\tDec Value\tHex Value")); |
|
274 iListBoxItems->AppendL(titles); |
|
275 } |
|
276 |
|
277 void CResourceList::SetUpList() |
|
278 { |
|
279 iListBoxData->SetColumnWidthPixelL( 0, 300 ); |
|
280 } |
|
281 |
|
282 void CResourceList::UpdateListData() |
|
283 { |
|
284 CResourceList::EmptyList(); |
|
285 |
|
286 switch (iObjectsViewed) |
|
287 { |
|
288 case EObjectProcess: |
|
289 SetUpProcessTable(); |
|
290 break; |
|
291 case EObjectThread: |
|
292 SetUpThreadTable(); |
|
293 break; |
|
294 case EObjectChunk: |
|
295 SetUpChunkTable(); |
|
296 break; |
|
297 case EObjectLibrary: |
|
298 SetUpList(); |
|
299 break; |
|
300 case EObjectServer: |
|
301 SetUpList(); |
|
302 break; |
|
303 case EObjectSemaphore: |
|
304 SetUpSemaphoreTable(); |
|
305 break; |
|
306 case EObjectMutex: |
|
307 SetUpMutexTable(); |
|
308 break; |
|
309 case EObjectLogicalDevice: |
|
310 SetUpList(); |
|
311 break; |
|
312 case EObjectPhysicalDevice: |
|
313 SetUpList(); |
|
314 break; |
|
315 case EObjectLogicalChannel: |
|
316 SetUpList(); |
|
317 break; |
|
318 case EObjectWindow: |
|
319 SetUpList(); |
|
320 break; |
|
321 case EObjectDrive: |
|
322 SetUpDriveTable(); |
|
323 break; |
|
324 case EObjectHal: |
|
325 SetUpHalTable(); |
|
326 break; |
|
327 default: break; |
|
328 } |
|
329 GetResourceList(); |
|
330 } |
|
331 |
|
332 void CResourceList::GetResourceList() |
|
333 { |
|
334 switch(iObjectsViewed) |
|
335 { |
|
336 case EObjectProcess: |
|
337 GetProcessList(); |
|
338 break; |
|
339 case EObjectThread: |
|
340 GetThreadList(); |
|
341 break; |
|
342 case EObjectChunk: |
|
343 GetChunkList(); |
|
344 break; |
|
345 case EObjectLibrary: |
|
346 GetLibraryList(); |
|
347 break; |
|
348 case EObjectServer: |
|
349 GetServerList(); |
|
350 break; |
|
351 case EObjectSemaphore: |
|
352 GetSemaphoreList(); |
|
353 break; |
|
354 case EObjectMutex: |
|
355 GetMutexList(); |
|
356 break; |
|
357 case EObjectLogicalDevice: |
|
358 GetLogicalDeviceList(); |
|
359 break; |
|
360 case EObjectPhysicalDevice: |
|
361 GetPhysicalDeviceList(); |
|
362 break; |
|
363 case EObjectLogicalChannel: |
|
364 GetLogicalChannelList(); |
|
365 break; |
|
366 case EObjectWindow: |
|
367 GetWindowList(); |
|
368 break; |
|
369 case EObjectDrive: |
|
370 GetDriveList(); |
|
371 break; |
|
372 case EObjectHal: |
|
373 GetHalList(); |
|
374 break; |
|
375 default: |
|
376 break; |
|
377 } |
|
378 } |
|
379 |
|
380 void CResourceList::GetProcessList(void) |
|
381 { |
|
382 TName prefix(KAsterisk); |
|
383 TFindProcess findHb; |
|
384 findHb.Find(prefix); |
|
385 TFullName name; |
|
386 |
|
387 TInt number=0; |
|
388 while (findHb.Next(name)==KErrNone) |
|
389 { |
|
390 number++; |
|
391 GetProcessData(name); |
|
392 AddRow( iProcessData); |
|
393 } |
|
394 UpdateResourceCount(number); |
|
395 } |
|
396 |
|
397 void CResourceList::GetThreadList(void) |
|
398 { |
|
399 TName prefix(KAsterisk); |
|
400 TFindThread findHb; |
|
401 findHb.Find(prefix); |
|
402 TFullName name; |
|
403 TInt number=0; |
|
404 while (findHb.Next(name)==KErrNone) |
|
405 { |
|
406 number++; |
|
407 GetThreadData(name); |
|
408 AddRow( iThreadData); |
|
409 } |
|
410 UpdateResourceCount(number); |
|
411 } |
|
412 |
|
413 |
|
414 void CResourceList::GetChunkList(void) |
|
415 { |
|
416 TName prefix(KAsterisk); |
|
417 TFindChunk findHb; |
|
418 findHb.Find(prefix); |
|
419 TFullName name; |
|
420 |
|
421 TInt number=0; |
|
422 while (findHb.Next(name)==KErrNone) |
|
423 { |
|
424 number++; |
|
425 GetChunkData(findHb, name); |
|
426 |
|
427 AddRow(iChunkData); |
|
428 } |
|
429 |
|
430 UpdateResourceCount(number); |
|
431 } |
|
432 |
|
433 void CResourceList::GetLibraryList(void) |
|
434 { |
|
435 TName prefix(KAsterisk); |
|
436 TFindLibrary findHb; |
|
437 findHb.Find(prefix); |
|
438 TFullName name; |
|
439 TInt number=0; |
|
440 while (findHb.Next(name)==KErrNone) |
|
441 { |
|
442 number++; |
|
443 // Name |
|
444 iListData.iName.Copy(name); |
|
445 AddRow(iListData); |
|
446 } |
|
447 |
|
448 UpdateResourceCount(number); |
|
449 } |
|
450 |
|
451 void CResourceList::GetServerList(void) |
|
452 { |
|
453 TName prefix(KAsterisk); |
|
454 TFindServer findHb; |
|
455 findHb.Find(prefix); |
|
456 TFullName name; |
|
457 TInt number=0; |
|
458 while (findHb.Next(name)==KErrNone) |
|
459 { |
|
460 number++; |
|
461 iListData.iName.Copy(name); |
|
462 AddRow(iListData); |
|
463 |
|
464 } |
|
465 |
|
466 UpdateResourceCount(number); |
|
467 } |
|
468 |
|
469 void CResourceList::GetSemaphoreList(void) |
|
470 { |
|
471 TName prefix(KAsterisk); |
|
472 TFindSemaphore findHb; |
|
473 findHb.Find(prefix); |
|
474 TFullName name; |
|
475 |
|
476 TInt number=0; |
|
477 while (findHb.Next(name)==KErrNone) |
|
478 { |
|
479 number++; |
|
480 GetSemaphoreData(findHb, name); |
|
481 AddRow(iSemaphoreData); |
|
482 } |
|
483 |
|
484 UpdateResourceCount(number); |
|
485 } |
|
486 |
|
487 void CResourceList::GetMutexList(void) |
|
488 { |
|
489 TName prefix(KAsterisk); |
|
490 TFindMutex findHb; |
|
491 findHb.Find(prefix); |
|
492 TFullName name; |
|
493 |
|
494 TInt number=0; |
|
495 while (findHb.Next(name)==KErrNone) |
|
496 { |
|
497 number++; |
|
498 GetMutexData(findHb, name); |
|
499 AddRow(iMutexData); |
|
500 } |
|
501 |
|
502 UpdateResourceCount(number); |
|
503 } |
|
504 |
|
505 void CResourceList::GetLogicalDeviceList(void) |
|
506 { |
|
507 TName prefix(KAsterisk); |
|
508 TFindLogicalDevice findHb; |
|
509 findHb.Find(prefix); |
|
510 TFullName name; |
|
511 |
|
512 TInt number=0; |
|
513 while (findHb.Next(name)==KErrNone) |
|
514 { |
|
515 number++; |
|
516 iListData.iName.Copy(name); |
|
517 AddRow(iListData); |
|
518 } |
|
519 |
|
520 UpdateResourceCount(number); |
|
521 } |
|
522 |
|
523 void CResourceList::GetPhysicalDeviceList(void) |
|
524 { |
|
525 TName prefix(KAsterisk); |
|
526 TFindPhysicalDevice findHb; |
|
527 findHb.Find(prefix); |
|
528 TFullName name; |
|
529 |
|
530 TInt number=0; |
|
531 while (findHb.Next(name)==KErrNone) |
|
532 { |
|
533 number++; |
|
534 iListData.iName.Copy(name); |
|
535 AddRow(iListData); |
|
536 |
|
537 } |
|
538 |
|
539 UpdateResourceCount(number); |
|
540 } |
|
541 |
|
542 void CResourceList::GetLogicalChannelList(void) |
|
543 { |
|
544 UpdateResourceCount(0); |
|
545 } |
|
546 |
|
547 void CResourceList::GetWindowList(void) |
|
548 { |
|
549 RWsSession ws; |
|
550 TInt err = ws.Connect(); |
|
551 if (err == KErrNone) |
|
552 { |
|
553 |
|
554 TInt number = ws.NumWindowGroups(0); |
|
555 |
|
556 CArrayFixFlat<TInt>* wgIds = new(ELeave) CArrayFixFlat<TInt>(number); |
|
557 |
|
558 ws.WindowGroupList(0,wgIds); |
|
559 |
|
560 CApaWindowGroupName* wgName = CApaWindowGroupName::NewLC(ws); |
|
561 |
|
562 for (TInt i=0; i<number; ++i) |
|
563 { |
|
564 TInt wgId=(*wgIds)[i]; |
|
565 |
|
566 wgName->ConstructFromWgIdL(wgId); |
|
567 iListData.iName.Copy(wgName->Caption()); |
|
568 AddRow(iListData); |
|
569 |
|
570 } |
|
571 CleanupStack::PopAndDestroy(wgName); |
|
572 |
|
573 delete wgIds; |
|
574 wgIds = NULL; |
|
575 |
|
576 UpdateResourceCount(number); |
|
577 |
|
578 ws.Close(); |
|
579 } |
|
580 } |
|
581 |
|
582 void CResourceList::GetDriveList() |
|
583 { |
|
584 RFs fileServer; |
|
585 User::LeaveIfError(fileServer.Connect()); |
|
586 TInt err1,err2; |
|
587 TInt number=0; |
|
588 TInt driveNum=0; |
|
589 |
|
590 TDriveInfo driveInfo; |
|
591 TVolumeInfo volumeInfo; |
|
592 TDriveUnit driveUnit(EDriveA); |
|
593 |
|
594 |
|
595 do { |
|
596 driveUnit = driveNum; |
|
597 err1 = fileServer.Volume(volumeInfo,driveUnit); |
|
598 err2 = fileServer.Drive(driveInfo, driveUnit); |
|
599 if (err1==KErrNone && err2==KErrNone) |
|
600 { |
|
601 GetDriveData(driveNum, driveUnit, volumeInfo); //sets drive data to iDriveData |
|
602 AddRow(iDriveData); |
|
603 number++; |
|
604 } |
|
605 driveNum++; |
|
606 } while (driveNum <= EDriveZ); |
|
607 fileServer.Close(); |
|
608 UpdateResourceCount(number); |
|
609 } |
|
610 |
|
611 void CResourceList::GetHalList() |
|
612 { |
|
613 TInt number=0; |
|
614 |
|
615 HAL::SEntry* aSEntry = NULL; |
|
616 TInt numOfEntries, error; |
|
617 error = HAL::GetAll(numOfEntries, aSEntry); |
|
618 |
|
619 if (error ==KErrNone) |
|
620 { |
|
621 for (TInt iEntryNum=0; iEntryNum<numOfEntries; ++iEntryNum) |
|
622 { |
|
623 if (aSEntry[iEntryNum].iProperties & HAL::EEntryValid) |
|
624 { |
|
625 number++; |
|
626 GetHalData(iEntryNum, aSEntry); |
|
627 |
|
628 AddRow(iHalData); |
|
629 |
|
630 } |
|
631 } |
|
632 } |
|
633 |
|
634 UpdateResourceCount(number); |
|
635 User::Free(aSEntry); |
|
636 } |
|
637 |
|
638 void CResourceList::AddRow(const TProcessData& aProcessData) |
|
639 { |
|
640 // The actual item text format depends on the listbox type, see tables with listbox types |
|
641 TBuf<1000> item; |
|
642 item.Format(_L("%S\t%S\t%S\t%S\t%S\t%S\t%S\t%S\t%S\t%S\t%S\t%S\t%S\t"), &aProcessData.iIdString, |
|
643 &aProcessData.iProcessName, |
|
644 &aProcessData.iPriorityString, |
|
645 &aProcessData.iProtectedIndicator, |
|
646 &aProcessData.iSystemIndicator, |
|
647 &aProcessData.iOwnerIdString, |
|
648 &aProcessData.iExitTypeString, |
|
649 &aProcessData.iExitReasonString, |
|
650 &aProcessData.iExitCategoryName, |
|
651 &aProcessData.iUidType0String, |
|
652 &aProcessData.iUidType1String, |
|
653 &aProcessData.iUidType2String, |
|
654 &aProcessData.iFileName); |
|
655 |
|
656 iListBoxItems->AppendL(item); |
|
657 iListBox->HandleItemAdditionL(); |
|
658 iListBox->DrawDeferred(); |
|
659 } |
|
660 |
|
661 void CResourceList::AddRow(const TChunkData& aChunkData) |
|
662 { |
|
663 // The actual item text format depends on the listbox type, see tables with listbox types |
|
664 TBuf<1000> item; |
|
665 item.Format(_L("%S\t%S\t%S\t%S\t%S"), &aChunkData.iChunkName, |
|
666 &aChunkData.iSizeString, |
|
667 &aChunkData.iMaxSizeString, |
|
668 &aChunkData.iReadableIndicator, |
|
669 &aChunkData.iWritableIndicator); |
|
670 |
|
671 iListBoxItems->AppendL(item); |
|
672 iListBox->HandleItemAdditionL(); |
|
673 iListBox->DrawDeferred(); |
|
674 } |
|
675 |
|
676 void CResourceList::AddRow(const TThreadData& aThreadData) |
|
677 { |
|
678 // The actual item text format depends on the listbox type, see tables with listbox types |
|
679 TBuf<1000> item; |
|
680 item.Format(_L("%S\t%S\t%S\t%S\t%S\t%S\t%S\t%S\t%S\t%S\t%S\t"), &aThreadData.iIdString, |
|
681 &aThreadData.iThreadName, |
|
682 &aThreadData.iPriorityString, |
|
683 &aThreadData.iOwnerIdString, |
|
684 &aThreadData.iStackSizeString, |
|
685 &aThreadData.iHeapSizeString, |
|
686 &aThreadData.iProtectedIndicator, |
|
687 &aThreadData.iSystemIndicator, |
|
688 &aThreadData.iExitTypeString, |
|
689 &aThreadData.iExitReasonString, |
|
690 &aThreadData.iExitCategoryName); |
|
691 |
|
692 iListBoxItems->AppendL(item); |
|
693 iListBox->HandleItemAdditionL(); |
|
694 iListBox->DrawDeferred(); |
|
695 } |
|
696 |
|
697 void CResourceList::AddRow(const TSemaphoreData& aSemaphoreData) |
|
698 { |
|
699 // The actual item text format depends on the listbox type, see tables with listbox types |
|
700 TBuf<1000> item; |
|
701 item.Format(_L("%S\t%S\t%S\t"), &aSemaphoreData.iSemaphoreName, |
|
702 &aSemaphoreData.iHexCountString, |
|
703 &aSemaphoreData.iDecCountString); |
|
704 |
|
705 iListBoxItems->AppendL(item); |
|
706 iListBox->HandleItemAdditionL(); |
|
707 iListBox->DrawDeferred(); |
|
708 } |
|
709 |
|
710 void CResourceList::AddRow(const TMutexData& aMutexData) |
|
711 { |
|
712 // The actual item text format depends on the listbox type, see tables with listbox types |
|
713 TBuf<1000> item; |
|
714 item.Format(_L("%S\t%S\t%S\t"), &aMutexData.iMutexName, |
|
715 &aMutexData.iHexCountString, |
|
716 &aMutexData.iDecCountString); |
|
717 |
|
718 iListBoxItems->AppendL(item); |
|
719 iListBox->HandleItemAdditionL(); |
|
720 iListBox->DrawDeferred(); |
|
721 } |
|
722 |
|
723 void CResourceList::AddRow(const TDriveData& aDriveData) |
|
724 { |
|
725 // The actual item text format depends on the listbox type, see tables with listbox types |
|
726 TBuf<1000> item; |
|
727 item.Format(_L("%S\t%S\t%S\t%S\t%S\t%S\t%S\t"), &aDriveData.iDriveName, |
|
728 &aDriveData.iVolumeName, |
|
729 &aDriveData.iDriveNumberString, |
|
730 &aDriveData.iMediaString, |
|
731 &aDriveData.iAttributesString, |
|
732 &aDriveData.iSpaceString, |
|
733 &aDriveData.iFreeSpaceString); |
|
734 |
|
735 iListBoxItems->AppendL(item); |
|
736 iListBox->HandleItemAdditionL(); |
|
737 iListBox->DrawDeferred(); |
|
738 } |
|
739 |
|
740 void CResourceList::AddRow(const THalData& aHalData) |
|
741 { |
|
742 // The actual item text format depends on the listbox type, see tables with listbox types |
|
743 TBuf<1000> item; |
|
744 item.Format(_L("%S\t%S\t%S\t%S\t%S\t"), &aHalData.iNumberString, |
|
745 &aHalData.iName, |
|
746 &aHalData.iDynamicIndicator, |
|
747 &aHalData.iDecValString, |
|
748 &aHalData.iHexValString); |
|
749 |
|
750 iListBoxItems->AppendL(item); |
|
751 iListBox->HandleItemAdditionL(); |
|
752 iListBox->DrawDeferred(); |
|
753 } |
|
754 |
|
755 void CResourceList::AddRow(const TListData& aListData) |
|
756 { |
|
757 // The actual item text format depends on the listbox type, see tables with listbox types |
|
758 TBuf<1000> item; |
|
759 item.Format(_L("%S"), &aListData.iName); |
|
760 |
|
761 iListBoxItems->AppendL(item); |
|
762 iListBox->HandleItemAdditionL(); |
|
763 iListBox->DrawDeferred(); |
|
764 } |
|