|
1 // Copyright (c) 1999-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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 |
|
17 #ifndef __VWSSEVNT_H__ |
|
18 #define __VWSSEVNT_H__ |
|
19 |
|
20 #include <e32std.h> |
|
21 |
|
22 #include "VWSQUEUE.H" |
|
23 #include "VWSSESSN.H" |
|
24 |
|
25 |
|
26 /** |
|
27 * The CVwsSessionEvent class is the base class for session events generated WHEN ? |
|
28 */ |
|
29 class CVwsSessionEvent : public CVwsEvent |
|
30 { |
|
31 public: |
|
32 CVwsSessionEvent(CVwsSession& aSession,TType aType,CVwsEventQueue& aQueue); |
|
33 CVwsSessionEvent(CVwsSession& aSession,TType aType,CVwsEventQueue& aQueue,MVwsSessionObserver& aObserver); |
|
34 ~CVwsSessionEvent(); |
|
35 public: |
|
36 virtual void HandleViewEventRequestL(TInt aError,const RMessage2& aMessage)=0; |
|
37 void ReportRequestCompleted(MVwsSessionObserver::TRequestType aType,TInt aError,const RMessage2& aMessage); |
|
38 void NullifyObserver(); |
|
39 protected: |
|
40 CVwsSession& iSession; |
|
41 MVwsSessionObserver* iObserver; |
|
42 }; |
|
43 |
|
44 |
|
45 /** |
|
46 * The CVwsSessionEvent_Activation represents an activation event in a session's event queue |
|
47 */ |
|
48 class CVwsSessionEvent_Activation : public CVwsSessionEvent, public MVwsMessageHandler |
|
49 { |
|
50 public: |
|
51 CVwsSessionEvent_Activation(CVwsSession& aSession,CVwsEventQueue& aQueue,MVwsSessionObserver& iObserver,const TVwsViewId& aViewId,const TVwsViewId& aPreviousViewId,CVwsClientMessage* aClientMessage,const RThread& aThreadOfClientInitiatingViewSwitch); |
|
52 ~CVwsSessionEvent_Activation(); |
|
53 private: // From CVwsEvent. |
|
54 virtual void ProcessEventL(); |
|
55 virtual void Complete(TInt aError); |
|
56 private: // From CVwsSessionEvent. |
|
57 virtual void HandleViewEventRequestL(TInt aError,const RMessage2& aMessage); |
|
58 private: // From MVwsMessageHandler. |
|
59 void WriteClientMessageL(const RMessage2& aMessage); |
|
60 void CheckSourceOfViewSwitchL(const RMessage2& aMessage); |
|
61 private: |
|
62 void RequestActivationL(); |
|
63 void Complete(TInt aError,const RMessage2& aMessage); |
|
64 private: |
|
65 enum TState |
|
66 { |
|
67 EPending, |
|
68 EWaitingForClientViewEventRequest, |
|
69 EWaitingForCustomMessageCollection, |
|
70 EWaitingForAcknowledgementOfActivation |
|
71 }; |
|
72 private: |
|
73 const TVwsViewId iViewId; |
|
74 const TVwsViewId iPreviousViewId; |
|
75 CVwsClientMessage* iClientMessage; |
|
76 TState iState; |
|
77 RThread iThreadOfClientInitiatingViewSwitch; |
|
78 }; |
|
79 |
|
80 |
|
81 /** |
|
82 * The CVwsSessionEvent_Deactivation represents a deactivation event in a session's event queue |
|
83 */ |
|
84 class CVwsSessionEvent_Deactivation : public CVwsSessionEvent |
|
85 { |
|
86 public: |
|
87 CVwsSessionEvent_Deactivation(CVwsSession& aSession,CVwsEventQueue& aQueue,MVwsSessionObserver& iObserver,const TVwsViewId& aViewId,const TVwsViewId& aActiveViewId, TBool aDifferentInstanceOfSameApp); |
|
88 ~CVwsSessionEvent_Deactivation(); |
|
89 private: // From CVwsEvent. |
|
90 virtual void ProcessEventL(); |
|
91 private: // From CVwsSessionEvent. |
|
92 virtual void HandleViewEventRequestL(TInt aError,const RMessage2& aMessage); |
|
93 private: |
|
94 void RequestDeactivationL(); |
|
95 void Complete(TInt aError,const RMessage2& aMessage); |
|
96 private: |
|
97 enum TState |
|
98 { |
|
99 EPending, |
|
100 EWaitingForClientViewEventRequest, |
|
101 EWaitingForAcknowledgementOfDeactivation |
|
102 }; |
|
103 private: |
|
104 const TVwsViewId iViewId; |
|
105 const TVwsViewId iActiveViewId; |
|
106 TState iState; |
|
107 TBool iDifferentInstanceOfSameApp; |
|
108 }; |
|
109 |
|
110 |
|
111 /** |
|
112 * The CVwsSessionEvent_ScreenDeviceChangeNotification represents a screen device changes notification event in a |
|
113 * session's event queue |
|
114 */ |
|
115 class CVwsSessionEvent_ScreenDeviceChangeNotification : public CVwsSessionEvent |
|
116 { |
|
117 public: |
|
118 CVwsSessionEvent_ScreenDeviceChangeNotification(CVwsSession& aSession,CVwsEventQueue& aQueue,MVwsSessionObserver& iObserver,const TVwsViewId& aViewId); |
|
119 ~CVwsSessionEvent_ScreenDeviceChangeNotification(); |
|
120 private: // From CVwsEvent. |
|
121 virtual void ProcessEventL(); |
|
122 private: // From CVwsSessionEvent. |
|
123 virtual void HandleViewEventRequestL(TInt aError,const RMessage2& aMessage); |
|
124 private: |
|
125 void RequestScreenDeviceChangeNotificationL(); |
|
126 void Complete(TInt aError,const RMessage2& aMessage); |
|
127 private: |
|
128 enum TState |
|
129 { |
|
130 EPending, |
|
131 EWaitingForClientViewEventRequest, |
|
132 EWaitingForAcknowledgementOfScreenDeviceChange |
|
133 }; |
|
134 private: |
|
135 const TVwsViewId iViewId; |
|
136 TState iState; |
|
137 }; |
|
138 |
|
139 |
|
140 /** |
|
141 * The CVwsSessionEvent_DeactivationNotification represents a deactivation notification event in a session's event queue. |
|
142 */ |
|
143 class CVwsSessionEvent_DeactivationNotification : public CVwsSessionEvent |
|
144 { |
|
145 public: |
|
146 CVwsSessionEvent_DeactivationNotification(CVwsSession& aSession,CVwsEventQueue& aQueue,const TVwsViewId& aViewId,const TVwsViewId& aActiveViewId); |
|
147 ~CVwsSessionEvent_DeactivationNotification(); |
|
148 private: // From CVwsEvent. |
|
149 virtual void ProcessEventL(); |
|
150 private: // From CVwsSessionEvent. |
|
151 virtual void HandleViewEventRequestL(TInt aError,const RMessage2& aMessage); |
|
152 private: |
|
153 void RequestDeactivationNotificationL(); |
|
154 void Complete(TInt aError); |
|
155 private: |
|
156 enum TState |
|
157 { |
|
158 EPending, |
|
159 EWaitingForClientViewEventRequest, |
|
160 EWaitingForAcknowledgementOfDeactivationNotification |
|
161 }; |
|
162 private: |
|
163 const TVwsViewId iViewId; |
|
164 const TVwsViewId iActiveViewId; |
|
165 TState iState; |
|
166 }; |
|
167 |
|
168 |
|
169 /** |
|
170 * The CVwsSessionEvent_ActivationNotification represents a deactivation notification event in a session's event queue. |
|
171 */ |
|
172 class CVwsSessionEvent_ActivationNotification : public CVwsSessionEvent |
|
173 { |
|
174 public: |
|
175 CVwsSessionEvent_ActivationNotification(CVwsSession& aSession,CVwsEventQueue& aQueue,const TVwsViewId& aViewId,const TVwsViewId& aViewToBeDeactivatedId); |
|
176 ~CVwsSessionEvent_ActivationNotification(); |
|
177 private: // From CVwsEvent. |
|
178 virtual void ProcessEventL(); |
|
179 private: // From CVwsSessionEvent. |
|
180 virtual void HandleViewEventRequestL(TInt aError,const RMessage2& aMessage); |
|
181 private: |
|
182 void RequestActivationNotificationL(); |
|
183 void Complete(TInt aError); |
|
184 private: |
|
185 enum TState |
|
186 { |
|
187 EPending, |
|
188 EWaitingForClientViewEventRequest, |
|
189 EWaitingForAcknowledgementOfActivationNotification |
|
190 }; |
|
191 private: |
|
192 const TVwsViewId iViewId; |
|
193 const TVwsViewId iViewToBeDeactivatedId; |
|
194 TState iState; |
|
195 }; |
|
196 |
|
197 #endif |