|
1 /* |
|
2 * Copyright (c) 2006 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: Calls voice call or VoIP call to either of addresses provided. |
|
15 * CMuiuContactService IS NOT YET READY. IMPLEMENTATION IS MISSING. DO NOT USE. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef MUIUCONTACTSERVICE_H |
|
21 #define MUIUCONTACTSERVICE_H |
|
22 |
|
23 #include <e32base.h> // CBase |
|
24 #include "MuiuMsvUiServiceUtilitiesInternal.h" |
|
25 |
|
26 class CMuiuContactAddressMatcher; |
|
27 class CMsgVoIPExtension; |
|
28 class CEikonEnv; |
|
29 class CItemFinder; |
|
30 /** |
|
31 * VoIP call: |
|
32 * Calls voice call or VoIP call to either of addresses provided. |
|
33 * VoIP call is performed, if VoIP is preferred call method |
|
34 * and VoIP profiles exists. |
|
35 * VoIP call is possible to perform using either phone number or email address. |
|
36 * |
|
37 * Voice call: If VoIP is not possible... |
|
38 * ...and phone number is supplied, voice call is performed. |
|
39 * ...and email address is supplied, email address |
|
40 * is used to search for contact. The API searches for first contact mathing |
|
41 * the address. Other contacts are ignored. If contact has several addresses |
|
42 * (phone numbers), AIW is used to let user select address, which will be used. |
|
43 * |
|
44 * If contact with phone number could not be found matching the supplied |
|
45 * emails address, nothing takes place. |
|
46 * |
|
47 * @lib muiu_internal.lib |
|
48 * @since S60 v3.2 |
|
49 */ |
|
50 |
|
51 class CMuiuContactService : public CBase |
|
52 { |
|
53 public: |
|
54 enum TMuiuPreferredCallType |
|
55 { |
|
56 EMuiuCallTypeNone = 0, |
|
57 EMuiuCallTypeVoice, |
|
58 EMuiuCallTypeVoip |
|
59 }; |
|
60 |
|
61 public: |
|
62 |
|
63 /** |
|
64 * NewL |
|
65 * @param aVoipExtension |
|
66 * @return self |
|
67 * @since S60 v3.2 |
|
68 */ |
|
69 IMPORT_C static CMuiuContactService* NewL( |
|
70 CEikonEnv& aEnv, |
|
71 CMsgVoIPExtension* aVoipExtension = NULL ); |
|
72 |
|
73 /// Destructor |
|
74 IMPORT_C virtual ~CMuiuContactService(); |
|
75 |
|
76 /** |
|
77 * Returns information whether VOIP calls are supported in this build/device. |
|
78 * @return ETrue: supported. EFalse: not supported |
|
79 * @since S60 v3.2 |
|
80 */ |
|
81 IMPORT_C TBool IsVoipSupported() const; |
|
82 |
|
83 /** |
|
84 * Returns preferred call type to be tried. Function can be called |
|
85 * immediately after construction. |
|
86 * @return Preferred call type |
|
87 * @since S60 v3.2 |
|
88 */ |
|
89 IMPORT_C TMuiuPreferredCallType PreferredCallTypeL() const; |
|
90 |
|
91 /** |
|
92 * Sets primary (usually sender) address. |
|
93 * Setting address resets earlier found address and name. |
|
94 * @param aAddress primary address |
|
95 * @since S60 v3.2 |
|
96 */ |
|
97 IMPORT_C void SetAddress( const TDesC& aAddress ); |
|
98 |
|
99 /** |
|
100 * Sets contact name of primary address, if known. |
|
101 * Setting alias resets earlier found address and name. |
|
102 * @param aAddress primary address |
|
103 * @since S60 v3.2 |
|
104 */ |
|
105 IMPORT_C void SetName( const TDesC& aName ); |
|
106 |
|
107 /** |
|
108 * Calls to primary address. Operation is synchronous. Secondary address is not |
|
109 * searched from phonebook. Function call resets previous results. |
|
110 * Earlier found address and alias are utilised, it they are still available. |
|
111 * @return ETrue: if contact was searched from phonebook. |
|
112 * @since S60 v3.2 |
|
113 */ |
|
114 IMPORT_C TBool CallL( ); |
|
115 |
|
116 /** |
|
117 * Call to primary or secondary address. Secondary address is preferred to primary |
|
118 * address, if it exists. Operation is synchronous. Secondary address is not |
|
119 * searched from phonebook. |
|
120 * @param aSecondaryAddress secondary address. |
|
121 * @return ETrue: if contact was searched from phonebook. |
|
122 * @since S60 v3.2 |
|
123 */ |
|
124 IMPORT_C TBool CallL( const TDesC& aSecondaryAddress ); |
|
125 |
|
126 /** |
|
127 * Call to primary or secondary address. Secondary address is preferred to primary |
|
128 * address, if it exists. Operation is synchronous. Secondary address is not searched |
|
129 * from phonebook. |
|
130 * @param aSecondaryItem Function retrieves current item from CItemFinder and uses |
|
131 * its address. |
|
132 * @return ETrue: if primary address was searched from phonebook. |
|
133 * @since S60 v3.2 |
|
134 */ |
|
135 IMPORT_C TBool CallL( CItemFinder* aSecondaryItem ); |
|
136 |
|
137 /** |
|
138 * Method returns information whether contact with phone number was found. |
|
139 * @return ETrue: contact found. Otherwise not found or search into |
|
140 * phonebook was not even done. |
|
141 * @since S60 v3.2 |
|
142 */ |
|
143 IMPORT_C TBool IsContactFound() const; |
|
144 |
|
145 /** |
|
146 * If contact search was successful, method to read phone number of matched contact. |
|
147 * Returns NULL if contact was not found or contact had not phone number |
|
148 * @return match result, ownership is transferred to caller. |
|
149 * @since S60 v3.2 |
|
150 */ |
|
151 IMPORT_C TPtrC FoundContactAddressL() const; |
|
152 |
|
153 /** |
|
154 * If contact search was successful, method to read phone number of matched contact. |
|
155 * Returns NULL if contact was not found or contact had not phone number |
|
156 * @return match name, ownership is transferred to caller |
|
157 * @since S60 v3.2 |
|
158 */ |
|
159 IMPORT_C TPtrC FoundContactNameL() const; |
|
160 |
|
161 private: // implementation |
|
162 |
|
163 // Callback function of TCallback |
|
164 static TInt MatchDone( TAny* aCallService ); |
|
165 |
|
166 private: |
|
167 |
|
168 CMuiuContactService( CEikonEnv& aEnv , |
|
169 CMsgVoIPExtension* aVoipExtension ); |
|
170 |
|
171 void ConstructL(); |
|
172 |
|
173 private: // data |
|
174 |
|
175 TPtrC iPrimaryAddress; |
|
176 TPtrC iPrimaryName; |
|
177 TPtrC iSecondaryAddress; |
|
178 |
|
179 CEikonEnv& iEikEnv; |
|
180 |
|
181 /// Management of VoIP data |
|
182 CMsgVoIPExtension* iVoipExtension; |
|
183 |
|
184 CMuiuContactAddressMatcher* iContactAddressMatcher; |
|
185 HBufC* iMatchAddress; |
|
186 HBufC* iMatchName; |
|
187 CActiveSchedulerWait iWait; |
|
188 }; |
|
189 |
|
190 #endif // MUIUCONTACTSERVICE_H |