|
1 /* |
|
2 * Copyright (c) 2006 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: MCC Controller Asynchronous Link Creator active object |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef MCCASYNCLINKCREATOR_H |
|
22 #define MCCASYNCLINKCREATOR_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 #include "mccinternaldef.h" |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class TMMFMessage; |
|
30 class CMccUlDlClient; |
|
31 class MAsyncLinkCreationObserver; |
|
32 class MMccEventHandler; |
|
33 |
|
34 |
|
35 // CLASS DECLARATION |
|
36 |
|
37 /** |
|
38 * The main purpose of this class is to create link and RTP session. |
|
39 * Class also requests public IP resolving from Media NAT Traversal |
|
40 * plug-in via subcontroller. |
|
41 * |
|
42 * @lib Mcccontroller.lib |
|
43 * @since S60 v3.1 |
|
44 */ |
|
45 NONSHARABLE_CLASS( CMccAsyncLinkCreator ) : public CActive |
|
46 { |
|
47 |
|
48 public: |
|
49 |
|
50 static CMccAsyncLinkCreator* NewL( MAsyncLinkCreationObserver& aObserver, |
|
51 CMccUlDlClient* aSession ); |
|
52 |
|
53 static CMccAsyncLinkCreator* NewLC( MAsyncLinkCreationObserver& aObserver, |
|
54 CMccUlDlClient* aSession ); |
|
55 |
|
56 virtual ~CMccAsyncLinkCreator(); |
|
57 |
|
58 /** |
|
59 * Starts the connection creation process |
|
60 * |
|
61 * @since S60 v3.2 |
|
62 * @param aMessage Message containing client data |
|
63 * @return void |
|
64 */ |
|
65 void StartLinkCreationL( TMMFMessage& aMessage ); |
|
66 |
|
67 |
|
68 /** |
|
69 *GetSessionId() |
|
70 *@return TUint32 Session ID |
|
71 */ |
|
72 TUint32 GetSessionId(); |
|
73 |
|
74 |
|
75 protected: |
|
76 |
|
77 // from base class CActive |
|
78 |
|
79 /** |
|
80 * From CActive |
|
81 * Active object event handling |
|
82 * |
|
83 * @since S60 v3.2 |
|
84 */ |
|
85 void RunL(); |
|
86 |
|
87 /** |
|
88 * From CActive |
|
89 * Active cancellation |
|
90 * |
|
91 * @since S60 v3.2 |
|
92 */ |
|
93 void DoCancel(); |
|
94 |
|
95 /** |
|
96 * From CActive |
|
97 * RunL error handling |
|
98 * |
|
99 * @since S60 v3.2 |
|
100 * @param aError System wide error code |
|
101 * @return KErrNone |
|
102 */ |
|
103 TInt RunError( TInt aError ); |
|
104 |
|
105 |
|
106 private: |
|
107 |
|
108 CMccAsyncLinkCreator( MAsyncLinkCreationObserver& aObserver, |
|
109 CMccUlDlClient* aSession ); |
|
110 |
|
111 /** |
|
112 * Completes the client request with given error code |
|
113 * |
|
114 * @since S60 v3.2 |
|
115 * @param aError System wide error code |
|
116 */ |
|
117 void CompleteRequest( TInt aError ); |
|
118 |
|
119 |
|
120 private: // data |
|
121 |
|
122 /** |
|
123 * Observer for this link creator |
|
124 */ |
|
125 MAsyncLinkCreationObserver& iObserver; |
|
126 |
|
127 /** |
|
128 * Client data read from the message |
|
129 */ |
|
130 TMccCreateLinkPckg iClientData; |
|
131 |
|
132 /** |
|
133 * Pointer to Mcc Ul/Dl Client |
|
134 * Not own. |
|
135 */ |
|
136 CMccUlDlClient* iSession; |
|
137 |
|
138 /** |
|
139 * State of public IP resolving |
|
140 */ |
|
141 TInt iResolveState; |
|
142 |
|
143 /** |
|
144 * State of link creation. |
|
145 */ |
|
146 TBool iLinkCreated; |
|
147 |
|
148 }; |
|
149 |
|
150 #endif // MCCASYNCLINKCREATOR_H |