Update contrib.
1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __LOGVIEWWINDOW_H__
17 #define __LOGVIEWWINDOW_H__
24 #include "LogServShared.h"
25 #include "LogViewWindowFetcher.h"
26 #include "LogViewWindowLockObserver.h"
27 #include "LogViewChangeObserverInternal.h"
32 class CLogChangeDefinition;
34 class MLogViewChangeObserver;
35 class CLogViewSetupClientOp;
36 class CLogViewWindowFetcher;
37 class CLogViewWindowLockObserver;
38 class CLogViewWindowChangeObserver;
41 /////////////////////////////////////////////////////////////////////////////////////////
42 // -----> CLogViewWindow (header)
43 /////////////////////////////////////////////////////////////////////////////////////////
44 NONSHARABLE_CLASS(CLogViewWindow) : public CLogActive, public MLogViewChangeObserverInternal, public MLogViewWindowFetcherObserver, public MLogViewWindowLockObserver
50 CLogViewWindow(RLogSession& aSession, TLogViewId aViewId, TInt aWindowSize, MLogViewChangeObserver* aCascadeObserver, TInt aPriority);
52 void ConstructL(CLogPackage& aPackage);
59 TInt Setup(const CLogFilterList& aFilterList, TInt aParam, TLogFilterConstructionType aFilterConstructionType);
62 * Move the view position
64 TBool NavigateL(TLogNavigation aNavigate, TRequestStatus& aStatus);
67 * Remove the specified log event from the window if its present
69 void RemoveFromWindowIfPresentL(TLogId aId);
72 * Access the change observer (needed to construct the view)
74 MLogViewChangeObserverInternal& ChangeObserver();
77 * Access the event at the current position
79 const CLogEvent& CurrsorEvent() const;
81 /** gets iViewRecordCount */
82 inline TInt ViewRecordCount() const;
84 private: // FROM MLogViewWindowLockObserver
85 void HandleWindowLockStatusChangeL(TLogViewLockStatus aStatus);
87 private: // FROM MLogViewWindowFetcherObserver
88 void HandleFetchedWindowItemL(TInt aItemIndex, CLogEvent* aEvent);
90 public: // FROM MLogViewChangeObserver
91 void HandleLogViewChangeEventAddedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount);
92 void HandleLogViewChangeEventChangedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount);
93 void HandleLogViewChangeEventDeletedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount);
95 private: // FROM MLogViewChangeObserverInternal
96 void HandleLogViewChangeEventLogClearedL();
98 private: // FROM CLogActive
101 void DoComplete(TInt& aComplete);
107 EStateFetchingWindow,
108 EStateProcessingWindow,
109 EStateNavigateWithinWindow,
114 void StateHandleWindowFetchStarting();
115 void StateHandleWindowFetchedL();
116 void StateHandleNavigation();
119 void CompleteRequest(TInt aCompletionCode = KErrNone);
120 void CalculateWindowForCursorPosition(TInt aCursorPosition, TLogWindow& aWindow) const;
123 void RefetchL(const TLogWindow& aWindow, TInt aCursor);
124 void ChangeState(TWindowState aNewState);
125 void RemoveEvent(TInt aIndex);
126 TInt CalculateCursorPosition(TLogNavigation aNavigate) const;
127 TInt FindEvent(TLogId aId);
128 TInt FindAndRemoveEvent(TLogId aId);
131 RLogSession& iSession;
132 const TLogViewId iViewId;
133 const TInt iWindowSize;
134 MLogViewChangeObserver* iCascadeObserver;
135 RPointerArray<CLogEvent> iEvents;
138 TLogWindowAndCursor iWindow;
139 TInt iViewRecordCount;
141 CLogViewSetupClientOp* iWindowPreparer;
142 CLogViewWindowFetcher* iWindowFetcher;
143 CLogViewWindowLockObserver* iWindowLockObserver;
144 CLogViewWindowChangeObserver* iWindowChangeObserver;
149 TInt CLogViewWindow::ViewRecordCount() const
151 return iViewRecordCount;