|
1 /* |
|
2 * Copyright (c) 2005-2009 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 |
|
18 |
|
19 |
|
20 /************************************************************************* |
|
21 * |
|
22 * Switches |
|
23 * |
|
24 ************************************************************************/ |
|
25 #ifndef __STATCONTROLLER_H__ |
|
26 #define __STATCONTROLLER_H__ |
|
27 |
|
28 /************************************************************************* |
|
29 * |
|
30 * System Includes |
|
31 * |
|
32 ************************************************************************/ |
|
33 #include <e32std.h> |
|
34 #include <e32base.h> |
|
35 |
|
36 /************************************************************************* |
|
37 * |
|
38 * Local Includes |
|
39 * |
|
40 ************************************************************************/ |
|
41 #include "stat_interfaces.h" |
|
42 #include "stat_engine.h" |
|
43 #include "stat_packetisation.h" |
|
44 #include "stat_serial.h" |
|
45 |
|
46 #ifndef LIGHT_MODE |
|
47 #include "stat_tcpip.h" |
|
48 #include "Stat_bt.h" |
|
49 #include "stat_usb.h" |
|
50 #endif // ifndef LIGHT_MODE |
|
51 |
|
52 |
|
53 |
|
54 /************************************************************************* |
|
55 * |
|
56 * Definitions |
|
57 * |
|
58 ************************************************************************/ |
|
59 #define KAddressTextLimit 16 |
|
60 |
|
61 /************************************************************************* |
|
62 * |
|
63 * CStatController |
|
64 * |
|
65 ************************************************************************/ |
|
66 class CStatController : public CActive, public MStatController, public MNotifyStatController |
|
67 { |
|
68 public: |
|
69 ~CStatController(); |
|
70 static CStatController *NewL(); |
|
71 |
|
72 // from MStatController |
|
73 TInt StartSession( TStatConnectType aConnectType, TDesC *aConnectParams, MNotifyUI *aUI, RFs *const aSession, MNotifyLogMessage *const aMsg); |
|
74 TInt StopSession( TInt aSessionId ); |
|
75 TInt SessionStatus( TInt aSessionId ); |
|
76 |
|
77 // from MNotifyStatController |
|
78 void HandleStatusChange( TCommStatus aNewStatus ); |
|
79 void HandleError( TInt aError, void *aErrorData ); |
|
80 void HandleInfo( const TDesC *aInfo ); |
|
81 |
|
82 // from CActive |
|
83 void RunL(); |
|
84 void DoCancel(); |
|
85 |
|
86 private: |
|
87 CStatController(); |
|
88 void ConstructL( void ); |
|
89 void SetStatus( TCommStatus aNewStatus ); |
|
90 void Notify( TInt aErrorStatus ); |
|
91 MStatApiTransport *StartTransportL( TStatConnectType aConnectType ); |
|
92 void KillTransport(); |
|
93 |
|
94 TCommStatus iSessionStatus; |
|
95 MStatApiTransport *iTransport; |
|
96 CStatEngine *iEngine; |
|
97 MNotifyUI *iUI; |
|
98 |
|
99 TStatConnectType iConnectType; |
|
100 CStatTransportPacketisation *iPacketisationTransport; |
|
101 CStatApiSerial *iSerialNetwork; |
|
102 #ifndef LIGHT_MODE |
|
103 CStatTransportTCPIP *iTcpipTransport; |
|
104 |
|
105 CStatApiUsb *iUsbNetwork; |
|
106 CStatTransportBT *iBluetoothTransport; |
|
107 #endif |
|
108 |
|
109 TBool iConnectedSuccessfully, iUserInitiatedExitRequest; |
|
110 TBuf<KAddressTextLimit> iConnectParams; |
|
111 |
|
112 RFs *iFs; |
|
113 MNotifyLogMessage *iMsg; |
|
114 }; |
|
115 |
|
116 |
|
117 #endif //__STATCONTROLLER_H__ |