libraries/clogger/inc/CliServ.h
changeset 0 7f656887cf89
equal deleted inserted replaced
-1:000000000000 0:7f656887cf89
       
     1 // CliServ.h
       
     2 // 
       
     3 // Copyright (c) 2006 - 2010 Accenture. All rights reserved.
       
     4 // This component and the accompanying materials are made available
       
     5 // under the terms of the "Eclipse Public License v1.0"
       
     6 // which accompanies this distribution, and is available
       
     7 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 // 
       
     9 // Initial Contributors:
       
    10 // Accenture - Initial contribution
       
    11 //
       
    12 
       
    13 #ifndef CLISERV_H
       
    14 #define CLISERV_H
       
    15 
       
    16 #include <fshell/common.mmh>
       
    17 
       
    18 _LIT(KMyServerName,"CloggerServer");
       
    19 _LIT(KMyServerImg,"CloggerServer");		// DLL/EXE name
       
    20 const TUid KServerUid3 = { FSHELL_UID_CLOGGERSERVER };
       
    21 const TUid KCloggerUid = { FSHELL_UID_CLOGGERSERVER };
       
    22 
       
    23 enum TPubSubKeys
       
    24 	{
       
    25 	ESequenceNumber,
       
    26 	
       
    27 	EDebugRouterPtr = 1000, // Used only be debug router, included here for completeness
       
    28 	};
       
    29 
       
    30 #if defined(__WINS__) && !defined(EKA2)
       
    31 const TInt KMyServerStackSize=0x2000;			//  8KB
       
    32 const TInt KMyServerInitHeapSize=0x1000;		//  4KB
       
    33 const TInt KMyServerMaxHeapSize=0x1000000;		// 16MB
       
    34 #endif
       
    35 
       
    36 enum TOpPanic
       
    37 	{
       
    38 	EPanicBadDescriptor,
       
    39 	EPanicIllegalFunction,
       
    40 	ENotRegisteredForLogs,
       
    41 	};
       
    42 
       
    43 
       
    44 #ifdef HIDE_TSERVERSTART_FROM_DAMN_EIKSERVER
       
    45 
       
    46 class TServerStart;
       
    47 
       
    48 #else
       
    49 
       
    50 class TServerStart
       
    51 	{
       
    52 public:
       
    53 	TServerStart(TRequestStatus& aStatus);
       
    54 	TPtrC AsCommand() const;
       
    55 
       
    56 	TServerStart();
       
    57 	TInt GetCommand();
       
    58 	void SignalL();
       
    59 private:
       
    60 	TThreadId iId;
       
    61 	TRequestStatus* iStatus;
       
    62 	};
       
    63 
       
    64 #endif
       
    65 
       
    66 #define DISOWN(x) { delete x; x = NULL; }
       
    67 
       
    68 enum TCallbackCode
       
    69 	{
       
    70 	ETagEnabledChanged,
       
    71 	};
       
    72 
       
    73 /* Types:
       
    74  */
       
    75 class TServerCallback
       
    76 	{
       
    77 public:
       
    78 	TServerCallback() : iContextLength(0), iData() {}
       
    79 	TServerCallback(TCallbackCode aCode) : iCode(aCode), iContextLength(0), iData() {}
       
    80 
       
    81 	TCallbackCode iCode;
       
    82 	TInt iContextLength;
       
    83 	TBuf8<40> iData;
       
    84 	};
       
    85 
       
    86 /* Format of stuff in iData above (and any context) is a one character code (below) which identifies the type, 
       
    87  * followed by the data for that type. 16-bit descriptors are automatically 2-byte aligned. (If you didn't know 
       
    88  * this was a requirement to construct a TPtrC16, well you've learned something)
       
    89  * Types are:
       
    90  * i - TInt
       
    91  * u - TUint
       
    92  * P - TPoint
       
    93  * S - TSize
       
    94  * G - TRgb
       
    95  * R - TRect
       
    96  * D - TDesC16 (an 'i' followed by an int is written first for the length of the descriptor)
       
    97  * 8 - TDesC8  (an 'i' followed by an int is written first for the length of the descriptor)
       
    98  */
       
    99 
       
   100 enum TOpCode
       
   101 	{
       
   102 	EDummy, // Does nothing, just completes with no error
       
   103 	ERegisterCallbackNotifier = 1, // [TPkg<TServerCallback>]
       
   104 	EGetCallbackContext, // [TDes8]
       
   105 	EWriteCallbackResultAndReregister, // [TPkg<TServerCallback>, TDesX, len]
       
   106 	ECancelCallbackNotifier, // []
       
   107 	//EMultiball, // [a number of IPC args packaged in a TDesC8, num, TDes8 result, result len] async. result must be big enough to handle all the results from the IPC.
       
   108 
       
   109 	ESetTag, // [tag, secondLevelTag, TPckg<enabledMask>] returns sequence number that the enabledMask is valid for, or error
       
   110 	ESetTag8, // [tag, secondLevelTag, TPckg<enabledMask>]
       
   111 	ELog8, // [text, tickcount, logMask]
       
   112 	ESetEnabled, // [tag, logMask]
       
   113 	EIsEnabled, // [tag, TPkg<logMask>]
       
   114 	//ETailLogToRDebug, // [numChars]
       
   115 	//ETailLogToBuf, // [buf]
       
   116 	ESetGlobalOptions, // [flags]
       
   117 	EGetGlobalOptions, // []
       
   118 	ESetRamBufferSize, // [size, num]
       
   119 	EGetRamBufferSize, // [TPkg<size, num>]
       
   120 	ESetRotateBehaviour, // [numLogs, flags]
       
   121 	ERotate, // [filename(optional)]
       
   122 	EPersistSettings, // []
       
   123 	EResetSettings, // []
       
   124 	EGetTagStates1, // [TPkg<TServerCallback: enabledTagsBuf, tags...>]
       
   125 	EGetTagStates2, // [&context]
       
   126 	ESetTagStates, // [RBufStream: numTags, enabledTagsBuf, tags...]
       
   127 	EGetRotateBehaviour, // [TPkg<behaviour, numLogs>]
       
   128 	EHexDump, // [header, data, tickcount, logMask]
       
   129 	EUpdateEnabledMask, // [TPkg<logMask>]
       
   130 	ERegisterPerformanceLoggingChunk, // [chunkHandle]
       
   131 	ECreatePerformanceLoggingChunk, // [size]
       
   132 
       
   133 	EStartSessionWriterServer, //[]
       
   134 	ERegisterForLogMessages, // []
       
   135 	EGetNextLog, // [TPckg<TPtrC8>(aResultBuffer), sharedChunkBase]
       
   136 	ECancelGetNextLog, // []
       
   137 
       
   138 	EDebugAlignLogFile = 2000, // [lessThisAmount]
       
   139 	EDebugShutdownServer, // 2001, []
       
   140 	EHexDump16, // 2002, [header16, data, tickcount, logMask]
       
   141 	EDebugForceBreakpointInServiceL, // 2003
       
   142 	};
       
   143 
       
   144 _LIT(KSessionLogServer, "CloggerSessionLogServer");
       
   145 
       
   146 #endif