os/persistentdata/loggingservices/eventlogger/LogCli/inc/LogViewWindow.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/loggingservices/eventlogger/LogCli/inc/LogViewWindow.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,154 @@
     1.4 +// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifndef __LOGVIEWWINDOW_H__
    1.20 +#define __LOGVIEWWINDOW_H__
    1.21 +
    1.22 +// System includes
    1.23 +#include <e32base.h>
    1.24 +
    1.25 +// User includes
    1.26 +#include <logwrap.h>
    1.27 +#include "LogServShared.h"
    1.28 +#include "LogViewWindowFetcher.h"
    1.29 +#include "LogViewWindowLockObserver.h"
    1.30 +#include "LogViewChangeObserverInternal.h"
    1.31 +
    1.32 +// Classes referenced
    1.33 +class CLogClient;
    1.34 +class CLogPackage;
    1.35 +class CLogChangeDefinition;
    1.36 +class CLogFilterList;
    1.37 +class MLogViewChangeObserver;
    1.38 +class CLogViewSetupClientOp;
    1.39 +class CLogViewWindowFetcher;
    1.40 +class CLogViewWindowLockObserver;
    1.41 +class CLogViewWindowChangeObserver;
    1.42 +
    1.43 +
    1.44 +/////////////////////////////////////////////////////////////////////////////////////////
    1.45 +// -----> CLogViewWindow (header)
    1.46 +/////////////////////////////////////////////////////////////////////////////////////////
    1.47 +NONSHARABLE_CLASS(CLogViewWindow) : public CLogActive, public MLogViewChangeObserverInternal, public MLogViewWindowFetcherObserver, public MLogViewWindowLockObserver
    1.48 +/**
    1.49 +@internalComponent
    1.50 +*/
    1.51 +	{
    1.52 +public:
    1.53 +	CLogViewWindow(RLogSession& aSession, TLogViewId aViewId, TInt aWindowSize, MLogViewChangeObserver* aCascadeObserver, TInt aPriority);
    1.54 +	~CLogViewWindow();
    1.55 +	void ConstructL(CLogPackage& aPackage);
    1.56 +
    1.57 +public:
    1.58 +
    1.59 +	/**
    1.60 +	 * Prepare the view
    1.61 +	 */
    1.62 +	TInt Setup(const CLogFilterList& aFilterList, TInt aParam, TLogFilterConstructionType aFilterConstructionType);
    1.63 +
    1.64 +	/**
    1.65 +	 * Move the view position
    1.66 +	 */
    1.67 +	TBool NavigateL(TLogNavigation aNavigate, TRequestStatus& aStatus);
    1.68 +
    1.69 +	/**
    1.70 +	 * Remove the specified log event from the window if its present
    1.71 +	 */
    1.72 +	void RemoveFromWindowIfPresentL(TLogId aId);
    1.73 +
    1.74 +	/**
    1.75 +	 * Access the change observer (needed to construct the view)
    1.76 +	 */
    1.77 +	MLogViewChangeObserverInternal& ChangeObserver();
    1.78 +
    1.79 +	/**
    1.80 +	 * Access the event at the current position
    1.81 +	 */
    1.82 +	const CLogEvent& CurrsorEvent() const;
    1.83 +
    1.84 +	/** gets iViewRecordCount */
    1.85 +	inline TInt ViewRecordCount() const;
    1.86 +
    1.87 +private: // FROM MLogViewWindowLockObserver
    1.88 +	void HandleWindowLockStatusChangeL(TLogViewLockStatus aStatus);
    1.89 +
    1.90 +private: // FROM MLogViewWindowFetcherObserver
    1.91 +	void HandleFetchedWindowItemL(TInt aItemIndex, CLogEvent* aEvent);
    1.92 +
    1.93 +public: // FROM MLogViewChangeObserver
    1.94 +	void HandleLogViewChangeEventAddedL(TLogId aId,   TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount);
    1.95 +	void HandleLogViewChangeEventChangedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount);
    1.96 +	void HandleLogViewChangeEventDeletedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount);
    1.97 +
    1.98 +private: // FROM MLogViewChangeObserverInternal
    1.99 +	void HandleLogViewChangeEventLogClearedL();
   1.100 +
   1.101 +private: // FROM CLogActive
   1.102 +	void DoRunL();
   1.103 +	void DoCancel();
   1.104 +	void DoComplete(TInt& aComplete);
   1.105 +
   1.106 +private:
   1.107 +	enum TWindowState
   1.108 +		{
   1.109 +		EStateIdle = 0,
   1.110 +		EStateFetchingWindow,
   1.111 +		EStateProcessingWindow,
   1.112 +		EStateNavigateWithinWindow,
   1.113 +		EStateLocked
   1.114 +		};
   1.115 +
   1.116 +private:
   1.117 +	void StateHandleWindowFetchStarting();
   1.118 +	void StateHandleWindowFetchedL();
   1.119 +	void StateHandleNavigation();
   1.120 +
   1.121 +private:
   1.122 +	void CompleteRequest(TInt aCompletionCode = KErrNone);
   1.123 +	void CalculateWindowForCursorPosition(TInt aCursorPosition, TLogWindow& aWindow) const;
   1.124 +	void Reset();
   1.125 +	void SilentCancel();
   1.126 +	void RefetchL(const TLogWindow& aWindow, TInt aCursor);
   1.127 +	void ChangeState(TWindowState aNewState);
   1.128 +	void RemoveEvent(TInt aIndex);
   1.129 +	TInt CalculateCursorPosition(TLogNavigation aNavigate) const;
   1.130 +	TInt FindEvent(TLogId aId);
   1.131 +	TInt FindAndRemoveEvent(TLogId aId);
   1.132 +
   1.133 +private:
   1.134 +	RLogSession& iSession;
   1.135 +	const TLogViewId iViewId;
   1.136 +	const TInt iWindowSize;
   1.137 +	MLogViewChangeObserver* iCascadeObserver;
   1.138 +	RPointerArray<CLogEvent> iEvents;
   1.139 +
   1.140 +	TWindowState iState;
   1.141 +	TLogWindowAndCursor iWindow;
   1.142 +	TInt iViewRecordCount;
   1.143 +
   1.144 +	CLogViewSetupClientOp* iWindowPreparer;
   1.145 +	CLogViewWindowFetcher* iWindowFetcher;
   1.146 +	CLogViewWindowLockObserver* iWindowLockObserver;
   1.147 +	CLogViewWindowChangeObserver* iWindowChangeObserver;
   1.148 +	};
   1.149 +
   1.150 +
   1.151 +inline 
   1.152 +TInt CLogViewWindow::ViewRecordCount() const
   1.153 +	{
   1.154 +	return iViewRecordCount;
   1.155 +	}
   1.156 +
   1.157 +#endif