|
1 /* |
|
2 * Copyright (c) 2002 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: Interface to make single item fetches. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPHCNTSINGLEITEMFETCH_H |
|
20 #define CPHCNTSINGLEITEMFETCH_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <cntdef.h> |
|
25 #include <mphcntmatch.h> |
|
26 |
|
27 class MVPbkContactLink; |
|
28 class CPhCntContactId; |
|
29 |
|
30 class CPhCntSelection : public CBase |
|
31 { |
|
32 public: |
|
33 |
|
34 /** |
|
35 * @since s60 v3.2 |
|
36 * @return Number selected by user. |
|
37 */ |
|
38 virtual const TDesC& Number() const = 0; |
|
39 |
|
40 /** |
|
41 * @since s60 v3.2 |
|
42 * @return Contact identifier. Identifies the contact |
|
43 * where user selected the number. |
|
44 */ |
|
45 virtual const CPhCntContactId& ContactId() const = 0; |
|
46 |
|
47 }; |
|
48 |
|
49 // CLASS DECLARATION |
|
50 |
|
51 /** |
|
52 * It provides interface to make phone app single item fetches. |
|
53 * |
|
54 * @lib PhoneCntFinder |
|
55 * @since 1.0 |
|
56 */ |
|
57 class CPhCntSingleItemFetch |
|
58 : public CBase |
|
59 { |
|
60 public: // New functions |
|
61 |
|
62 /** |
|
63 * It enumerates different types of fetches. |
|
64 * |
|
65 * EFetchDtmf - fetch from dtmf |
|
66 * EFetchNewCall - fetch from new call query |
|
67 * EFetchNewPSCall - fetch from new PS call query |
|
68 */ |
|
69 enum TFetchType |
|
70 { |
|
71 EFetchDtmf, |
|
72 EFetchNewCall, |
|
73 EFetchNewPSCall |
|
74 }; |
|
75 |
|
76 /** |
|
77 * Phone number filtering for the FetchPhoneNumberLD implementation |
|
78 * |
|
79 * ECallPhoneNumber - CS |
|
80 * ECallVoip, - PS |
|
81 * ECallVideoNumber, - Video |
|
82 */ |
|
83 enum TCallType |
|
84 { |
|
85 ECallPhoneNumber, |
|
86 ECallVoip, |
|
87 ECallVideoNumber |
|
88 }; |
|
89 |
|
90 /** |
|
91 * It defines structure for result. |
|
92 */ |
|
93 struct TFetchParams |
|
94 { |
|
95 public: // In |
|
96 |
|
97 // Fetch type. |
|
98 TFetchType iType; |
|
99 |
|
100 // Resource for softkeys. |
|
101 TInt iCbaResource; |
|
102 |
|
103 public: |
|
104 |
|
105 // Buffer for string. |
|
106 TDes* iString; |
|
107 |
|
108 MPhCntMatch::TNumberType iNumberType; |
|
109 |
|
110 CPhCntContactId* iContactId; |
|
111 }; |
|
112 |
|
113 /** |
|
114 * Perform fetch. |
|
115 * |
|
116 * Destroyes itself always after fetch. In successful case, target |
|
117 * descriptor will contain result. Otherwise it must be considered |
|
118 * undefined. |
|
119 * |
|
120 * You can also cancel request by destroying the instance. |
|
121 * |
|
122 * @param aParams it contains parameters. |
|
123 * @return error code, |
|
124 * KErrNone iff fetch succeeded, |
|
125 * KErrCancel iff fetch was cancelled, |
|
126 * KErrGeneral iff result was invalid, |
|
127 * KErrOverflow iff result was too long |
|
128 * |
|
129 * If method returns error, then contents of aResult are undefined. |
|
130 */ |
|
131 virtual TInt FetchLD( |
|
132 TFetchParams& aParams ) = 0; |
|
133 |
|
134 /** |
|
135 * Performs a fetch. |
|
136 * |
|
137 * A contact link is used for fetching and as a search result |
|
138 * a phone number is returned. |
|
139 * |
|
140 * Destroyes itself always after fetch. In successful case, target |
|
141 * descriptor will contain result. Otherwise it must be considered |
|
142 * undefined. |
|
143 * |
|
144 * You can also cancel request by destroying the instance. |
|
145 * |
|
146 * @param aContactLink Contact link. |
|
147 * @param aCallType Number type. |
|
148 * @param aNumber Found phone number. Needs to be NULL before the call. |
|
149 * @param aFieldLink Field link to user selected number. Needs to be NULL, before the call. |
|
150 * @return error code, |
|
151 * KErrNone iff fetch succeeded, |
|
152 * KErrCancel iff fetch was cancelled, |
|
153 * KErrGeneral iff result was invalid, |
|
154 * KErrOverflow iff result was too long |
|
155 * |
|
156 * If method returns error, then contents of aResult are undefined. |
|
157 */ |
|
158 virtual TInt FetchPhoneNumberLD( |
|
159 const TDesC8& aContactLink, |
|
160 const CPhCntSingleItemFetch::TCallType aCallType, |
|
161 HBufC*& aNumber, |
|
162 HBufC8*& aFieldLink ) = 0; |
|
163 |
|
164 /** |
|
165 * Shows dialog for user to select a phone number for other |
|
166 * purposes than making a call. The left softkey is 'Select'. |
|
167 * |
|
168 * Request can be canceled by deleting instance of this class. |
|
169 * |
|
170 * @leave System wide error code |
|
171 * |
|
172 * @since S60 3.2 |
|
173 * @returns The selection made by user. Ownership is transferred to |
|
174 * caller. Note that the selection may be NULL, if user canceled the |
|
175 * the dialog. |
|
176 */ |
|
177 virtual CPhCntSelection* SelectPhoneNumberLD() = 0; |
|
178 |
|
179 }; |
|
180 |
|
181 #endif // CPHCNTSINGLEITEMFETCH_H |
|
182 |
|
183 // End of File |