memspyui/ui/avkon/inc/MemSpyUiUtils.h
author hgs
Thu, 24 Jun 2010 14:55:55 +0300
changeset 31 e7a04a6385be
parent 26 41ebde60981f
permissions -rw-r--r--
201025
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
*
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
*
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
* Contributors:
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
*
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
* Description:
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
*
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
*/
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
#ifndef MEMSPYUIUTILS_H
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
#define MEMSPYUIUTILS_H
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
// System includes
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
#include <e32std.h>
31
hgs
parents: 26
diff changeset
    23
#include <e32const.h>
17
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
// Engine includes
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
#include <memspy/engine/memspyengineutils.h>
26
hgs
parents: 17
diff changeset
    27
#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
17
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    28
31
hgs
parents: 26
diff changeset
    29
typedef TBuf<20> TMemSpySizeText;
hgs
parents: 26
diff changeset
    30
26
hgs
parents: 17
diff changeset
    31
_LIT( KTab, "\t" );
31
hgs
parents: 26
diff changeset
    32
hgs
parents: 26
diff changeset
    33
//ThreadInfoItemList view types
26
hgs
parents: 17
diff changeset
    34
_LIT( KTypeUnknown, "Unknown Type" );
hgs
parents: 17
diff changeset
    35
_LIT( KGeneral, "General" );
hgs
parents: 17
diff changeset
    36
_LIT( KHeap, "Heap" );
hgs
parents: 17
diff changeset
    37
_LIT( KStack, "Stack" );
hgs
parents: 17
diff changeset
    38
_LIT( KChunks, "Chunks" );
hgs
parents: 17
diff changeset
    39
_LIT( KCodeSegs, "Code Segments" );
hgs
parents: 17
diff changeset
    40
_LIT( KOpenFiles, "Open Files" );
hgs
parents: 17
diff changeset
    41
_LIT( KActiveObjects, "Active Objects" );
hgs
parents: 17
diff changeset
    42
_LIT( KThreadHandlers, "Handlers to other Threads" );
hgs
parents: 17
diff changeset
    43
_LIT( KProcessHandlers, "Handlers to other Processes" );
hgs
parents: 17
diff changeset
    44
_LIT( KServers, "Servers running in Thread" );
hgs
parents: 17
diff changeset
    45
_LIT( KConnections, "Client <> Server Connections" );
hgs
parents: 17
diff changeset
    46
_LIT( KSemaphores, "Semaphores" );
hgs
parents: 17
diff changeset
    47
_LIT( KThreadReferences, "References in Thread" );
hgs
parents: 17
diff changeset
    48
_LIT( KProcessReferences, "References in Process" );
hgs
parents: 17
diff changeset
    49
_LIT( KMutexes, "Mutexes" );
hgs
parents: 17
diff changeset
    50
_LIT( KTimers, "Timers" );
hgs
parents: 17
diff changeset
    51
_LIT( KDD, "Logical DD Channels" );
hgs
parents: 17
diff changeset
    52
_LIT( KChangeNotif, "Change Notifiers" );
hgs
parents: 17
diff changeset
    53
_LIT( KUndertakers, "Undertakers" );
hgs
parents: 17
diff changeset
    54
_LIT( KLogicalDrivers, "Logical Device Drivers" );
hgs
parents: 17
diff changeset
    55
_LIT( KPhysicalDrivers, "Physical Device Drivers" );	
17
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    56
31
hgs
parents: 26
diff changeset
    57
//Kernel Object types
hgs
parents: 26
diff changeset
    58
_LIT( KTypeThread, "Thread" );
hgs
parents: 26
diff changeset
    59
_LIT( KTypeProcess, "Process" );
hgs
parents: 26
diff changeset
    60
_LIT( KTypeChunk, "Chunk" );
hgs
parents: 26
diff changeset
    61
_LIT( KTypeLibrary, "Library" );
hgs
parents: 26
diff changeset
    62
_LIT( KTypeSemaphore, "Semaphore" );
hgs
parents: 26
diff changeset
    63
_LIT( KTypeMutex, "Mutex" );
hgs
parents: 26
diff changeset
    64
_LIT( KTypeTimer, "Timer" );
hgs
parents: 26
diff changeset
    65
_LIT( KTypeServer, "Server" );
hgs
parents: 26
diff changeset
    66
_LIT( KTypeSession, "Session" );
hgs
parents: 26
diff changeset
    67
_LIT( KTypeLogicalDevice, "Logical Device" );
hgs
parents: 26
diff changeset
    68
_LIT( KTypePhysicalDevice, "Physical Device" );
hgs
parents: 26
diff changeset
    69
_LIT( KTypeLogicalChannel, "Logical Channel" );
hgs
parents: 26
diff changeset
    70
_LIT( KTypeChangeNotifier, "Change Notifier" );
hgs
parents: 26
diff changeset
    71
_LIT( KTypeUndertaker, "Undertaker" );
hgs
parents: 26
diff changeset
    72
_LIT( KTypeMsgQueue, "Msg. Queue" );
hgs
parents: 26
diff changeset
    73
_LIT( KTypePropertyRef, "Property Ref." );
hgs
parents: 26
diff changeset
    74
_LIT( KTypeCondVar, "Conditional Var." );
hgs
parents: 26
diff changeset
    75
hgs
parents: 26
diff changeset
    76
17
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    77
class MemSpyUiUtils : public MemSpyEngineUtils
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    78
    {
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    79
public:
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    80
    static void Format( TDes& aBuf, TInt aResourceId, ...);
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    81
    static void GetErrorText( TDes& aBuf, TInt aError );
26
hgs
parents: 17
diff changeset
    82
    static HBufC* FormatItem( const TDesC& aCaption );
hgs
parents: 17
diff changeset
    83
    static TDesC& ThreadInfoItemNameByType( TMemSpyThreadInfoItemType aType );
31
hgs
parents: 26
diff changeset
    84
    static void AppendPriority( TDes& aDes, TProcessPriority aPriority );
hgs
parents: 26
diff changeset
    85
    static void AppendExitInfo( TDes& aDes, TExitType aType, TInt aExitReason, const TDesC& aExitCategory  );
hgs
parents: 26
diff changeset
    86
    static void AppendExitType( TDes& aDes, TExitType aType );
hgs
parents: 26
diff changeset
    87
    
hgs
parents: 26
diff changeset
    88
    //for Kernel Objects
hgs
parents: 26
diff changeset
    89
    static TPtrC TypeAsString( TMemSpyDriverContainerType aType );
hgs
parents: 26
diff changeset
    90
    static TMemSpySizeText FormatSizeText( const TInt64& aValue, TInt aDecimalPlaces, TBool aExtraRounding = EFalse );
17
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    91
    };
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    92
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    93
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    94
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    95
4f2773374eff Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    96
#endif