|
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: Handles requests for showing Call Waiting notes. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include <Psui.rsg> |
|
21 #include <PsuiContainer.h> |
|
22 #include <etelsat.h> |
|
23 |
|
24 #include "PsuiInternalConstants.h" |
|
25 #include "PsuiNoteController.h" |
|
26 #include "PsuiVariationProxy.h" |
|
27 |
|
28 // MEMBER FUNCTIONS |
|
29 // --------------------------------------------------------------------------- |
|
30 // Symbian OS two-phased Constructor. |
|
31 // --------------------------------------------------------------------------- |
|
32 EXPORT_C CPsuiWaitingObs* CPsuiWaitingObs::NewL( CPsuiContainer& aContainer ) |
|
33 { |
|
34 CPsuiWaitingObs* self = new( ELeave ) CPsuiWaitingObs; |
|
35 CleanupStack::PushL( self ); |
|
36 self->ConstructL( aContainer ); |
|
37 CleanupStack::Pop( self ); |
|
38 return self; |
|
39 } |
|
40 |
|
41 // --------------------------------------------------------------------------- |
|
42 // Symbian OS 2nd phase Constructor. |
|
43 // --------------------------------------------------------------------------- |
|
44 void CPsuiWaitingObs::ConstructL( CPsuiContainer& aContainer ) |
|
45 { |
|
46 iContainer = &aContainer; |
|
47 |
|
48 CPSuiVariationProxy* variationProxy = CPSuiVariationProxy::NewL(); |
|
49 CleanupStack::PushL( variationProxy ); |
|
50 iCallWaitingDistinguishEnabled = variationProxy->FeatureEnabled( KCallWaitingDistiquishNotProvisioned); |
|
51 CleanupStack::PopAndDestroy( variationProxy ); |
|
52 |
|
53 } |
|
54 |
|
55 // --------------------------------------------------------------------------- |
|
56 // Handles changing of call waiting. |
|
57 // --------------------------------------------------------------------------- |
|
58 void CPsuiWaitingObs::HandleCallWaitingChangedL |
|
59 ( const MPsetCallWaiting::TSetCallWaiting aSetting, const TInt /* aResult */ ) |
|
60 { |
|
61 if ( aSetting == MPsetCallWaiting::EActivateCallWaiting ) |
|
62 { |
|
63 CPsuiNoteController::InstanceL()->ShowNoteL( |
|
64 EPsuiConfirmationNote, R_CW_ACTIVE_NOTE ); |
|
65 } |
|
66 else if ( aSetting == MPsetCallWaiting::EDeactivateCallWaiting ) |
|
67 { |
|
68 CPsuiNoteController::InstanceL()->ShowNoteL( |
|
69 EPsuiConfirmationNote, R_CW_CANCEL_NOTE ); |
|
70 } |
|
71 } |
|
72 |
|
73 // --------------------------------------------------------------------------- |
|
74 // Sets engine contact for observer. |
|
75 // --------------------------------------------------------------------------- |
|
76 void CPsuiWaitingObs::SetEngineContact( MPsetCallWaiting& aEngineContact ) |
|
77 { |
|
78 CPsuiNoteController::InstanceL()->SetEngineContacts( |
|
79 &aEngineContact, NULL, NULL, NULL ); |
|
80 } |
|
81 |
|
82 // --------------------------------------------------------------------------- |
|
83 // Handles requesting notes (show/hide). |
|
84 // --------------------------------------------------------------------------- |
|
85 void CPsuiWaitingObs::HandleCWRequestingL( TBool aOngoing, TBool aInterrupted ) |
|
86 { |
|
87 if ( aInterrupted ) |
|
88 { |
|
89 CPsuiNoteController::InstanceL()->RemoveNotesL(); |
|
90 return; |
|
91 } |
|
92 |
|
93 if ( aOngoing ) |
|
94 { |
|
95 CPsuiNoteController::InstanceL()->ShowNoteL( |
|
96 EPsuiWaitingNote, -1 ); |
|
97 } |
|
98 else |
|
99 { |
|
100 CPsuiNoteController::InstanceL()->KillStaticNoteL(); |
|
101 } |
|
102 } |
|
103 |
|
104 // --------------------------------------------------------------------------- |
|
105 // Handles the get status notifications. |
|
106 // --------------------------------------------------------------------------- |
|
107 // |
|
108 void CPsuiWaitingObs::HandleCallWaitingGetStatusL( |
|
109 const MPsetCallWaiting::TGetCallWaitingStatus aStatus, |
|
110 TUint8 aBsc[KPSUIMaxBscNumber] ) |
|
111 { |
|
112 |
|
113 if ( iCallWaitingDistinguishEnabled && aStatus == MPsetCallWaiting::EStatusNotProvisioned ) |
|
114 { |
|
115 CPsuiNoteController::InstanceL()->ShowNoteL( |
|
116 EPsuiConfirmationNote, R_CW_NOT_PROVISIONED_NOTE ); |
|
117 } |
|
118 else if ( aStatus != MPsetCallWaiting::EStatusActive ) |
|
119 { |
|
120 CPsuiNoteController::InstanceL()->ShowNoteL( |
|
121 EPsuiConfirmationNote, R_CW_NOT_ACTIVE_NOTE ); |
|
122 } |
|
123 else |
|
124 { |
|
125 if( iCallWaitingDistinguishEnabled ) |
|
126 { |
|
127 |
|
128 //show only "CW active" even if the bsc list is present. |
|
129 //This change is to fix the error ENYI-6DYFKZ |
|
130 CPsuiNoteController::InstanceL()->ShowNoteL( EPsuiConfirmationNote, |
|
131 R_CW_ACTIVE_NO_BSC_NOTE ); |
|
132 } |
|
133 else |
|
134 { |
|
135 |
|
136 //if no bsc-list present, show only "CW active" |
|
137 if ( aBsc[0] == KPSUINoBscGroup ) |
|
138 { |
|
139 CPsuiNoteController::InstanceL()->ShowNoteL( EPsuiConfirmationNote, |
|
140 R_CW_ACTIVE_NO_BSC_NOTE ); |
|
141 } |
|
142 else |
|
143 { |
|
144 |
|
145 CPsuiNoteController::InstanceL()->ShowBscListL( |
|
146 R_CW_STATUS_HEADING, |
|
147 aBsc ); |
|
148 } |
|
149 } |
|
150 } |
|
151 } |
|
152 |
|
153 // --------------------------------------------------------------------------- |
|
154 // This function handles errors in call waiting requests. |
|
155 // --------------------------------------------------------------------------- |
|
156 // |
|
157 void CPsuiWaitingObs::HandleCWErrorL( TInt aReason ) |
|
158 { |
|
159 if ( aReason != KErrSatControl ) |
|
160 { |
|
161 TInt errorResource( |
|
162 CPsuiNoteController::InstanceL()->SetErrorNoteResourceID( aReason ) ); |
|
163 |
|
164 CPsuiNoteController::InstanceL()->ShowNoteL( EPsuiErrorNote, errorResource ); |
|
165 } |
|
166 } |
|
167 |
|
168 // End of File |