|
1 /* |
|
2 * Copyright (c) 2010 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 #ifndef EVENTSYSTEMSESSION_H_ |
|
18 #define EVENTSYSTEMSESSION_H_ |
|
19 |
|
20 #include <e32base.h> |
|
21 #include "waitingevent.h" |
|
22 |
|
23 |
|
24 // Session class of TestEngine server |
|
25 class CEventSystemSession : public CSession2 |
|
26 { |
|
27 public: |
|
28 // Create the session |
|
29 static CEventSystemSession* NewL(); |
|
30 |
|
31 public: |
|
32 // Constructor |
|
33 CEventSystemSession(); |
|
34 |
|
35 // Constructor |
|
36 ~CEventSystemSession(); |
|
37 |
|
38 // Called by client/server framework after |
|
39 // session has been successfully created |
|
40 void CreateL(); |
|
41 |
|
42 // Service request |
|
43 void ServiceL(const RMessage2& aMessage); |
|
44 |
|
45 private: |
|
46 // Handles message |
|
47 void DispatchMessageL(const RMessage2& aMessage); |
|
48 |
|
49 // Closes the session |
|
50 void CloseSession(); |
|
51 |
|
52 // Panics client |
|
53 void PanicClient(const RMessage2& aMessage, const TInt aPanic) const; |
|
54 |
|
55 // Set indication event |
|
56 void SetIndicationEventL(const RMessage2& aMessage); |
|
57 |
|
58 // Set state event |
|
59 void SetStateEventL(const RMessage2& aMessage); |
|
60 |
|
61 // Unset state event |
|
62 void UnsetStateEventL(const RMessage2& aMessage); |
|
63 |
|
64 // Request event |
|
65 void RequestEventL(const RMessage2& aMessage); |
|
66 |
|
67 // Release event |
|
68 void ReleaseEventL(const RMessage2& aMessage); |
|
69 |
|
70 // Wait for event |
|
71 void WaitForEventL(const RMessage2& aMessage); |
|
72 |
|
73 // Check if there is waiting event and complete if found |
|
74 void CompleteWaitingEventsL(const TDesC& aEventName); |
|
75 |
|
76 // Check list of requested events. If any of them is found, notify about event. |
|
77 void NotifyRequestedEventsL(const TDesC& aEventName); |
|
78 |
|
79 // Check list of state events. If any of them matches current waiting event, complete waiting event. |
|
80 //TBool CompleteFromStateEventL(const TDesC& aEventName, const RMessage2& aMessage); |
|
81 void CompleteFromStateEventL(CWaitingEvent* aEvent); |
|
82 |
|
83 // Add state event in the state events array |
|
84 void AddStateEventL(const TDesC& aEventName); |
|
85 |
|
86 // Cancel waiting message from the same session |
|
87 void CancelWaitingEventL(const RMessage2& aMessage); |
|
88 |
|
89 // Remove (kind of release) all requested events. |
|
90 void RemoveInRequestedStateL(const RMessage2& aMessage); |
|
91 |
|
92 private: |
|
93 // Object container for this session. |
|
94 CObjectCon *iContainer; |
|
95 |
|
96 // Waiting event (this is used in case when test case gets cancelled) |
|
97 CWaitingEvent *iWaitingEvent; |
|
98 |
|
99 }; /* CTestEngineSession */ |
|
100 |
|
101 |
|
102 #endif /* EVENTSYSTEMSESSION_H_ */ |
|
103 // EOF |