|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef LOGSSTATEBASE_H |
|
19 #define LOGSSTATEBASE_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32std.h> |
|
23 |
|
24 // FORWARD DECLARATION |
|
25 class LogsStateBaseContext; |
|
26 class CLogViewEvent; |
|
27 class CLogFilterList; |
|
28 class CLogFilter; |
|
29 class CLogEvent; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * Reader state base |
|
35 */ |
|
36 class LogsStateBase { |
|
37 |
|
38 friend class UT_LogsReaderStates; |
|
39 friend class UT_LogsReader; |
|
40 |
|
41 public: |
|
42 |
|
43 /** |
|
44 * Destructor |
|
45 */ |
|
46 virtual ~LogsStateBase(); |
|
47 |
|
48 /** |
|
49 * Set next state to be used once this state has completed. |
|
50 * @param nextState |
|
51 */ |
|
52 void setNextState(LogsStateBase& nextState); |
|
53 |
|
54 /** |
|
55 * Enter to the state, may proceed immediately to next state. |
|
56 * @return true if entering started async operation, false if not |
|
57 */ |
|
58 virtual bool enterL(); |
|
59 |
|
60 /** |
|
61 * Continue running in the state, may proceed to next state |
|
62 * @return true if continue started async operation, false if not |
|
63 */ |
|
64 virtual bool continueL(); |
|
65 |
|
66 protected: |
|
67 |
|
68 /** |
|
69 * Constructor |
|
70 */ |
|
71 LogsStateBase(LogsStateBaseContext& context); |
|
72 |
|
73 /** |
|
74 * Proceed to next state if such exists. |
|
75 * @return true if entering started async operation, false if not |
|
76 */ |
|
77 virtual bool enterNextStateL(); |
|
78 |
|
79 /** |
|
80 * Get number of events in view |
|
81 * @return view count |
|
82 */ |
|
83 int viewCountL() const; |
|
84 |
|
85 /** |
|
86 * Get current event |
|
87 * @return event |
|
88 */ |
|
89 CLogEvent& event() const; |
|
90 |
|
91 /** |
|
92 * Try to search duplicates for current event in the view |
|
93 * @param aFilter, filter to be used for searching duplicates |
|
94 * @return true, if duplicates are searched |
|
95 */ |
|
96 bool duplicatesL(const CLogFilter* aFilter = 0); |
|
97 |
|
98 protected: |
|
99 LogsStateBaseContext& mBaseContext; |
|
100 LogsStateBase* mNextState; |
|
101 int mStateIndex; |
|
102 }; |
|
103 |
|
104 |
|
105 |
|
106 /** |
|
107 * Searching event state |
|
108 */ |
|
109 class LogsStateSearchingEvent : public LogsStateBase |
|
110 { |
|
111 friend class UT_LogsReaderStates; |
|
112 |
|
113 public: |
|
114 LogsStateSearchingEvent(LogsStateBaseContext& context); |
|
115 virtual ~LogsStateSearchingEvent(){} |
|
116 |
|
117 public: // From LogsReaderStateBase |
|
118 virtual bool enterL(); |
|
119 virtual bool continueL(); |
|
120 }; |
|
121 |
|
122 |
|
123 #endif // LOGSSTATEBASE_H |
|
124 |
|
125 |
|
126 // End of File |
|
127 |
|
128 |
|
129 |
|
130 |