1.1 --- a/epoc32/include/logcli.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/logcli.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,321 @@
1.4 -logcli.h
1.5 +// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// 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
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +//
1.19 +
1.20 +#ifndef __LOGCLI_H__
1.21 +#define __LOGCLI_H__
1.22 +
1.23 +// System includes
1.24 +#include <f32file.h>
1.25 +#include <d32dbms.h>
1.26 +#include <logwrap.h>
1.27 +//
1.28 +//#include <logserv.rsg>
1.29 +
1.30 +// Classes referenced
1.31 +class CLogClientObserver;
1.32 +class MLogClientChangeObserver;
1.33 +
1.34 +
1.35 +//**********************************
1.36 +// CLogEventType
1.37 +//**********************************
1.38 +
1.39 +class CLogEventType : public CBase
1.40 +/** Encapsulates the details of an event type.
1.41 +
1.42 +An event type is used to associate an event with a user-readable description
1.43 +and other configuration information related to the event.
1.44 +
1.45 +Event types are identified by UID.
1.46 +
1.47 +@see CLogEvent::EventType()
1.48 +@see CLogEvent::SetEventType()
1.49 +@publishedAll
1.50 +@released
1.51 +*/
1.52 + {
1.53 +public:
1.54 + IMPORT_C static CLogEventType* NewL();
1.55 + IMPORT_C ~CLogEventType();
1.56 + //
1.57 +public:
1.58 + inline TUid Uid() const;
1.59 + inline void SetUid(TUid aUid);
1.60 + //
1.61 + inline const TDesC& Description() const;
1.62 + inline void SetDescription(const TDesC& aDescription);
1.63 + //
1.64 + inline TBool LoggingEnabled() const;
1.65 + inline void SetLoggingEnabled(TBool aEnable);
1.66 + //
1.67 + IMPORT_C void Copy(const CLogEventType& aType);
1.68 +
1.69 + void InternalizeL(RReadStream& aStream);
1.70 + void ExternalizeL(RWriteStream& aStream) const;
1.71 + //
1.72 +private:
1.73 + CLogEventType();
1.74 + void ConstructL();
1.75 + void InternalizeBufL(RReadStream& aStream, HBufC*& aDes);
1.76 + //
1.77 +private:
1.78 + TUid iUid;
1.79 + HBufC* iDescription;
1.80 + TBool iLoggingEnabled;
1.81 + };
1.82 +
1.83 +//**********************************
1.84 +// TLogConfig
1.85 +//**********************************
1.86 +
1.87 +class TLogConfig
1.88 +/** Encapsulates Log Engine configuration data.
1.89 +
1.90 +@see CLogClient::GetConfig()
1.91 +@see CLogClient::ChangeConfig()
1.92 +@publishedAll
1.93 +@released
1.94 +*/
1.95 + {
1.96 +public:
1.97 + IMPORT_C TLogConfig();
1.98 + //
1.99 + void InternalizeL(RReadStream& aStream);
1.100 + void ExternalizeL(RWriteStream& aStream) const;
1.101 + //
1.102 +public:
1.103 + /** The maximum number of events that the event log holds.
1.104 +
1.105 + If the number of event log entries exceeds this value, the oldest event is
1.106 + deleted from the log. */
1.107 + TLogSize iMaxLogSize;
1.108 +
1.109 + /** The maximum number of events that a recent event list holds.
1.110 +
1.111 + If the number of recent event list entries exceeds this value, the oldest
1.112 + event is removed from the list. Note, however, that the event is not deleted
1.113 + from the event log. */
1.114 + TLogRecentSize iMaxRecentLogSize;
1.115 +
1.116 + /** The maximum age, in seconds, for which events can be retained in the event log.
1.117 +
1.118 + Events older than this are automatically deleted from the event log.
1.119 +
1.120 + Purging of events by age can be disabled by setting this value to 0. */
1.121 + TLogAge iMaxEventAge;
1.122 + };
1.123 +
1.124 +//**********************************
1.125 +// CLogFilter
1.126 +//**********************************
1.127 +
1.128 +class CLogFilter : public CBase
1.129 +/** Specifies the conditions that events must satisfy to appear in a view.
1.130 +
1.131 +In general, a filter is used to construct the WHERE clause of an SQL
1.132 +statement based on the content of the filter's fields. The filter's fields
1.133 +correspond to the event properties in a log event detail object, i.e. an instance
1.134 +of the CLogEvent class.
1.135 +
1.136 +Where a filter uses time to extract one or more events from the log, this must be
1.137 +specified as UTC rather than local time.
1.138 +
1.139 +@see CLogEvent
1.140 +@see CLogViewEvent
1.141 +@see CLogViewRecent
1.142 +@see CLogViewDuplicate
1.143 +@publishedAll
1.144 +@released
1.145 +*/
1.146 + {
1.147 +public:
1.148 + IMPORT_C static CLogFilter* NewL();
1.149 + IMPORT_C ~CLogFilter();
1.150 + //
1.151 +public:
1.152 + inline TUid EventType() const;
1.153 + inline void SetEventType(TUid aType);
1.154 + //
1.155 + inline const TDesC& RemoteParty() const;
1.156 + inline void SetRemoteParty(const TDesC& aRemote);
1.157 + //
1.158 + inline const TDesC& Direction() const;
1.159 + inline void SetDirection(const TDesC& aDirection);
1.160 + //
1.161 + inline TLogDurationType DurationType() const;
1.162 + inline void SetDurationType(TLogDurationType aType);
1.163 + //
1.164 + inline const TDesC& Status() const;
1.165 + inline void SetStatus(const TDesC& aStatus);
1.166 + //
1.167 + inline TLogContactItemId Contact() const;
1.168 + inline void SetContact(TLogContactItemId aContact);
1.169 + //
1.170 + inline const TDesC& Number() const;
1.171 + inline void SetNumber(const TDesC& aNumber);
1.172 + //
1.173 + inline TLogFlags Flags() const;
1.174 + inline void SetFlags(TLogFlags aFlags);
1.175 + inline void ClearFlags(TLogFlags aFlags);
1.176 + //
1.177 + inline TUint32 NullFields() const;
1.178 + inline void SetNullFields(TUint32 aFields);
1.179 + //
1.180 + inline const TTime& StartTime() const;
1.181 + inline void SetStartTime(const TTime& aStartTime);
1.182 + //
1.183 + inline const TTime& EndTime() const;
1.184 + inline void SetEndTime(const TTime& aEndTime);
1.185 + //
1.186 + IMPORT_C void Copy(const CLogFilter& aFilter);
1.187 + void InternalizeL(RReadStream& aStream);
1.188 + void ExternalizeL(RWriteStream& aStream) const;
1.189 + //
1.190 +private:
1.191 + CLogFilter();
1.192 + void ConstructL();
1.193 + void InternalizeBufL(RReadStream& aStream, HBufC*& aDes);
1.194 + //
1.195 +private:
1.196 + TUid iEventType;
1.197 + HBufC* iRemoteParty;
1.198 + HBufC* iDirection;
1.199 + TLogDurationType iDurationType;
1.200 + HBufC* iStatus;
1.201 + TLogContactItemId iContact;
1.202 + HBufC* iNumber;
1.203 + TLogFlags iFlags;
1.204 + TUint32 iNullFields;
1.205 + TTime iStartTime;
1.206 + TTime iEndTime;
1.207 + };
1.208 +
1.209 +class CLogFilterList : public CArrayPtrFlat<const CLogFilter>
1.210 +/** A set of event view filters.
1.211 +
1.212 +Specifically, this is an array of pointers to const CLogFilter objects and
1.213 +is derived from CArrayPtrFlat<const CLogFilter>.
1.214 +
1.215 +@see CLogFilter
1.216 +@see CLogViewEvent
1.217 +@see CLogViewRecent
1.218 +@publishedAll
1.219 +@released
1.220 +*/
1.221 + {
1.222 +public:
1.223 + IMPORT_C CLogFilterList();
1.224 + IMPORT_C CLogFilterList* CopyL() const;
1.225 + IMPORT_C CLogFilterList* CopyLC() const;
1.226 + void InternalizeL(RReadStream& aStream);
1.227 + void ExternalizeL(RWriteStream& aStream) const;
1.228 + };
1.229 +
1.230 +//**********************************
1.231 +// CLogClient
1.232 +//**********************************
1.233 +
1.234 +class CLogView;
1.235 +class RLogSession;
1.236 +class CLogPackage;
1.237 +class CLogAddEventClientOp;
1.238 +class CLogChangeEventClientOp;
1.239 +class CLogGetEventClientOp;
1.240 +class CLogDeleteEventClientOp;
1.241 +class CLogAddTypeClientOp;
1.242 +class CLogChangeTypeClientOp;
1.243 +class CLogGetTypeClientOp;
1.244 +class CLogDeleteTypeClientOp;
1.245 +class CLogGetConfigClientOp;
1.246 +class CLogChangeConfigClientOp;
1.247 +class CLogClearLogClientOp;
1.248 +class CLogClearRecentClientOp;
1.249 +
1.250 +class CLogClient : public CLogBase
1.251 +/** Log Engine implementation.
1.252 +
1.253 +It creates a shared session on the log database and allows log viewers to
1.254 +retrieve events from the log.
1.255 +
1.256 +The class also provides log administration functions.
1.257 +
1.258 +Wherever time values are used by this class, they must be specified as UTC rather
1.259 +than local time.
1.260 +
1.261 +@see CLogWrapper
1.262 +@publishedAll
1.263 +@released
1.264 +*/
1.265 + {
1.266 +public:
1.267 + IMPORT_C static CLogClient* NewL(RFs& aFs, TInt aPriority = CActive::EPriorityStandard);
1.268 + IMPORT_C ~CLogClient();
1.269 + //
1.270 +public:
1.271 + IMPORT_C void AddEvent(CLogEvent& aEvent, TRequestStatus& aStatus);
1.272 + IMPORT_C void GetEvent(CLogEvent& aEvent, TRequestStatus& aStatus);
1.273 + IMPORT_C void ChangeEvent(const CLogEvent& aEvent, TRequestStatus& aStatus);
1.274 + IMPORT_C void DeleteEvent(TLogId aId, TRequestStatus& aStatus);
1.275 +
1.276 + IMPORT_C void AddEventType(const CLogEventType& aType, TRequestStatus& aStatus);
1.277 + IMPORT_C void GetEventType(CLogEventType& aType, TRequestStatus& aStatus);
1.278 + IMPORT_C void ChangeEventType(const CLogEventType& aType, TRequestStatus& aStatus);
1.279 + IMPORT_C void DeleteEventType(TUid aId, TRequestStatus& aStatus);
1.280 + IMPORT_C void GetConfig(TLogConfig& aConfig, TRequestStatus& aStatus);
1.281 + IMPORT_C void ChangeConfig(const TLogConfig& aConfig, TRequestStatus& aStatus);
1.282 + IMPORT_C void ClearLog(const TTime& aDate, TRequestStatus& aStatus);
1.283 + IMPORT_C void ClearLog(TInt aRecentList, TRequestStatus& aStatus);
1.284 + //
1.285 + IMPORT_C void NotifyChange(TTimeIntervalMicroSeconds32 aDelay, TRequestStatus& aStatus);
1.286 + IMPORT_C void NotifyChangeCancel();
1.287 + //
1.288 + IMPORT_C void SetGlobalChangeObserverL(MLogClientChangeObserver* aObserver);
1.289 + //
1.290 + IMPORT_C TInt GetString(TDes& aString, TInt aId) const;
1.291 + RLogSession& Session() const;
1.292 + //
1.293 +private:
1.294 + CLogClient(RFs& aFs, TInt aPriority);
1.295 + void ConstructL();
1.296 + void DoGetStringL(TDes& aString, TInt aId) const;
1.297 + //
1.298 + void DoRunL();
1.299 + void DoCancel();
1.300 + //
1.301 +private:
1.302 + RLogSession* iSession;
1.303 + CLogPackage* iPackage;
1.304 + CLogAddEventClientOp* iAddEvent;
1.305 + CLogChangeEventClientOp* iChangeEvent;
1.306 + CLogGetEventClientOp* iGetEvent;
1.307 + CLogDeleteEventClientOp* iDeleteEvent;
1.308 + CLogAddTypeClientOp* iAddType;
1.309 + CLogChangeTypeClientOp* iChangeType;
1.310 + CLogGetTypeClientOp* iGetType;
1.311 + CLogDeleteTypeClientOp* iDeleteType;
1.312 + CLogGetConfigClientOp* iGetConfig;
1.313 + CLogChangeConfigClientOp* iChangeConfig;
1.314 + CLogClearLogClientOp* iClearLog;
1.315 + CLogClearRecentClientOp* iClearRecent;
1.316 + RFs& iFs;
1.317 + CLogClientObserver* iChangeObserver;
1.318 + //
1.319 +private:
1.320 + IMPORT_C void CLogBase_Reserved1();
1.321 + };
1.322 +
1.323 +#include <logcli.inl>
1.324 +
1.325 +#endif