|
1 /* |
|
2 * Copyright (c) 2002-2007 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 #include "scpenabled.h" |
|
20 #include "scpservicehandlerbase.h" |
|
21 #include "scpsubservice.h" |
|
22 #include "scplogger.h" |
|
23 |
|
24 // ----------------------------------------------------------------------------- |
|
25 // TScpEnabled::TScpEnabled |
|
26 // ----------------------------------------------------------------------------- |
|
27 // |
|
28 TScpEnabled::TScpEnabled() |
|
29 { |
|
30 SCPLOGSTRING( "TScpEnabled::TScpEnabled" ); |
|
31 } |
|
32 |
|
33 // ----------------------------------------------------------------------------- |
|
34 // TScpEnabled::State |
|
35 // ----------------------------------------------------------------------------- |
|
36 // |
|
37 TCCHSubserviceState TScpEnabled::State() const |
|
38 { |
|
39 SCPLOGSTRING( "TScpEnabled::State" ); |
|
40 |
|
41 return ECCHEnabled; |
|
42 } |
|
43 |
|
44 // ----------------------------------------------------------------------------- |
|
45 // TScpEnabled::Disable |
|
46 // ----------------------------------------------------------------------------- |
|
47 // |
|
48 TInt TScpEnabled::Disable( CScpSubService& aSubService ) const |
|
49 { |
|
50 SCPLOGSTRING( "TScpEnabled::Disable" ); |
|
51 |
|
52 aSubService.SetEnableRequestedState( CScpSubService::EScpDisabled ); |
|
53 |
|
54 CScpServiceHandlerBase& handler = aSubService.ServiceHandler(); |
|
55 TInt result = handler.DisableSubService(); |
|
56 |
|
57 ChangeState( aSubService, ECCHDisconnecting, KErrNone ); |
|
58 |
|
59 return result; |
|
60 } |
|
61 |
|
62 // ----------------------------------------------------------------------------- |
|
63 // TScpEnabled::NetworkLost |
|
64 // ----------------------------------------------------------------------------- |
|
65 // |
|
66 void TScpEnabled::NetworkLost( CScpSubService& aSubService ) const |
|
67 { |
|
68 SCPLOGSTRING( "TScpEnabled::NetworkLost" ); |
|
69 |
|
70 ChangeState( aSubService, ECCHConnecting, KCCHErrorNetworkLost ); |
|
71 } |
|
72 |
|
73 // ----------------------------------------------------------------------------- |
|
74 // TScpEnabled::ServiceConnected |
|
75 // ----------------------------------------------------------------------------- |
|
76 // |
|
77 void TScpEnabled::ServiceConnected( CScpSubService& aSubService ) const |
|
78 { |
|
79 SCPLOGSTRING( "TScpEnabled::ServiceConnected" ); |
|
80 |
|
81 ChangeState( aSubService, ECCHEnabled, KErrNone ); |
|
82 } |
|
83 |
|
84 // ----------------------------------------------------------------------------- |
|
85 // TScpEnabled::ServiceConnectionFailed |
|
86 // ----------------------------------------------------------------------------- |
|
87 // |
|
88 void TScpEnabled::ServiceConnectionFailed( CScpSubService& aSubService ) const |
|
89 { |
|
90 SCPLOGSTRING( "TScpEnabled::ServiceConnectionFailed" ); |
|
91 |
|
92 ChangeState( aSubService, ECCHConnecting, KCCHErrorLoginFailed ); |
|
93 } |
|
94 |
|
95 // ----------------------------------------------------------------------------- |
|
96 // TScpEnabled::ServiceDisconnected |
|
97 // ----------------------------------------------------------------------------- |
|
98 // |
|
99 void TScpEnabled::ServiceDisconnected( CScpSubService& aSubService ) const |
|
100 { |
|
101 SCPLOGSTRING( "TScpEnabled::ServiceDisconnected" ); |
|
102 |
|
103 ChangeState( aSubService, ECCHConnecting, KCCHErrorServiceNotResponding ); |
|
104 } |
|
105 |
|
106 // ----------------------------------------------------------------------------- |
|
107 // TScpEnabled::BandwidthLimited |
|
108 // ----------------------------------------------------------------------------- |
|
109 // |
|
110 void TScpEnabled::BandwidthLimited( CScpSubService& aSubService ) const |
|
111 { |
|
112 SCPLOGSTRING( "TScpEnabled::BandwidthLimited" ); |
|
113 |
|
114 ChangeState( aSubService, ECCHEnabled, KCCHErrorBandwidthInsufficient ); |
|
115 } |
|
116 |
|
117 // ----------------------------------------------------------------------------- |
|
118 // TScpEnabled::Roaming |
|
119 // ----------------------------------------------------------------------------- |
|
120 // |
|
121 void TScpEnabled::Roaming( CScpSubService& aSubService ) const |
|
122 { |
|
123 SCPLOGSTRING( "TScpEnabled::Roaming" ); |
|
124 |
|
125 ChangeState( aSubService, ECCHConnecting, KErrNone ); |
|
126 } |
|
127 |
|
128 // End of File |