|
1 // Copyright (c) 2008-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 #ifndef __SUSEMERGENCYCALLRFADAPTATION_H__ |
|
17 #define __SUSEMERGENCYCALLRFADAPTATION_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 #include "ssmadaptation.h" |
|
21 #include "ssmdebug.h" |
|
22 #include "ssmadaptationcmn.h" |
|
23 #include "susadaptionsession.h" |
|
24 |
|
25 |
|
26 /** |
|
27 CEmergencyCallRfAdaptation |
|
28 |
|
29 This class implements the EmergencyCallRf Adaptation related functionality as part of |
|
30 Adaptation server.This class implements an active object to route the requests |
|
31 to Adaptation plugins loaded by CSsmAdaptationServer.When requests are received |
|
32 from multiple clients this class queues the requests and processes them in order. |
|
33 Adaptation server handles only one request from each session and uses Cancel() |
|
34 methods to cancel any of the session's requests made before. |
|
35 The queueing mechanism is to handle multiple clients at a time not to handle multiple |
|
36 requests from one particular clients session. |
|
37 |
|
38 @internalComponent |
|
39 */ |
|
40 |
|
41 |
|
42 class CEmergencyCallRfAdaptation : public CActive |
|
43 { |
|
44 public: |
|
45 static CEmergencyCallRfAdaptation* NewL(MEmergencyCallRfAdaptation& aAdaptation); |
|
46 ~CEmergencyCallRfAdaptation(); |
|
47 |
|
48 void Release(); |
|
49 void DoActivateRfForEmergencyCallL(const RMessage2& aMessage); |
|
50 void DoDeactivateRfForEmergencyCallL(const RMessage2& aMessage); |
|
51 void DoEmergencyCallRfAdaptationCancelL(const RMessage2& aMessage); |
|
52 void SetPriorityClientSession(CSsmAdaptationSession* aPriorityClientSession); |
|
53 void RemovePriorityClientSession(); |
|
54 void ReserveMemoryL(); |
|
55 protected: |
|
56 void RunL(); |
|
57 TInt RunError( TInt aError ); |
|
58 void DoCancel(); |
|
59 |
|
60 private: |
|
61 |
|
62 CEmergencyCallRfAdaptation(MEmergencyCallRfAdaptation& aAdaptation); |
|
63 void SubmitOrQueueL(const RMessage2 &aMessage); |
|
64 void Submit(CAdaptationMessage*& aMessage); |
|
65 |
|
66 private: |
|
67 CAdaptationMessage *iCurrentMessage; |
|
68 RSsmAdaptationRequestQueue iPendingRequestsQueue; |
|
69 |
|
70 MEmergencyCallRfAdaptation& iEmergencyCallRfAdaptation; |
|
71 //Reserving Heap to create CAdaptationMessage in OOM condition for priority clients |
|
72 RHeap* iReservedHeap; |
|
73 //For storing PriorityClientsession |
|
74 CSsmAdaptationSession* iPriorityClientSession; |
|
75 }; |
|
76 |
|
77 /** |
|
78 * Used for pushing the CAdaptationMessage object in to cleanup stack. This is needed as |
|
79 * the message is created using the reserved heap should be freed back to reserved heap |
|
80 * instead of deleting. |
|
81 * @internalComponent |
|
82 */ |
|
83 struct TStoreAdaptationMessage |
|
84 { |
|
85 CAdaptationMessage* iAdaptationMessage; |
|
86 RHeap* iReservedHeap; |
|
87 }; |
|
88 |
|
89 #endif // __SUSEMERGENCYCALLRFADAPTATION_H__ |