sl@0
|
1 |
// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#ifndef __LOGVIEWWINDOW_H__
|
sl@0
|
17 |
#define __LOGVIEWWINDOW_H__
|
sl@0
|
18 |
|
sl@0
|
19 |
// System includes
|
sl@0
|
20 |
#include <e32base.h>
|
sl@0
|
21 |
|
sl@0
|
22 |
// User includes
|
sl@0
|
23 |
#include <logwrap.h>
|
sl@0
|
24 |
#include "LogServShared.h"
|
sl@0
|
25 |
#include "LogViewWindowFetcher.h"
|
sl@0
|
26 |
#include "LogViewWindowLockObserver.h"
|
sl@0
|
27 |
#include "LogViewChangeObserverInternal.h"
|
sl@0
|
28 |
|
sl@0
|
29 |
// Classes referenced
|
sl@0
|
30 |
class CLogClient;
|
sl@0
|
31 |
class CLogPackage;
|
sl@0
|
32 |
class CLogChangeDefinition;
|
sl@0
|
33 |
class CLogFilterList;
|
sl@0
|
34 |
class MLogViewChangeObserver;
|
sl@0
|
35 |
class CLogViewSetupClientOp;
|
sl@0
|
36 |
class CLogViewWindowFetcher;
|
sl@0
|
37 |
class CLogViewWindowLockObserver;
|
sl@0
|
38 |
class CLogViewWindowChangeObserver;
|
sl@0
|
39 |
|
sl@0
|
40 |
|
sl@0
|
41 |
/////////////////////////////////////////////////////////////////////////////////////////
|
sl@0
|
42 |
// -----> CLogViewWindow (header)
|
sl@0
|
43 |
/////////////////////////////////////////////////////////////////////////////////////////
|
sl@0
|
44 |
NONSHARABLE_CLASS(CLogViewWindow) : public CLogActive, public MLogViewChangeObserverInternal, public MLogViewWindowFetcherObserver, public MLogViewWindowLockObserver
|
sl@0
|
45 |
/**
|
sl@0
|
46 |
@internalComponent
|
sl@0
|
47 |
*/
|
sl@0
|
48 |
{
|
sl@0
|
49 |
public:
|
sl@0
|
50 |
CLogViewWindow(RLogSession& aSession, TLogViewId aViewId, TInt aWindowSize, MLogViewChangeObserver* aCascadeObserver, TInt aPriority);
|
sl@0
|
51 |
~CLogViewWindow();
|
sl@0
|
52 |
void ConstructL(CLogPackage& aPackage);
|
sl@0
|
53 |
|
sl@0
|
54 |
public:
|
sl@0
|
55 |
|
sl@0
|
56 |
/**
|
sl@0
|
57 |
* Prepare the view
|
sl@0
|
58 |
*/
|
sl@0
|
59 |
TInt Setup(const CLogFilterList& aFilterList, TInt aParam, TLogFilterConstructionType aFilterConstructionType);
|
sl@0
|
60 |
|
sl@0
|
61 |
/**
|
sl@0
|
62 |
* Move the view position
|
sl@0
|
63 |
*/
|
sl@0
|
64 |
TBool NavigateL(TLogNavigation aNavigate, TRequestStatus& aStatus);
|
sl@0
|
65 |
|
sl@0
|
66 |
/**
|
sl@0
|
67 |
* Remove the specified log event from the window if its present
|
sl@0
|
68 |
*/
|
sl@0
|
69 |
void RemoveFromWindowIfPresentL(TLogId aId);
|
sl@0
|
70 |
|
sl@0
|
71 |
/**
|
sl@0
|
72 |
* Access the change observer (needed to construct the view)
|
sl@0
|
73 |
*/
|
sl@0
|
74 |
MLogViewChangeObserverInternal& ChangeObserver();
|
sl@0
|
75 |
|
sl@0
|
76 |
/**
|
sl@0
|
77 |
* Access the event at the current position
|
sl@0
|
78 |
*/
|
sl@0
|
79 |
const CLogEvent& CurrsorEvent() const;
|
sl@0
|
80 |
|
sl@0
|
81 |
/** gets iViewRecordCount */
|
sl@0
|
82 |
inline TInt ViewRecordCount() const;
|
sl@0
|
83 |
|
sl@0
|
84 |
private: // FROM MLogViewWindowLockObserver
|
sl@0
|
85 |
void HandleWindowLockStatusChangeL(TLogViewLockStatus aStatus);
|
sl@0
|
86 |
|
sl@0
|
87 |
private: // FROM MLogViewWindowFetcherObserver
|
sl@0
|
88 |
void HandleFetchedWindowItemL(TInt aItemIndex, CLogEvent* aEvent);
|
sl@0
|
89 |
|
sl@0
|
90 |
public: // FROM MLogViewChangeObserver
|
sl@0
|
91 |
void HandleLogViewChangeEventAddedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount);
|
sl@0
|
92 |
void HandleLogViewChangeEventChangedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount);
|
sl@0
|
93 |
void HandleLogViewChangeEventDeletedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount);
|
sl@0
|
94 |
|
sl@0
|
95 |
private: // FROM MLogViewChangeObserverInternal
|
sl@0
|
96 |
void HandleLogViewChangeEventLogClearedL();
|
sl@0
|
97 |
|
sl@0
|
98 |
private: // FROM CLogActive
|
sl@0
|
99 |
void DoRunL();
|
sl@0
|
100 |
void DoCancel();
|
sl@0
|
101 |
void DoComplete(TInt& aComplete);
|
sl@0
|
102 |
|
sl@0
|
103 |
private:
|
sl@0
|
104 |
enum TWindowState
|
sl@0
|
105 |
{
|
sl@0
|
106 |
EStateIdle = 0,
|
sl@0
|
107 |
EStateFetchingWindow,
|
sl@0
|
108 |
EStateProcessingWindow,
|
sl@0
|
109 |
EStateNavigateWithinWindow,
|
sl@0
|
110 |
EStateLocked
|
sl@0
|
111 |
};
|
sl@0
|
112 |
|
sl@0
|
113 |
private:
|
sl@0
|
114 |
void StateHandleWindowFetchStarting();
|
sl@0
|
115 |
void StateHandleWindowFetchedL();
|
sl@0
|
116 |
void StateHandleNavigation();
|
sl@0
|
117 |
|
sl@0
|
118 |
private:
|
sl@0
|
119 |
void CompleteRequest(TInt aCompletionCode = KErrNone);
|
sl@0
|
120 |
void CalculateWindowForCursorPosition(TInt aCursorPosition, TLogWindow& aWindow) const;
|
sl@0
|
121 |
void Reset();
|
sl@0
|
122 |
void SilentCancel();
|
sl@0
|
123 |
void RefetchL(const TLogWindow& aWindow, TInt aCursor);
|
sl@0
|
124 |
void ChangeState(TWindowState aNewState);
|
sl@0
|
125 |
void RemoveEvent(TInt aIndex);
|
sl@0
|
126 |
TInt CalculateCursorPosition(TLogNavigation aNavigate) const;
|
sl@0
|
127 |
TInt FindEvent(TLogId aId);
|
sl@0
|
128 |
TInt FindAndRemoveEvent(TLogId aId);
|
sl@0
|
129 |
|
sl@0
|
130 |
private:
|
sl@0
|
131 |
RLogSession& iSession;
|
sl@0
|
132 |
const TLogViewId iViewId;
|
sl@0
|
133 |
const TInt iWindowSize;
|
sl@0
|
134 |
MLogViewChangeObserver* iCascadeObserver;
|
sl@0
|
135 |
RPointerArray<CLogEvent> iEvents;
|
sl@0
|
136 |
|
sl@0
|
137 |
TWindowState iState;
|
sl@0
|
138 |
TLogWindowAndCursor iWindow;
|
sl@0
|
139 |
TInt iViewRecordCount;
|
sl@0
|
140 |
|
sl@0
|
141 |
CLogViewSetupClientOp* iWindowPreparer;
|
sl@0
|
142 |
CLogViewWindowFetcher* iWindowFetcher;
|
sl@0
|
143 |
CLogViewWindowLockObserver* iWindowLockObserver;
|
sl@0
|
144 |
CLogViewWindowChangeObserver* iWindowChangeObserver;
|
sl@0
|
145 |
};
|
sl@0
|
146 |
|
sl@0
|
147 |
|
sl@0
|
148 |
inline
|
sl@0
|
149 |
TInt CLogViewWindow::ViewRecordCount() const
|
sl@0
|
150 |
{
|
sl@0
|
151 |
return iViewRecordCount;
|
sl@0
|
152 |
}
|
sl@0
|
153 |
|
sl@0
|
154 |
#endif
|