author | Sebastian Brannstrom <sebastianb@symbian.org> |
Sat, 23 Oct 2010 15:16:10 +0100 | |
branch | RCL_3 |
changeset 273 | 44abfca84f13 |
parent 163 | f94dbd678dda |
child 285 | 4d42a5e09930 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
2 |
* Copyright (c) 2007-2010 Sebastian Brannstrom, Lars Persson, EmbedDev AB |
|
3 |
* |
|
4 |
* All rights reserved. |
|
5 |
* This component and the accompanying materials are made available |
|
6 |
* under the terms of the License "Eclipse Public License v1.0" |
|
7 |
* which accompanies this distribution, and is available |
|
8 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
9 |
* |
|
10 |
* Initial Contributors: |
|
11 |
* EmbedDev AB - initial contribution. |
|
12 |
* |
|
13 |
* Contributors: |
|
14 |
* |
|
15 |
* Description: |
|
16 |
* |
|
17 |
*/ |
|
18 |
||
19 |
#ifndef PODCAST_CONNECTIONENGINE_H |
|
20 |
#define PODCAST_CONNECTIONENGINE_H |
|
21 |
||
22 |
||
23 |
// Connect using mobility extension |
|
24 |
#include <in_sock.h> |
|
25 |
#include <connpref.h> |
|
26 |
#include <commdbconnpref.h> |
|
27 |
#include <comms-infras/cs_mobility_apiext.h> |
|
28 |
||
29 |
// Using connection manager settings UI |
|
30 |
#include <cmapplicationsettingsui.h> |
|
31 |
class CPodcastModel; |
|
32 |
||
33 |
class MConnectionObserver |
|
34 |
{ |
|
35 |
public: |
|
13 | 36 |
virtual void ConnectionSelectionStart() = 0; |
37 |
virtual void ConnectionSelectionEnd() = 0; |
|
2 | 38 |
virtual void ConnectCompleteL(TInt aErrorCode) = 0; |
39 |
virtual void Disconnected() = 0; |
|
40 |
}; |
|
41 |
||
42 |
/** |
|
43 |
* This class helps to connect using three available methods |
|
44 |
* SNAP, Mobility extension and Connection manager UI |
|
45 |
*/ |
|
46 |
class CConnectionEngine:public CActive, public MMobilityProtocolResp |
|
47 |
{ |
|
48 |
public: |
|
49 |
enum TConnectionType |
|
50 |
{ |
|
51 |
EUserSelectConnection, |
|
52 |
ESNAPConnection, |
|
53 |
EMobilityConnection, |
|
54 |
EDefaultConnection, |
|
55 |
EIAPConnection |
|
56 |
}; |
|
57 |
||
58 |
enum TConnectionState |
|
59 |
{ |
|
60 |
ENotConnected, |
|
61 |
EConnecting, |
|
62 |
EConnected |
|
63 |
}; |
|
64 |
||
65 |
static CConnectionEngine* NewL(CPodcastModel& aPodcastModel); |
|
66 |
~CConnectionEngine(); |
|
67 |
void StartL(TConnectionType aConnectionType); |
|
68 |
RConnection& Connection(); |
|
69 |
TConnectionState ConnectionState(); |
|
59
9569ea080d5a
Export the proper functions for DLL usage
Lars Persson <lars.persson@embeddev.se>
parents:
13
diff
changeset
|
70 |
IMPORT_C void AddObserver(MConnectionObserver* aObserver); |
2 | 71 |
RSocketServ& SockServ(); |
163
f94dbd678dda
Fix for bug 3183; merging minor differences with symbian1 branch
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
125
diff
changeset
|
72 |
void Stop(); |
2 | 73 |
private: // Methods |
74 |
CConnectionEngine(CPodcastModel& aPodcastModel); |
|
75 |
void ConstructL(); |
|
76 |
protected: |
|
77 |
// From CActive |
|
78 |
void RunL(); |
|
79 |
void DoCancel(); |
|
80 |
TInt RunError( TInt aError ); |
|
81 |
protected: |
|
82 |
// From MMobilityProtocolResp |
|
83 |
void PreferredCarrierAvailable( TAccessPointInfo aOldAPInfo, |
|
84 |
TAccessPointInfo aNewAPInfo, |
|
85 |
TBool aIsUpgrade, |
|
86 |
TBool aIsSeamless ); |
|
87 |
||
88 |
void NewCarrierActive( TAccessPointInfo aNewAPInfo, TBool aIsSeamless ); |
|
89 |
void Error( TInt aError ); |
|
90 |
protected: |
|
91 |
// UI Setting |
|
92 |
TBool ConnectionSettingL(); |
|
93 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
13
diff
changeset
|
94 |
void ReportConnectionL(TInt aError); |
13 | 95 |
void ReportConnectionSelectionStart(); |
96 |
void ReportConnectionSelectionEnd(); |
|
97 |
||
2 | 98 |
private: |
99 |
RConnection iConnection; |
|
100 |
RSocketServ iSocketServer; |
|
101 |
// Connect using mobility extension |
|
102 |
CActiveCommsMobilityApiExt* iMobility; |
|
103 |
||
104 |
// Using connection manager settings UI |
|
105 |
TCmSettingSelection iUserSelection; |
|
106 |
||
107 |
// Connect using Commdb |
|
108 |
TCommDbConnPref iCommdbPreference; |
|
109 |
||
110 |
// Connect using SNAP setting |
|
111 |
TConnSnapPref iSnapPreference; |
|
112 |
||
113 |
TConnectionType iConnectionType; |
|
114 |
TConnectionState iConnectionState; |
|
115 |
RPointerArray<MConnectionObserver> iObserverArray; |
|
116 |
CPodcastModel &iPodcastModel; // reference to the model |
|
117 |
}; |
|
118 |
||
119 |
#endif // PODCAST_CONNECTIONENGINE_H |