sl@0: // Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #ifndef __LOGCLI_H__ sl@0: #define __LOGCLI_H__ sl@0: sl@0: // System includes sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: // Classes referenced sl@0: class CLogClientObserver; sl@0: class MLogClientChangeObserver; sl@0: sl@0: sl@0: //********************************** sl@0: // CLogEventType sl@0: //********************************** sl@0: sl@0: /** Encapsulates the details of an event type. sl@0: sl@0: An event type is used to associate an event with a user-readable description sl@0: and other configuration information related to the event. sl@0: sl@0: Event types are identified by UID. sl@0: sl@0: @see CLogEvent::EventType() sl@0: @see CLogEvent::SetEventType() sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: class CLogEventType : public CBase sl@0: { sl@0: public: sl@0: IMPORT_C static CLogEventType* NewL(); sl@0: IMPORT_C ~CLogEventType(); sl@0: // sl@0: public: sl@0: inline TUid Uid() const; sl@0: inline void SetUid(TUid aUid); sl@0: // sl@0: inline const TDesC& Description() const; sl@0: inline void SetDescription(const TDesC& aDescription); sl@0: // sl@0: inline TBool LoggingEnabled() const; sl@0: inline void SetLoggingEnabled(TBool aEnable); sl@0: // sl@0: IMPORT_C void Copy(const CLogEventType& aType); sl@0: sl@0: void InternalizeL(RReadStream& aStream); sl@0: void ExternalizeL(RWriteStream& aStream) const; sl@0: // sl@0: private: sl@0: CLogEventType(); sl@0: void ConstructL(); sl@0: void InternalizeBufL(RReadStream& aStream, HBufC*& aDes); sl@0: // sl@0: private: sl@0: TUid iUid; sl@0: HBufC* iDescription; sl@0: TBool iLoggingEnabled; sl@0: }; sl@0: sl@0: //********************************** sl@0: // TLogConfig sl@0: //********************************** sl@0: sl@0: /** Encapsulates Log Engine configuration data. sl@0: sl@0: @see CLogClient::GetConfig() sl@0: @see CLogClient::ChangeConfig() sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: class TLogConfig sl@0: { sl@0: public: sl@0: IMPORT_C TLogConfig(); sl@0: // sl@0: void InternalizeL(RReadStream& aStream); sl@0: void ExternalizeL(RWriteStream& aStream) const; sl@0: // sl@0: public: sl@0: /** The maximum number of events that the event log holds. sl@0: sl@0: If the number of event log entries exceeds this value, the oldest event is sl@0: deleted from the log. */ sl@0: TLogSize iMaxLogSize; sl@0: sl@0: /** The maximum number of events that a recent event list holds. sl@0: sl@0: If the number of recent event list entries exceeds this value, the oldest sl@0: event is removed from the list. Note, however, that the event is not deleted sl@0: from the event log. */ sl@0: TLogRecentSize iMaxRecentLogSize; sl@0: sl@0: /** The maximum age, in seconds, for which events can be retained in the event log. sl@0: sl@0: Events older than this are automatically deleted from the event log. sl@0: sl@0: Purging of events by age can be disabled by setting this value to 0. */ sl@0: TLogAge iMaxEventAge; sl@0: }; sl@0: sl@0: //********************************** sl@0: // CLogFilter sl@0: //********************************** sl@0: sl@0: /** Specifies the conditions that events must satisfy to appear in a view. sl@0: sl@0: In general, a filter is used to construct the WHERE clause of an SQL sl@0: statement based on the content of the filter's fields. The filter's fields sl@0: correspond to the event properties in a log event detail object, i.e. an instance sl@0: of the CLogEvent class. sl@0: sl@0: Where a filter uses time to extract one or more events from the log, this must be sl@0: specified as UTC rather than local time. sl@0: sl@0: @see CLogEvent sl@0: @see CLogViewEvent sl@0: @see CLogViewRecent sl@0: @see CLogViewDuplicate sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: class CLogFilter : public CBase sl@0: { sl@0: public: sl@0: IMPORT_C static CLogFilter* NewL(); sl@0: IMPORT_C ~CLogFilter(); sl@0: // sl@0: public: sl@0: inline TUid EventType() const; sl@0: inline void SetEventType(TUid aType); sl@0: // sl@0: inline const TDesC& RemoteParty() const; sl@0: inline void SetRemoteParty(const TDesC& aRemote); sl@0: // sl@0: inline const TDesC& Direction() const; sl@0: inline void SetDirection(const TDesC& aDirection); sl@0: // sl@0: inline TLogDurationType DurationType() const; sl@0: inline void SetDurationType(TLogDurationType aType); sl@0: // sl@0: inline const TDesC& Status() const; sl@0: inline void SetStatus(const TDesC& aStatus); sl@0: // sl@0: inline TLogContactItemId Contact() const; sl@0: inline void SetContact(TLogContactItemId aContact); sl@0: // sl@0: inline const TDesC& Number() const; sl@0: inline void SetNumber(const TDesC& aNumber); sl@0: // sl@0: inline TLogFlags Flags() const; sl@0: inline void SetFlags(TLogFlags aFlags); sl@0: inline void ClearFlags(TLogFlags aFlags); sl@0: // sl@0: inline TUint32 NullFields() const; sl@0: inline void SetNullFields(TUint32 aFields); sl@0: // sl@0: inline const TTime& StartTime() const; sl@0: inline void SetStartTime(const TTime& aStartTime); sl@0: // sl@0: inline const TTime& EndTime() const; sl@0: inline void SetEndTime(const TTime& aEndTime); sl@0: // sl@0: IMPORT_C void Copy(const CLogFilter& aFilter); sl@0: void InternalizeL(RReadStream& aStream); sl@0: void ExternalizeL(RWriteStream& aStream) const; sl@0: // sl@0: IMPORT_C void SetSimId(TSimId aSimId); sl@0: IMPORT_C TSimId SimId() const; sl@0: // sl@0: private: sl@0: CLogFilter(); sl@0: void ConstructL(); sl@0: void InternalizeBufL(RReadStream& aStream, HBufC*& aDes); sl@0: // sl@0: private: sl@0: TUid iEventType; sl@0: HBufC* iRemoteParty; sl@0: HBufC* iDirection; sl@0: TLogDurationType iDurationType; sl@0: HBufC* iStatus; sl@0: TLogContactItemId iContact; sl@0: HBufC* iNumber; sl@0: TLogFlags iFlags; sl@0: TUint32 iNullFields; sl@0: TTime iStartTime; sl@0: TTime iEndTime; sl@0: #ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM sl@0: TSimId iSimId; sl@0: #endif sl@0: }; sl@0: sl@0: /** A set of event view filters. sl@0: sl@0: Specifically, this is an array of pointers to const CLogFilter objects and sl@0: is derived from CArrayPtrFlat. sl@0: sl@0: @see CLogFilter sl@0: @see CLogViewEvent sl@0: @see CLogViewRecent sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: class CLogFilterList : public CArrayPtrFlat sl@0: { sl@0: public: sl@0: IMPORT_C CLogFilterList(); sl@0: IMPORT_C CLogFilterList* CopyL() const; sl@0: IMPORT_C CLogFilterList* CopyLC() const; sl@0: void InternalizeL(RReadStream& aStream); sl@0: void ExternalizeL(RWriteStream& aStream) const; sl@0: }; sl@0: sl@0: //********************************** sl@0: // CLogClient sl@0: //********************************** sl@0: sl@0: class CLogView; sl@0: class RLogSession; sl@0: class CLogPackage; sl@0: class CLogAddEventClientOp; sl@0: class CLogChangeEventClientOp; sl@0: class CLogGetEventClientOp; sl@0: class CLogDeleteEventClientOp; sl@0: class CLogAddTypeClientOp; sl@0: class CLogChangeTypeClientOp; sl@0: class CLogGetTypeClientOp; sl@0: class CLogDeleteTypeClientOp; sl@0: class CLogGetConfigClientOp; sl@0: class CLogChangeConfigClientOp; sl@0: class CLogClearLogClientOp; sl@0: class CLogClearRecentClientOp; sl@0: sl@0: /** Log Engine implementation. sl@0: sl@0: It creates a shared session on the log database and allows log viewers to sl@0: retrieve events from the log. sl@0: sl@0: The class also provides log administration functions. sl@0: sl@0: Wherever time values are used by this class, they must be specified as UTC rather sl@0: than local time. sl@0: sl@0: @see CLogWrapper sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: class CLogClient : public CLogBase sl@0: { sl@0: public: sl@0: IMPORT_C static CLogClient* NewL(RFs& aFs, TInt aPriority = CActive::EPriorityStandard); sl@0: IMPORT_C ~CLogClient(); sl@0: // sl@0: public: sl@0: IMPORT_C void AddEvent(CLogEvent& aEvent, TRequestStatus& aStatus); sl@0: IMPORT_C void GetEvent(CLogEvent& aEvent, TRequestStatus& aStatus); sl@0: IMPORT_C void ChangeEvent(const CLogEvent& aEvent, TRequestStatus& aStatus); sl@0: IMPORT_C void DeleteEvent(TLogId aId, TRequestStatus& aStatus); sl@0: sl@0: IMPORT_C void AddEventType(const CLogEventType& aType, TRequestStatus& aStatus); sl@0: IMPORT_C void GetEventType(CLogEventType& aType, TRequestStatus& aStatus); sl@0: IMPORT_C void ChangeEventType(const CLogEventType& aType, TRequestStatus& aStatus); sl@0: IMPORT_C void DeleteEventType(TUid aId, TRequestStatus& aStatus); sl@0: IMPORT_C void GetConfig(TLogConfig& aConfig, TRequestStatus& aStatus); sl@0: IMPORT_C void ChangeConfig(const TLogConfig& aConfig, TRequestStatus& aStatus); sl@0: IMPORT_C void ClearLog(const TTime& aDate, TRequestStatus& aStatus); sl@0: IMPORT_C void ClearLog(TInt aRecentList, TRequestStatus& aStatus); sl@0: IMPORT_C void ClearLog(const TTime& aDate, TSimId aSimid, TRequestStatus& aStatus); sl@0: IMPORT_C void ClearLog(TInt aRecentList, TSimId aSimid, TRequestStatus& aStatus); sl@0: // sl@0: IMPORT_C void NotifyChange(TTimeIntervalMicroSeconds32 aDelay, TRequestStatus& aStatus); sl@0: IMPORT_C void NotifyChangeCancel(); sl@0: // sl@0: IMPORT_C void SetGlobalChangeObserverL(MLogClientChangeObserver* aObserver); sl@0: // sl@0: IMPORT_C TInt GetString(TDes& aString, TInt aId) const; sl@0: RLogSession& Session() const; sl@0: // sl@0: private: sl@0: CLogClient(RFs& aFs, TInt aPriority); sl@0: void ConstructL(); sl@0: void DoGetStringL(TDes& aString, TInt aId) const; sl@0: // sl@0: void DoRunL(); sl@0: void DoCancel(); sl@0: // sl@0: private: sl@0: RLogSession* iSession; sl@0: CLogPackage* iPackage; sl@0: CLogAddEventClientOp* iAddEvent; sl@0: CLogChangeEventClientOp* iChangeEvent; sl@0: CLogGetEventClientOp* iGetEvent; sl@0: CLogDeleteEventClientOp* iDeleteEvent; sl@0: CLogAddTypeClientOp* iAddType; sl@0: CLogChangeTypeClientOp* iChangeType; sl@0: CLogGetTypeClientOp* iGetType; sl@0: CLogDeleteTypeClientOp* iDeleteType; sl@0: CLogGetConfigClientOp* iGetConfig; sl@0: CLogChangeConfigClientOp* iChangeConfig; sl@0: CLogClearLogClientOp* iClearLog; sl@0: CLogClearRecentClientOp* iClearRecent; sl@0: RFs& iFs; sl@0: CLogClientObserver* iChangeObserver; sl@0: // sl@0: private: sl@0: IMPORT_C void CLogBase_Reserved1(); sl@0: }; sl@0: sl@0: #include sl@0: sl@0: #endif