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