sl@0: // Copyright (c) 2002-2009 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 __LOGVIEW_H__ sl@0: #define __LOGVIEW_H__ sl@0: sl@0: // System includes sl@0: #include sl@0: #include sl@0: sl@0: // User includes sl@0: #include sl@0: sl@0: // Classes referenced sl@0: class CLogClient; sl@0: class CLogGetEventClientOp; sl@0: class CLogPackage; sl@0: class CLogViewSetupClientOp; sl@0: class CLogMaintainClientOp; sl@0: class CLogViewObserver; sl@0: class CLogFilterList; sl@0: class CLogFilter; sl@0: class CLogViewDuplicate; sl@0: class CLogViewRemoveEventClientOp; sl@0: class MLogViewChangeObserver; sl@0: class CLogViewWindow; sl@0: sl@0: sl@0: //********************************** sl@0: // CLogView sl@0: //********************************** sl@0: sl@0: class CLogView : public CLogActive sl@0: /** sl@0: Navigates a view on the log database. sl@0: sl@0: The class provides functions for navigating through a set of events and a sl@0: function to retrieve the event at the current position within the view. sl@0: sl@0: The class cannot be instantiated. Further classes are derived from this class sl@0: to define and construct views on the log database. sl@0: sl@0: The set of events in a view are always ordered so that the first event in sl@0: a view is the most recent. sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: { sl@0: public: sl@0: IMPORT_C ~CLogView(); sl@0: // sl@0: public: sl@0: inline const CLogEvent& Event() const; sl@0: // sl@0: IMPORT_C TBool FirstL(TRequestStatus& aStatus); sl@0: IMPORT_C TBool LastL(TRequestStatus& aStatus); sl@0: IMPORT_C TBool NextL(TRequestStatus& aStatus); sl@0: IMPORT_C TBool PreviousL(TRequestStatus& aStatus); sl@0: // sl@0: IMPORT_C TInt CountL(); sl@0: // sl@0: IMPORT_C void SetFlagsL(TLogFlags aFlags); sl@0: // sl@0: protected: sl@0: CLogView(CLogClient& aClient, TInt aPriority = CActive::EPriorityStandard); sl@0: void ConstructL(TInt aType, MLogViewChangeObserver* aObserver = NULL); sl@0: // sl@0: inline TBool IsValid() const; sl@0: void DoCancel(); sl@0: void ReadEventFromWindowL(); sl@0: void ReawaitForChanges(); sl@0: TInt LogViewRecordCount() const; sl@0: // sl@0: private: sl@0: TBool NavigateL(TInt aPosition, TRequestStatus& aStatus); sl@0: void DoRunL(); sl@0: void PrepareViewChildrenL(); sl@0: void NotifyLogServerTerminatedL(); sl@0: sl@0: // sl@0: private: sl@0: CLogEvent* iEvent; sl@0: TAny* iSpare1; sl@0: // sl@0: protected: sl@0: CLogClient& iClient; sl@0: CLogPackage* iPackage; sl@0: TAny* iSpare2; sl@0: CLogMaintainClientOp* iMaintain; sl@0: TLogViewId iViewId; sl@0: TDes8* iData; sl@0: TBool iValid; sl@0: CLogViewWindow* iWindow; sl@0: // sl@0: private: sl@0: TInt iType; sl@0: MLogViewChangeObserver* iLogViewChangeObserver; sl@0: CLogViewObserver* iLogViewObserver; sl@0: friend class CLogViewObserver; sl@0: }; sl@0: sl@0: //********************************** sl@0: // CLogViewEvent sl@0: //********************************** sl@0: sl@0: sl@0: class CLogViewEvent : public CLogView sl@0: /** sl@0: A view on the event log. sl@0: sl@0: The events included in the view are defined using a filter that specifies sl@0: the constraints that all events in the view must satisfy. Filters are specified sl@0: using one or more CLogFilter objects. sl@0: sl@0: @see CLogFilter sl@0: @see CLogFilterList sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: { sl@0: public: sl@0: IMPORT_C static CLogViewEvent* NewL(CLogClient& aClient, TInt aPriority = CActive::EPriorityStandard); sl@0: IMPORT_C static CLogViewEvent* NewL(CLogClient& aClient, MLogViewChangeObserver& aObserver, TInt aPriority = CActive::EPriorityStandard); sl@0: IMPORT_C ~CLogViewEvent(); sl@0: // sl@0: public: sl@0: IMPORT_C TBool SetFilterL(const CLogFilterList& aFilterList, TRequestStatus& aStatus); sl@0: IMPORT_C TBool SetFilterL(const CLogFilter& aFilter, TRequestStatus& aStatus); sl@0: IMPORT_C TBool SetFilterParseFilterByFilterL(const CLogFilterList& aFilterList, TRequestStatus& aStatus); sl@0: // sl@0: private: sl@0: CLogViewEvent(CLogClient& aClient, TInt aPriority); sl@0: void ConstructL(MLogViewChangeObserver* aObserver = NULL); sl@0: }; sl@0: sl@0: //********************************** sl@0: // CLogViewRecent sl@0: //********************************** sl@0: sl@0: sl@0: class CLogViewRecent : public CLogView sl@0: /** sl@0: A view on a recent event list. sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: { sl@0: public: sl@0: IMPORT_C static CLogViewRecent* NewL(CLogClient& aClient, TInt aPriority = CActive::EPriorityStandard); sl@0: IMPORT_C static CLogViewRecent* NewL(CLogClient& aClient, MLogViewChangeObserver& aObserver, TInt aPriority = CActive::EPriorityStandard); sl@0: IMPORT_C ~CLogViewRecent(); sl@0: // sl@0: public: sl@0: IMPORT_C TBool SetRecentListL(TLogRecentList aList, TRequestStatus& aStatus); sl@0: IMPORT_C TBool SetRecentListL(TLogRecentList aList, const CLogFilter& aFilter, TRequestStatus& aStatus); sl@0: IMPORT_C TBool SetRecentListL(TLogRecentList aList, const CLogFilterList& aFilterList, TRequestStatus& aStatus); sl@0: // sl@0: IMPORT_C TBool DuplicatesL(CLogViewDuplicate& aView, TRequestStatus& aStatus); sl@0: IMPORT_C TBool DuplicatesL(CLogViewDuplicate& aView, const CLogFilter& aFilter, TRequestStatus& aStatus); sl@0: IMPORT_C TBool DuplicatesL(CLogViewDuplicate& aView, const CLogFilterList& aFilterList, TRequestStatus& aStatus); sl@0: IMPORT_C void ClearDuplicatesL(); sl@0: // sl@0: IMPORT_C void RemoveL(TLogId aId); sl@0: IMPORT_C TBool RemoveL(TRequestStatus& aStatus); sl@0: // sl@0: inline TLogRecentList RecentList() const; sl@0: // sl@0: private: sl@0: CLogViewRecent(CLogClient& aClient, TInt aPriority); sl@0: void ConstructL(MLogViewChangeObserver* aObserver = NULL); sl@0: void DoRunL(); sl@0: // sl@0: TBool DoRemoveL(TRequestStatus& aStatus); sl@0: // sl@0: private: sl@0: TLogRecentList iRecentList; sl@0: TLogRecentList iCurrentList; sl@0: TPckgBuf iCurrentListBuf; sl@0: CLogViewRemoveEventClientOp* iRemove; sl@0: }; sl@0: sl@0: //********************************** sl@0: // CLogViewDuplicate sl@0: //********************************** sl@0: sl@0: class CLogViewDuplicate : public CLogView sl@0: /** sl@0: A view of events that are duplicates of an event in a view of recent events. sl@0: sl@0: The view is populated through a call to CLogViewRecent::DuplicatesL(). sl@0: sl@0: @see CLogViewRecent::DuplicatesL() sl@0: @see CLogViewRecent sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: { sl@0: public: sl@0: IMPORT_C static CLogViewDuplicate* NewL(CLogClient& aClient, TInt aPriority = CActive::EPriorityStandard); sl@0: IMPORT_C static CLogViewDuplicate* NewL(CLogClient& aClient, MLogViewChangeObserver& aObserver, TInt aPriority = CActive::EPriorityStandard); sl@0: IMPORT_C ~CLogViewDuplicate(); sl@0: // sl@0: IMPORT_C void RemoveL(TLogId aId); sl@0: IMPORT_C TBool RemoveL(TRequestStatus& aStatus); sl@0: // sl@0: inline TLogId Source() const; sl@0: // sl@0: public: sl@0: // The following are not exported, use CLogViewRecent::DuplicatesL to initialise this view sl@0: TBool SetEventL(TLogId aId, TRequestStatus& aStatus); sl@0: TBool SetEventL(TLogId aId, const CLogFilter& aFilter, TRequestStatus& aStatus); sl@0: TBool SetEventL(TLogId aId, const CLogFilterList& aFilterList, TRequestStatus& aStatus); sl@0: // sl@0: private: sl@0: CLogViewDuplicate(CLogClient& aClient, TInt aPriority); sl@0: void ConstructL(MLogViewChangeObserver* aObserver = NULL); sl@0: // sl@0: TBool DoRemoveL(TRequestStatus& aStatus); sl@0: // sl@0: private: sl@0: TLogId iSourceId; sl@0: CLogViewRemoveEventClientOp* iRemove; sl@0: }; sl@0: sl@0: #include sl@0: sl@0: #endif