Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
21 #include <barsc2.h> // For CResourceFile
22 #include <logcntdef.h>
26 #include <logwrap.rsg>
33 const TInt KLogMaxRemotePartyLength = 64;
34 const TInt KLogMaxDirectionLength = 64;
35 const TInt KLogMaxStatusLength = 64;
36 const TInt KLogMaxSubjectLength = 64;
37 const TInt KLogMaxDescriptionLength = 64;
38 const TInt KLogMaxSharedStringLength = 64;
39 const TInt KLogMaxNumberLength = 100;
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.
46 @see CLogClient::GetString()
50 typedef TBuf<64> TLogString;
54 The unique event ID associated with a log event.
57 @see CLogViewDuplicate
64 typedef TInt32 TLogId;
66 The duration type of an event.
73 typedef TInt8 TLogDurationType;
74 typedef TInt8 TLogRecentList;
75 typedef TUint16 TLogSize;
76 typedef TUint8 TLogRecentSize;
78 Duration of an event, expressed as the number of seconds since the time of
85 typedef TUint32 TLogDuration;
86 typedef TUint32 TLogAge;
88 Link value relating a log event to an entity in another application.
94 typedef TUint32 TLogLink;
95 typedef TInt16 TLogStringId;
96 typedef TInt16 TLogTypeId;
98 The duration type of an event.
105 typedef TInt8 TLogDurationType;
114 typedef TUint8 TLogFlags;
119 typedef TUint32 TLogViewId;
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;
140 const TInt KLogActiveDoNotCompleteIfActive = KMaxTInt-1;
142 //**********************************
144 //**********************************
146 class CLogActive : public CActive
148 Common active object behaviour.
150 This is an abstract class that defines common active object behaviour for
151 the log engine classes.
157 IMPORT_C ~CLogActive();
160 IMPORT_C CLogActive(TInt aPriority);
161 IMPORT_C void Queue(TRequestStatus& aStatus);
162 IMPORT_C void Complete(TInt aStatus);
163 IMPORT_C void DoCancel();
167 IMPORT_C void RunL();
168 virtual void DoRunL()=0;
169 IMPORT_C virtual void DoComplete(TInt&);
172 TRequestStatus* iReport;
175 //**********************************
177 //**********************************
179 class CLogEvent : public CBase
181 Encapsulates the details of an event.
183 Where time is used, it must be specified as UTC rather than local time.
190 IMPORT_C static CLogEvent* NewL();
191 IMPORT_C ~CLogEvent();
194 inline TLogId Id() const;
195 inline void SetId(TLogId aId);
197 inline TUid EventType() const;
198 inline void SetEventType(TUid aId);
200 inline const TDesC& RemoteParty() const;
201 inline void SetRemoteParty(const TDesC& aRemote);
203 inline const TDesC& Direction() const;
204 inline void SetDirection(const TDesC& aDirection);
206 inline const TTime& Time() const;
207 inline void SetTime(const TTime& aTime);
209 inline TLogDurationType DurationType() const;
210 inline void SetDurationType(TLogDurationType aDurationType);
212 inline TLogDuration Duration() const;
213 inline void SetDuration(TLogDuration aDuration);
215 inline const TDesC& Status() const;
216 inline void SetStatus(const TDesC& aStatus);
218 inline const TDesC& Subject() const;
219 inline void SetSubject(const TDesC& aSubject);
221 inline const TDesC& Number() const;
222 inline void SetNumber(const TDesC& aNumber);
224 inline TLogContactItemId Contact() const;
225 inline void SetContact(TLogContactItemId aContact);
227 inline TLogLink Link() const;
228 inline void SetLink(TLogLink aLink);
230 inline const TDesC& Description() const;
231 inline void SetDescription(const TDesC& aDescription);
233 inline TLogFlags Flags() const;
234 inline void SetFlags(TLogFlags aFlags);
235 inline void ClearFlags(TLogFlags aFlags);
237 inline const TDesC8& Data() const;
238 IMPORT_C void SetDataL(RReadStream& aStream, TInt aLen);
239 IMPORT_C void SetDataL(const TDesC8& aData);
241 IMPORT_C void CopyL(const CLogEvent& aEvent);
243 IMPORT_C void InternalizeL(RReadStream& aStream);
244 IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
250 void InternalizeBufL(RReadStream& aStream, HBufC*& aDes);
256 TLogDurationType iDurationType;
257 TLogDuration iDuration;
258 TLogContactItemId iContact;
270 //**********************************
272 //**********************************
274 class CLogBase : public CLogActive
276 Base class for the log engine implementation.
278 This class defines the interface that client code uses to perform simple actions
281 The class provides default implementations for the event handling functions.
282 The Log Engine, i.e. an instance of CLogClient, is derived from this class
283 and provides implementations for the event handling functions.
285 The class also deals with some aspects of resource file handling.
287 An instance of this class is constructed by the log wrapper, CLogWrapper,
288 if the phone does not implement logging.
290 An instance of this class is never constructed by clients.
299 IMPORT_C CLogBase(TInt aPriority);
300 IMPORT_C ~CLogBase();
302 IMPORT_C virtual void GetEvent(CLogEvent& aEvent, TRequestStatus& aStatus);
303 IMPORT_C virtual void AddEvent(CLogEvent& aEvent, TRequestStatus& aStatus);
304 IMPORT_C virtual void ChangeEvent(const CLogEvent& aEvent, TRequestStatus& aStatus);
305 IMPORT_C virtual void DeleteEvent(TLogId aId, TRequestStatus& aStatus);
307 IMPORT_C virtual TInt GetString(TDes& aString, TInt aId) const;
310 IMPORT_C void LoadResourcesL(RFs& aFs);
311 inline const CResourceFile* ResourceFile() const;
317 CResourceFile* iResourceFile;
321 IMPORT_C virtual void CLogBase_Reserved1();
322 TAny* CLogBase_Reserved;
325 //**********************************
327 //**********************************
329 class CLogWrapper : public CBase
333 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
337 The log wrapper is provided in its own DLL, the logwrap.dll.
339 If a Log Engine is not installed on a phone, the log wrapper creates an instance
340 of the CLogBase class, whose event handling requests complete with KErrNotSupported
341 and whose functions return KErrNotSupported.
343 If a Log Engine is installed on a phone, the log wrapper creates an instance
344 of the CLogClient class, provided in a separate DLL, the logcli.dll . The
345 CLogClient class derives from CLogBase and provides implementations for the
346 event handling requests and functions.
355 IMPORT_C static CLogWrapper* NewL(RFs& aFs, TInt aPriority = CActive::EPriorityStandard);
356 IMPORT_C ~CLogWrapper();
358 inline CLogBase& Log();
359 IMPORT_C TBool ClientAvailable() const;
363 void ConstructL(RFs& aFs, TInt aPriority);
369 #include <logwrap.inl>