Update contrib.
1 // Copyright (c) 2003-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
21 #include <barsc2.h> // For CResourceFile
23 #include <logwrapconst.h>
25 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
26 #include <logwraplimits.h>
27 #include "logcntdef.h"
31 #include <logwrap.rsg>
34 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
36 Contact item ID. These are used to uniquely identify contact items within a contacts database.
40 typedef TInt32 TLogContactItemId;
48 typedef TUint32 TLogViewId;
51 const TLogFlags KLogNullFlags = 0;
52 const TLogFlags KLogFlagsMask = 0xF;
55 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
59 const TInt KLogActiveDoNotCompleteIfActive = KMaxTInt-1;
62 //SimId typedef. Probably the final version will import it from different header.
63 typedef TUint32 TSimId;
65 const TSimId KLogNullSimId = 0;
67 //**********************************
69 //**********************************
72 Common active object behaviour.
74 This is an abstract class that defines common active object behaviour for
75 the log engine classes.
79 class CLogActive : public CActive
82 IMPORT_C ~CLogActive();
85 IMPORT_C CLogActive(TInt aPriority);
86 IMPORT_C void Queue(TRequestStatus& aStatus);
87 IMPORT_C void Complete(TInt aStatus);
88 IMPORT_C void DoCancel();
93 virtual void DoRunL()=0;
94 IMPORT_C virtual void DoComplete(TInt&);
97 TRequestStatus* iReport;
100 //**********************************
102 //**********************************
105 Encapsulates the details of an event.
107 Where time is used, it must be specified as UTC rather than local time.
112 class CLogEvent : public CBase
115 IMPORT_C static CLogEvent* NewL();
116 IMPORT_C ~CLogEvent();
119 inline TLogId Id() const;
120 inline void SetId(TLogId aId);
122 inline TUid EventType() const;
123 inline void SetEventType(TUid aId);
125 inline const TDesC& RemoteParty() const;
126 inline void SetRemoteParty(const TDesC& aRemote);
128 inline const TDesC& Direction() const;
129 inline void SetDirection(const TDesC& aDirection);
131 inline const TTime& Time() const;
132 inline void SetTime(const TTime& aTime);
134 inline TLogDurationType DurationType() const;
135 inline void SetDurationType(TLogDurationType aDurationType);
137 inline TLogDuration Duration() const;
138 inline void SetDuration(TLogDuration aDuration);
140 inline const TDesC& Status() const;
141 inline void SetStatus(const TDesC& aStatus);
143 inline const TDesC& Subject() const;
144 inline void SetSubject(const TDesC& aSubject);
146 inline const TDesC& Number() const;
147 inline void SetNumber(const TDesC& aNumber);
149 inline TLogContactItemId Contact() const;
150 inline void SetContact(TLogContactItemId aContact);
152 inline TLogLink Link() const;
153 inline void SetLink(TLogLink aLink);
155 inline const TDesC& Description() const;
156 inline void SetDescription(const TDesC& aDescription);
158 inline TLogFlags Flags() const;
159 inline void SetFlags(TLogFlags aFlags);
160 inline void ClearFlags(TLogFlags aFlags);
162 inline const TDesC8& Data() const;
163 IMPORT_C void SetDataL(RReadStream& aStream, TInt aLen);
164 IMPORT_C void SetDataL(const TDesC8& aData);
166 IMPORT_C void CopyL(const CLogEvent& aEvent);
168 IMPORT_C void InternalizeL(RReadStream& aStream);
169 IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
171 IMPORT_C void SetSimId(TSimId aSimId);
172 IMPORT_C TSimId SimId() const;
177 void InternalizeBufL(RReadStream& aStream, HBufC*& aDes);
183 TLogDurationType iDurationType;
184 TLogDuration iDuration;
185 TLogContactItemId iContact;
195 #ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM
200 //**********************************
202 //**********************************
205 Base class for the log engine implementation.
207 This class defines the interface that client code uses to perform simple actions
210 The class provides default implementations for the event handling functions.
211 The Log Engine, i.e. an instance of CLogClient, is derived from this class
212 and provides implementations for the event handling functions.
214 The class also deals with some aspects of resource file handling.
216 An instance of this class is constructed by the log wrapper, CLogWrapper,
217 if the phone does not implement logging.
219 An instance of this class is never constructed by clients.
226 class CLogBase : public CLogActive
229 IMPORT_C CLogBase(TInt aPriority);
230 IMPORT_C ~CLogBase();
232 IMPORT_C virtual void GetEvent(CLogEvent& aEvent, TRequestStatus& aStatus);
233 IMPORT_C virtual void AddEvent(CLogEvent& aEvent, TRequestStatus& aStatus);
234 IMPORT_C virtual void ChangeEvent(const CLogEvent& aEvent, TRequestStatus& aStatus);
235 IMPORT_C virtual void DeleteEvent(TLogId aId, TRequestStatus& aStatus);
237 IMPORT_C virtual TInt GetString(TDes& aString, TInt aId) const;
240 IMPORT_C void LoadResourcesL(RFs& aFs);
241 inline const CResourceFile* ResourceFile() const;
247 CResourceFile* iResourceFile;
251 IMPORT_C virtual void CLogBase_Reserved1();
252 TAny* CLogBase_Reserved;
255 //**********************************
257 //**********************************
262 As some UI variants do not use a Log Engine, the log wrapper provides a consistent
263 interface to clients that need to work, without being changed, with multiple
266 The log wrapper is provided in its own DLL, the logwrap.dll.
268 If a Log Engine is not installed on a phone, the log wrapper creates an instance
269 of the CLogBase class, whose event handling requests complete with KErrNotSupported
270 and whose functions return KErrNotSupported.
272 If a Log Engine is installed on a phone, the log wrapper creates an instance
273 of the CLogClient class, provided in a separate DLL, the logcli.dll . The
274 CLogClient class derives from CLogBase and provides implementations for the
275 event handling requests and functions.
282 class CLogWrapper : public CBase
285 IMPORT_C static CLogWrapper* NewL(RFs& aFs, TInt aPriority = CActive::EPriorityStandard);
286 IMPORT_C ~CLogWrapper();
288 inline CLogBase& Log();
289 IMPORT_C TBool ClientAvailable() const;
293 void ConstructL(RFs& aFs, TInt aPriority);
299 #include <logwrap.inl>