|
1 /* |
|
2 * Copyright (c) 2008 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: Sends and receives DTMF tones |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CVCCTRANSFERPROVIDER_H |
|
21 #define CVCCTRANSFERPROVIDER_H |
|
22 |
|
23 class CVccPerformer; |
|
24 |
|
25 #include <mccptransferprovider.h> // MCCPTransferProvider |
|
26 #include <mccptransferobserver.h> // MCCPTransferObserver |
|
27 |
|
28 /** |
|
29 * DTMF provider. |
|
30 * Contains DTMF providers from call providers and forward all requests between |
|
31 * them and CCE |
|
32 * |
|
33 * @lib vccperformer.lib |
|
34 * @since S60 v3.2 |
|
35 */ |
|
36 class CVccTransferProvider : public CBase, |
|
37 public MCCPTransferProvider, |
|
38 public MCCPTransferObserver |
|
39 { |
|
40 |
|
41 public: |
|
42 |
|
43 /** |
|
44 * Two-phased constructor. |
|
45 * @param aProviders Service providers |
|
46 * @param aObserver |
|
47 * @param aDirector Reference to Director object |
|
48 */ |
|
49 static CVccTransferProvider* NewL ( CVccPerformer* aCall ); |
|
50 |
|
51 /** |
|
52 * Destructor. |
|
53 */ |
|
54 virtual ~CVccTransferProvider(); |
|
55 |
|
56 /** |
|
57 * Attended transfer to given call recipient. |
|
58 * There needs to exist two calls. a call between A-B and A-C. A wants to transfer the call to B-C. |
|
59 * Both calls A-B and A-C will be disconnected after transfer. |
|
60 * In above case C will be the aTransferTargetCall call recipient. B is the recipient of the |
|
61 * current call between A-B - called on A's call object transfer provider. |
|
62 * The A-B call is on hold. |
|
63 * Actual request result indication comes via observer classes |
|
64 * @param aTransferTargetCall Call containing the transfer target info. |
|
65 * @return KErrNone if request was started succesfully. |
|
66 * @return KErrNotReady if call is not in connected or on-hold state. |
|
67 * @return KErrArgument transfer traget address was illegal. |
|
68 * @pre Call state is MCCPCallObserver::ECCPStateConnected or MCCPCallObserver::ECCPStateHold |
|
69 * @since S60 3.2 |
|
70 */ |
|
71 TInt AttendedTransfer( MCCPCall& aTransferTargetCall ); |
|
72 |
|
73 /** |
|
74 * Attended transfer to given address. There does not need to be |
|
75 * a current call between the given transfer target. |
|
76 * Actual request result indication comes via observer class |
|
77 * @param aTransferTarget Transfer target address |
|
78 * @return KErrNone if request was started succesfully. |
|
79 * @return KErrNotReady if call is not in connected or on-hold state. |
|
80 * @return KErrArgument transfer address was illegal. |
|
81 * @pre Call state is MCCPCallObserver::ECCPStateConnected or MCCPCallObserver::ECCPStateHold |
|
82 * @since S60 3.2 |
|
83 */ |
|
84 TInt AttendedTransfer( const TDesC& aTransferTarget ); |
|
85 |
|
86 /** |
|
87 * Unattended transfer. Call is requested to be transferred to given address. |
|
88 * After MCCPTransferObserver::ECCPRemoteTransferring event current call will be |
|
89 * disconnected and no transfer status is checked from the operation. |
|
90 * Actual request result indication comes via observer classes |
|
91 * @since S60 3.2 |
|
92 * @param aTransferTarget Address of the target |
|
93 * @return KErrNone if request was started succesfully. |
|
94 * @return KErrNotReady if call is not in connected or on-hold state. |
|
95 * @return KErrArgument transfer address was illegal. |
|
96 * @pre Call state is MCCPCallObserver::ECCPStateConnected or MCCPCallObserver::ECCPStateHold |
|
97 */ |
|
98 TInt UnattendedTransfer( const TDesC& aTransferTarget ); |
|
99 |
|
100 /** |
|
101 * Accept incoming call transfer request from the call remote party. |
|
102 * Actual request result indication comes via observer class |
|
103 * @since Series 60 3.2 |
|
104 * @param aAccept ETrue - accept transfer, EFalse do not accept transfer request. |
|
105 * @return KErrNone if request was started succesfully. |
|
106 * @return KErrNotReady if call is not in connected or on-hold state. |
|
107 * @return KErrArgument transfer address was illegal. |
|
108 * @pre Call state is MCCPCallObserver::ECCPStateConnected or MCCPCallObserver::ECCPStateHold |
|
109 * @pre MCCPObserver::CallCreated is called with the newly created call |
|
110 */ |
|
111 TInt AcceptTransfer( const TBool aAccept ); |
|
112 |
|
113 /** |
|
114 * When the other end of the call has requested call transfer to third party it is notified to |
|
115 * MCCPTransferObserver::TransferEventOccurred(MCCPTransferObserver::ECCPRemoteTransferring). |
|
116 * The new recipient of the call can be fetched via this method. |
|
117 * @since Series 60 3.2 |
|
118 * @param none |
|
119 * @return new recipient for the call after transfer |
|
120 * @return KNullDesC if no transfer target is available |
|
121 * @pre Call state is MCCPCallObserver::ECCPStateConnected or MCCPCallObserver::ECCPStateHold |
|
122 * @pre MCCPObserver::CallCreated is called with the newly created call |
|
123 */ |
|
124 const TDesC& TransferTarget() const; |
|
125 |
|
126 /** |
|
127 * Add an observer for transfer related events. |
|
128 * Currently CCE will set only one observer. |
|
129 * @since S60 v3.2 |
|
130 * @param aObserver Observer to add. |
|
131 * @return none |
|
132 * @leave system error if observer adding fails |
|
133 */ |
|
134 void AddObserverL( const MCCPTransferObserver& aObserver ); |
|
135 |
|
136 /** |
|
137 * Remove an observer. |
|
138 * @since S60 v3.2 |
|
139 * @param aObserver Observer to remove. |
|
140 * @return KErrNone if removed succesfully. |
|
141 * @return KErrNotFound if observer was not found. |
|
142 */ |
|
143 TInt RemoveObserver( const MCCPTransferObserver& aObserver ); |
|
144 |
|
145 void TransferEventOccurred( |
|
146 const MCCPTransferObserver::TCCPTransferEvent aEvent ); |
|
147 |
|
148 void UpdateL(); |
|
149 private: |
|
150 |
|
151 /** |
|
152 * C++ constructor |
|
153 * @param aObserver Reference to DTMF observer |
|
154 * @param aDirector Reference to Director |
|
155 */ |
|
156 CVccTransferProvider( CVccPerformer* aCall ); |
|
157 |
|
158 /** |
|
159 * Symbian second-phase constructor |
|
160 * @param aProviders Reference to array of the Service Providers |
|
161 */ |
|
162 void ConstructL( ); |
|
163 |
|
164 private: // data |
|
165 |
|
166 /** |
|
167 * DTMF event observers. |
|
168 * Own. |
|
169 */ |
|
170 RPointerArray<MCCPTransferObserver> iObservers; |
|
171 CVccPerformer* iPerfCall; |
|
172 MCCPTransferProvider* iCallTransferProvider; |
|
173 }; |
|
174 |
|
175 #endif // CVCCTRANSFERPROVIDER_H |