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 __LOGVIEWWINDOW_H__ sl@0: #define __LOGVIEWWINDOW_H__ sl@0: sl@0: // System includes sl@0: #include sl@0: sl@0: // User includes sl@0: #include sl@0: #include "LogServShared.h" sl@0: #include "LogViewWindowFetcher.h" sl@0: #include "LogViewWindowLockObserver.h" sl@0: #include "LogViewChangeObserverInternal.h" sl@0: sl@0: // Classes referenced sl@0: class CLogClient; sl@0: class CLogPackage; sl@0: class CLogChangeDefinition; sl@0: class CLogFilterList; sl@0: class MLogViewChangeObserver; sl@0: class CLogViewSetupClientOp; sl@0: class CLogViewWindowFetcher; sl@0: class CLogViewWindowLockObserver; sl@0: class CLogViewWindowChangeObserver; sl@0: sl@0: sl@0: ///////////////////////////////////////////////////////////////////////////////////////// sl@0: // -----> CLogViewWindow (header) sl@0: ///////////////////////////////////////////////////////////////////////////////////////// sl@0: NONSHARABLE_CLASS(CLogViewWindow) : public CLogActive, public MLogViewChangeObserverInternal, public MLogViewWindowFetcherObserver, public MLogViewWindowLockObserver sl@0: /** sl@0: @internalComponent sl@0: */ sl@0: { sl@0: public: sl@0: CLogViewWindow(RLogSession& aSession, TLogViewId aViewId, TInt aWindowSize, MLogViewChangeObserver* aCascadeObserver, TInt aPriority); sl@0: ~CLogViewWindow(); sl@0: void ConstructL(CLogPackage& aPackage); sl@0: sl@0: public: sl@0: sl@0: /** sl@0: * Prepare the view sl@0: */ sl@0: TInt Setup(const CLogFilterList& aFilterList, TInt aParam, TLogFilterConstructionType aFilterConstructionType); sl@0: sl@0: /** sl@0: * Move the view position sl@0: */ sl@0: TBool NavigateL(TLogNavigation aNavigate, TRequestStatus& aStatus); sl@0: sl@0: /** sl@0: * Remove the specified log event from the window if its present sl@0: */ sl@0: void RemoveFromWindowIfPresentL(TLogId aId); sl@0: sl@0: /** sl@0: * Access the change observer (needed to construct the view) sl@0: */ sl@0: MLogViewChangeObserverInternal& ChangeObserver(); sl@0: sl@0: /** sl@0: * Access the event at the current position sl@0: */ sl@0: const CLogEvent& CurrsorEvent() const; sl@0: sl@0: /** gets iViewRecordCount */ sl@0: inline TInt ViewRecordCount() const; sl@0: sl@0: private: // FROM MLogViewWindowLockObserver sl@0: void HandleWindowLockStatusChangeL(TLogViewLockStatus aStatus); sl@0: sl@0: private: // FROM MLogViewWindowFetcherObserver sl@0: void HandleFetchedWindowItemL(TInt aItemIndex, CLogEvent* aEvent); sl@0: sl@0: public: // FROM MLogViewChangeObserver sl@0: void HandleLogViewChangeEventAddedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount); sl@0: void HandleLogViewChangeEventChangedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount); sl@0: void HandleLogViewChangeEventDeletedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount); sl@0: sl@0: private: // FROM MLogViewChangeObserverInternal sl@0: void HandleLogViewChangeEventLogClearedL(); sl@0: sl@0: private: // FROM CLogActive sl@0: void DoRunL(); sl@0: void DoCancel(); sl@0: void DoComplete(TInt& aComplete); sl@0: sl@0: private: sl@0: enum TWindowState sl@0: { sl@0: EStateIdle = 0, sl@0: EStateFetchingWindow, sl@0: EStateProcessingWindow, sl@0: EStateNavigateWithinWindow, sl@0: EStateLocked sl@0: }; sl@0: sl@0: private: sl@0: void StateHandleWindowFetchStarting(); sl@0: void StateHandleWindowFetchedL(); sl@0: void StateHandleNavigation(); sl@0: sl@0: private: sl@0: void CompleteRequest(TInt aCompletionCode = KErrNone); sl@0: void CalculateWindowForCursorPosition(TInt aCursorPosition, TLogWindow& aWindow) const; sl@0: void Reset(); sl@0: void SilentCancel(); sl@0: void RefetchL(const TLogWindow& aWindow, TInt aCursor); sl@0: void ChangeState(TWindowState aNewState); sl@0: void RemoveEvent(TInt aIndex); sl@0: TInt CalculateCursorPosition(TLogNavigation aNavigate) const; sl@0: TInt FindEvent(TLogId aId); sl@0: TInt FindAndRemoveEvent(TLogId aId); sl@0: sl@0: private: sl@0: RLogSession& iSession; sl@0: const TLogViewId iViewId; sl@0: const TInt iWindowSize; sl@0: MLogViewChangeObserver* iCascadeObserver; sl@0: RPointerArray iEvents; sl@0: sl@0: TWindowState iState; sl@0: TLogWindowAndCursor iWindow; sl@0: TInt iViewRecordCount; sl@0: sl@0: CLogViewSetupClientOp* iWindowPreparer; sl@0: CLogViewWindowFetcher* iWindowFetcher; sl@0: CLogViewWindowLockObserver* iWindowLockObserver; sl@0: CLogViewWindowChangeObserver* iWindowChangeObserver; sl@0: }; sl@0: sl@0: sl@0: inline sl@0: TInt CLogViewWindow::ViewRecordCount() const sl@0: { sl@0: return iViewRecordCount; sl@0: } sl@0: sl@0: #endif