epoc32/include/logwrap.h
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     7 //
     8 // Initial Contributors:
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
     9 // Nokia Corporation - initial contribution.
    10 //
    10 //
    11 // Contributors:
    11 // Contributors:
    17 #define __LOGWRAP_H__
    17 #define __LOGWRAP_H__
    18 
    18 
    19 #include <e32base.h>
    19 #include <e32base.h>
    20 #include <f32file.h>
    20 #include <f32file.h>
    21 #include <barsc2.h> // For CResourceFile
    21 #include <barsc2.h> // For CResourceFile
    22 #include <logcntdef.h>
       
    23 #include <d32dbms.h>
    22 #include <d32dbms.h>
       
    23 #include <logwrapconst.h>
       
    24 
       
    25 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS 
       
    26 	#include <logwraplimits.h>
       
    27 	#include "logcntdef.h"
       
    28 #endif
    24 
    29 
    25 #ifndef __WINC__
    30 #ifndef __WINC__
    26 #include <logwrap.rsg>
    31 #include <logwrap.rsg>
    27 #endif
    32 #endif
    28 
    33 
       
    34 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS 
       
    35 /** 
       
    36 Contact item ID. These are used to uniquely identify contact items within a contacts database.
       
    37 @publishedAll
       
    38 @released 
       
    39 */
       
    40 typedef TInt32 TLogContactItemId;
       
    41 
       
    42 #endif
       
    43 
    29 /**
    44 /**
    30 String lengths
    45 @publishedAll
    31 @internalAll
    46 @released
    32 */
    47 */
    33 const TInt KLogMaxRemotePartyLength = 64;
    48 typedef TUint32	TLogViewId;
    34 const TInt KLogMaxDirectionLength = 64;
    49 
    35 const TInt KLogMaxStatusLength = 64;
    50 
    36 const TInt KLogMaxSubjectLength = 64;
    51 const TLogFlags KLogNullFlags = 0;
    37 const TInt KLogMaxDescriptionLength = 64;
    52 const TLogFlags KLogFlagsMask = 0xF;
    38 const TInt KLogMaxSharedStringLength = 64;
    53 
    39 const TInt KLogMaxNumberLength = 100;
    54 
    40 
    55 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS 
    41 /** 
       
    42 Big enough to contain any of the above strings
       
    43 Defines a modifiable buffer descriptor into which a standard string from the 
       
    44 resource in the logwrap.dll resource file can be safely put.
       
    45 
       
    46 @see CLogClient::GetString()
       
    47 @publishedAll
       
    48 @released
       
    49 */
       
    50 typedef TBuf<64> TLogString;
       
    51 
       
    52 /** 
       
    53 Type definitions
       
    54 The unique event ID associated with a log event.
       
    55 
       
    56 @see CLogEvent
       
    57 @see CLogViewDuplicate
       
    58 @see CLogViewRecent
       
    59 @see CLogClient
       
    60 @see CLogBase 
       
    61 @publishedAll
       
    62 @released
       
    63 */
       
    64 typedef TInt32	TLogId;
       
    65 /** 
       
    66 The duration type of an event.
       
    67 
       
    68 @see CLogEvent
       
    69 @see CLogFilter
       
    70 @publishedAll
       
    71 @released
       
    72 */
       
    73 typedef TInt8	TLogDurationType;
       
    74 typedef TInt8	TLogRecentList;
       
    75 typedef TUint16 TLogSize;
       
    76 typedef TUint8	TLogRecentSize;
       
    77 /** 
       
    78 Duration of an event, expressed as the number of seconds since the time of 
       
    79 the event.
       
    80 
       
    81 @see CLogEvent
       
    82 @publishedAll
       
    83 @released
       
    84 */
       
    85 typedef TUint32	TLogDuration;
       
    86 typedef TUint32	TLogAge;
       
    87 /** 
       
    88 Link value relating a log event to an entity in another application.
       
    89 
       
    90 @see CLogEvent
       
    91 @publishedAll
       
    92 @released
       
    93 */
       
    94 typedef TUint32	TLogLink;
       
    95 typedef TInt16	TLogStringId;
       
    96 typedef TInt16	TLogTypeId;
       
    97 /** 
       
    98 The duration type of an event.
       
    99 
       
   100 @see CLogEvent
       
   101 @see CLogFilter
       
   102 @publishedAll
       
   103 @released
       
   104 */
       
   105 typedef TInt8	TLogDurationType;
       
   106 /** 
       
   107 Event flags.
       
   108 
       
   109 @see CLogEvent
       
   110 @see CLogFilter
       
   111 @publishedAll
       
   112 @released
       
   113 */
       
   114 typedef TUint8	TLogFlags;
       
   115 
       
   116 /**
    56 /**
   117 @internalAll
    57 @internalAll
   118 */
    58 */
   119 typedef TUint32	TLogViewId;
       
   120 
       
   121 /**
       
   122 Limits
       
   123 @internalAll
       
   124 */
       
   125 const TLogId KLogNullId = -1;
       
   126 const TLogDurationType KLogNullDurationType = -1;
       
   127 const TLogDuration KLogNullDuration = 0;
       
   128 const TLogLink KLogNullLink = 0;
       
   129 const TLogRecentList KLogNullRecentList = -1;
       
   130 const TLogStringId KLogNullStringId = -1;
       
   131 const TLogTypeId KLogNullTypeId = -1;
       
   132 const TLogFlags KLogNullFlags = 0;
       
   133 const TLogFlags KLogFlagsMask = 0xF;
       
   134 const TInt KLogFlagsCount = 4;
       
   135 const TInt KLogNeverUsedId = -2;
       
   136 
       
   137 /**
       
   138 @internalAll
       
   139 */
       
   140 const TInt KLogActiveDoNotCompleteIfActive = KMaxTInt-1;
    59 const TInt KLogActiveDoNotCompleteIfActive = KMaxTInt-1;
       
    60 #endif
       
    61 
       
    62 //SimId typedef. Probably the final version will import it from different header. 
       
    63 typedef TUint32 TSimId;
       
    64 //"Null" SimId value.
       
    65 const TSimId KLogNullSimId = 0;
   141 
    66 
   142 //**********************************
    67 //**********************************
   143 // CLogActive
    68 // CLogActive
   144 //**********************************
    69 //**********************************
   145 
    70 
   146 class CLogActive : public CActive
       
   147 /** 
    71 /** 
   148 Common active object behaviour.
    72 Common active object behaviour.
   149 
    73 
   150 This is an abstract class that defines common active object behaviour for 
    74 This is an abstract class that defines common active object behaviour for 
   151 the log engine classes.
    75 the log engine classes.
   152 @publishedAll
    76 @publishedAll
   153 @released
    77 @released
   154 */
    78 */
       
    79 class CLogActive : public CActive
   155 	{
    80 	{
   156 public:
    81 public:
   157 	IMPORT_C ~CLogActive();
    82 	IMPORT_C ~CLogActive();
   158 	//
    83 	//
   159 protected:
    84 protected:
   174 
    99 
   175 //**********************************
   100 //**********************************
   176 // CLogEvent
   101 // CLogEvent
   177 //**********************************
   102 //**********************************
   178 
   103 
       
   104 /** 
       
   105 Encapsulates the details of an event.
       
   106 
       
   107 Where time is used, it must be specified as UTC rather than local time.
       
   108 
       
   109 @publishedAll
       
   110 @released
       
   111 */
   179 class CLogEvent : public CBase
   112 class CLogEvent : public CBase
   180 /** 
       
   181 Encapsulates the details of an event.
       
   182 
       
   183 Where time is used, it must be specified as UTC rather than local time.
       
   184 
       
   185 @publishedAll
       
   186 @released
       
   187 */
       
   188 	{
   113 	{
   189 public:
   114 public:
   190 	IMPORT_C static CLogEvent* NewL();
   115 	IMPORT_C static CLogEvent* NewL();
   191 	IMPORT_C ~CLogEvent();
   116 	IMPORT_C ~CLogEvent();
   192 	//
   117 	//
   240 	//
   165 	//
   241 	IMPORT_C void CopyL(const CLogEvent& aEvent);
   166 	IMPORT_C void CopyL(const CLogEvent& aEvent);
   242 
   167 
   243 	IMPORT_C void InternalizeL(RReadStream& aStream);
   168 	IMPORT_C void InternalizeL(RReadStream& aStream);
   244 	IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
   169 	IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
   245 
   170 	//
       
   171 	IMPORT_C void SetSimId(TSimId aSimId);
       
   172 	IMPORT_C TSimId SimId() const;
   246 	//
   173 	//
   247 private:
   174 private:
   248 	CLogEvent();
   175 	CLogEvent();
   249 	void ConstructL();
   176 	void ConstructL();
   250 	void InternalizeBufL(RReadStream& aStream, HBufC*& aDes);
   177 	void InternalizeBufL(RReadStream& aStream, HBufC*& aDes);
   263 	HBufC* iDirection;
   190 	HBufC* iDirection;
   264 	HBufC* iStatus;
   191 	HBufC* iStatus;
   265 	HBufC* iSubject;
   192 	HBufC* iSubject;
   266 	HBufC* iNumber;
   193 	HBufC* iNumber;
   267 	HBufC8* iData;
   194 	HBufC8* iData;
       
   195 #ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM	
       
   196 	TSimId	iSimId;
       
   197 #endif	
   268 	};
   198 	};
   269 
   199 
   270 //**********************************
   200 //**********************************
   271 // CLogBase
   201 // CLogBase
   272 //**********************************
   202 //**********************************
   273 
   203 
   274 class CLogBase : public CLogActive
       
   275 /** 
   204 /** 
   276 Base class for the log engine implementation.
   205 Base class for the log engine implementation.
   277 
   206 
   278 This class defines the interface that client code uses to perform simple actions 
   207 This class defines the interface that client code uses to perform simple actions 
   279 on the log database.
   208 on the log database.
   292 @see CLogClient
   221 @see CLogClient
   293 @see CLogWrapper
   222 @see CLogWrapper
   294 @publishedAll
   223 @publishedAll
   295 @released
   224 @released
   296 */
   225 */
       
   226 class CLogBase : public CLogActive
   297 	{
   227 	{
   298 public:
   228 public:
   299 	IMPORT_C CLogBase(TInt aPriority);
   229 	IMPORT_C CLogBase(TInt aPriority);
   300 	IMPORT_C ~CLogBase();
   230 	IMPORT_C ~CLogBase();
   301 	//
   231 	//
   324 
   254 
   325 //**********************************
   255 //**********************************
   326 // CLogWrapper
   256 // CLogWrapper
   327 //**********************************
   257 //**********************************
   328 
   258 
   329 class CLogWrapper : public CBase
       
   330 /** 
   259 /** 
   331 The log wrapper.
   260 The log wrapper.
   332 
   261 
   333 As some UI variants do not use a Log Engine, the log wrapper provides a consistent 
   262 As some UI variants do not use a Log Engine, the log wrapper provides a consistent 
   334 interface to clients that need to work, without being changed, with multiple 
   263 interface to clients that need to work, without being changed, with multiple 
   348 @see CLogBase
   277 @see CLogBase
   349 @see CLogClient
   278 @see CLogClient
   350 @publishedAll
   279 @publishedAll
   351 @released
   280 @released
   352 */
   281 */
       
   282 class CLogWrapper : public CBase
   353 	{
   283 	{
   354 public:
   284 public:
   355 	IMPORT_C static CLogWrapper* NewL(RFs& aFs, TInt aPriority = CActive::EPriorityStandard);
   285 	IMPORT_C static CLogWrapper* NewL(RFs& aFs, TInt aPriority = CActive::EPriorityStandard);
   356 	IMPORT_C ~CLogWrapper();
   286 	IMPORT_C ~CLogWrapper();
   357 	//
   287 	//