|
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: |
|
15 * Phonenumber matching wrapper for contact model MatchPhoneNumberL |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __Logs_Engine_CPhoneNumberMatcher_H__ |
|
22 #define __Logs_Engine_CPhoneNumberMatcher_H__ |
|
23 |
|
24 #include <e32base.h> |
|
25 |
|
26 // DATA TYPES |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CContactMatcher; |
|
30 class CContactIdArray; |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 class CPhoneNumberMatcher : public CBase |
|
35 |
|
36 { |
|
37 public: // Constructors. |
|
38 /** |
|
39 * Standard creation function. Creates and returns a new object of this |
|
40 * class. |
|
41 * |
|
42 * @return Pointer to the new instance of this class. |
|
43 */ |
|
44 IMPORT_C static CPhoneNumberMatcher* NewL( |
|
45 RFs& aFsSession ); |
|
46 |
|
47 /** |
|
48 * Destructor. |
|
49 */ |
|
50 IMPORT_C ~CPhoneNumberMatcher(); |
|
51 |
|
52 |
|
53 private: |
|
54 /** |
|
55 * Constructor, second phase. |
|
56 */ |
|
57 void ConstructL( RFs& aFsSession ); |
|
58 |
|
59 /** |
|
60 * Constructor |
|
61 * |
|
62 */ |
|
63 CPhoneNumberMatcher(); |
|
64 |
|
65 public: |
|
66 /** |
|
67 * Match count, Series 60 specific matching rules. |
|
68 * |
|
69 * @return count of matches or KErrNone if number size is 0. |
|
70 */ |
|
71 IMPORT_C TInt MatchCountL( const TDesC& aNumber ); |
|
72 |
|
73 /** |
|
74 * Get unique match from the phonebook if MatchCountL returned 1 |
|
75 * |
|
76 * @return result name or null string. |
|
77 */ |
|
78 IMPORT_C TPtrC GetUniqueName(); |
|
79 |
|
80 /** |
|
81 * Field id of unique contact. |
|
82 * |
|
83 * @return field id of matched contact field or KErrNotFound |
|
84 */ |
|
85 IMPORT_C TInt GetFieldId(); |
|
86 |
|
87 /** |
|
88 * Contact id of found contact |
|
89 * |
|
90 * @aContactId set value if unique contact id is found. |
|
91 * @return KErrNone if match found or KErrNotFound. |
|
92 */ |
|
93 IMPORT_C TInt GetContactId(TContactItemId& aContactId); |
|
94 |
|
95 |
|
96 /** |
|
97 * Uses async function from CContactMatcher to open match stores. |
|
98 */ |
|
99 void OpenDefaultMatchStoresL( TRequestStatus& aStatus ); |
|
100 |
|
101 /** |
|
102 * Cancel operation |
|
103 */ |
|
104 void CancelOperation(); |
|
105 |
|
106 private: // data |
|
107 |
|
108 /// |
|
109 CContactMatcher* iContactMatcher; |
|
110 |
|
111 /// The amount of digits to be used in contact matching |
|
112 TInt iMatchDigitCount; |
|
113 |
|
114 /// Own: Name used in DB update |
|
115 HBufC* iName; |
|
116 |
|
117 /// Own: Contact field id |
|
118 TInt iFieldId; |
|
119 |
|
120 /// Own: contact id |
|
121 TContactItemId iContactId; |
|
122 }; |
|
123 |
|
124 #endif // __Logs_Engine_CPhoneNumberMatcher_H__ |
|
125 |
|
126 // End of File |