|
1 /* |
|
2 * Copyright (c) 2003-2004 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: Command Handler Request Manager. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPHSRVCOMHANDREQUESTMANAGER_H |
|
20 #define CPHSRVCOMHANDREQUESTMANAGER_H |
|
21 |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include "MPhSrvComHandNegotiators.h" |
|
26 #include "MPhSrvComHandInitiators.h" |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CPhSrvComHandRequest; |
|
33 class CPhSrvServer; |
|
34 |
|
35 // CLASS DECLARATION |
|
36 |
|
37 /** |
|
38 * Command handler request manager. |
|
39 * |
|
40 * @since 2.6 |
|
41 */ |
|
42 class CPhSrvComHandRequestManager : |
|
43 public CBase, |
|
44 public MPhSrvComHandNegotiator |
|
45 { |
|
46 public: // Constructors and destructor |
|
47 |
|
48 /** |
|
49 * Constructor. |
|
50 * |
|
51 * @param aServer The server instance. |
|
52 */ |
|
53 CPhSrvComHandRequestManager( CPhSrvServer& aServer ); |
|
54 |
|
55 /** |
|
56 * Destructor. |
|
57 */ |
|
58 ~CPhSrvComHandRequestManager(); |
|
59 |
|
60 /** |
|
61 * Symbian 2nd phase constructor. |
|
62 */ |
|
63 void ConstructL(); |
|
64 |
|
65 |
|
66 public: // Functions from base classes |
|
67 |
|
68 /** |
|
69 * @see MPhSrvComHandNegotiators |
|
70 */ |
|
71 void NegotiatorRequestL( |
|
72 const RMessage2& aMessage, |
|
73 const TPhCltComHandCommandParameters& aParams, |
|
74 CPhSrvSubSessionBase& aSubSession ); |
|
75 |
|
76 /** |
|
77 * @see MPhSrvComHandNegotiators |
|
78 */ |
|
79 void NegotiatorRequestCancel( |
|
80 CPhSrvSubSessionBase& aSubSession ); |
|
81 |
|
82 /** |
|
83 * @see MPhSrvComHandNegotiators |
|
84 */ |
|
85 void SetNegotiatorReadyRequestL( |
|
86 MPhSrvComHandInitiator& aInitiator ); |
|
87 |
|
88 /** |
|
89 * @see MPhSrvComHandNegotiators |
|
90 */ |
|
91 void SetNegotiatorReadyRequestCancel( |
|
92 MPhSrvComHandInitiator& aInitiator ); |
|
93 |
|
94 /** |
|
95 * @see MPhSrvComHandNegotiators |
|
96 */ |
|
97 virtual void SetNegotiatorAttemptedRequestResponseValue( |
|
98 TPhCltPhoneResults aResult ); |
|
99 |
|
100 |
|
101 private: |
|
102 |
|
103 /** |
|
104 * Updates the request queue. |
|
105 */ |
|
106 void UpdateQueue(); |
|
107 |
|
108 /** |
|
109 * Checks whether there already is request from this client (subsession). |
|
110 * |
|
111 * @param aSubSession The client who's requests are searched. |
|
112 * @return ETrue if there already is request from this client, |
|
113 * otherwise EFalse. |
|
114 */ |
|
115 TBool RequestAlreadyExists( CPhSrvSubSessionBase& aSubSession ); |
|
116 |
|
117 |
|
118 private: // Data |
|
119 |
|
120 // A list of requests made by the external command handler interface |
|
121 // that the phone app should handle. It completes them sequentially |
|
122 // after its finished the previous request. |
|
123 // Index 0 is reserved for the emergency request. |
|
124 RPointerArray< CPhSrvComHandRequest >* iOutstandingComHandRequests; |
|
125 |
|
126 // The object responsible for processing external client command |
|
127 // handler requests. |
|
128 // This is essentially an interface to the phone app engine. |
|
129 MPhSrvComHandInitiator* iComHandInitiator; |
|
130 |
|
131 // The server instance. |
|
132 CPhSrvServer& iServer; |
|
133 |
|
134 // If NULL, then the active request was deleted during execution. |
|
135 CPhSrvComHandRequest* iActiveRequest; |
|
136 }; |
|
137 |
|
138 |
|
139 #endif // CPHSRVCOMHANDREQUESTMANAGER_H |
|
140 |
|
141 |
|
142 // End of File |