|
1 /* |
|
2 * Copyright (c) 2009 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 * |
|
16 */ |
|
17 |
|
18 #ifndef CPHCNTMATCHERIMPL_H |
|
19 #define CPHCNTMATCHERIMPL_H |
|
20 |
|
21 // INCLUDES |
|
22 #include "cphcntmatcher.h" |
|
23 #include <centralrepository.h> |
|
24 #include <cenrepnotifyhandler.h> |
|
25 #include <qmobilityglobal.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CPhCntContactId; |
|
29 class CPhCntMatch2; |
|
30 |
|
31 QTM_BEGIN_NAMESPACE |
|
32 class QContactManager; |
|
33 QTM_END_NAMESPACE |
|
34 QTM_USE_NAMESPACE |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 |
|
39 /** |
|
40 * Implementation for making matches. |
|
41 * |
|
42 * @lib PhoneCntFinder |
|
43 * @since 1.0 |
|
44 */ |
|
45 NONSHARABLE_CLASS( CPhCntMatcherImpl2 ) : |
|
46 public CPhCntMatcher |
|
47 { |
|
48 public: // Constructors and destructor |
|
49 |
|
50 /** |
|
51 * Two-phased constructor. |
|
52 * @pre aContactManager != NULL |
|
53 * @param aContactManager provides matching services. Ownership is transferred. |
|
54 * @return New instance |
|
55 */ |
|
56 static CPhCntMatcherImpl2* NewL(QContactManager* aContactManager); |
|
57 |
|
58 /** |
|
59 * Destructor. |
|
60 */ |
|
61 virtual ~CPhCntMatcherImpl2(); |
|
62 |
|
63 |
|
64 public: // Functions from base classes |
|
65 |
|
66 /** |
|
67 * From CPhCntMatcher |
|
68 */ |
|
69 TInt MatchNumber( MPhCntMatch*& aMatch,const TDesC& aTelNumber ); |
|
70 |
|
71 /** |
|
72 * From CPhCntMatcher |
|
73 */ |
|
74 TInt MatchNumber( |
|
75 MPhCntMatch*& aMatch, |
|
76 const TDesC& aTelNumber, |
|
77 const CPhCntContactId& aContactId ); |
|
78 |
|
79 /** |
|
80 * From CPhCntMatcher |
|
81 */ |
|
82 TInt MatchNumber( |
|
83 MPhCntMatch*& aMatch, |
|
84 const TDesC& aTelNumber, |
|
85 const CPhCntContactId& aContactId, |
|
86 const TFieldId aFieldId ); |
|
87 |
|
88 |
|
89 /** |
|
90 * Match number to phonebook. |
|
91 * @param aMatch Found match, owership tranferred. NULL if not found any. |
|
92 * @param aNumber Number to match against. |
|
93 * @return Error code: KErrNone - one match found |
|
94 * KErrNotFound - no matches found |
|
95 * other - normal Symbian OS error |
|
96 */ |
|
97 TInt MatchVoipNumber( |
|
98 MPhCntMatch*& aMatch, |
|
99 const TDesC& aNumber, |
|
100 TBool aAllowUserNameMatch, |
|
101 TInt aCharsForMatching = 0 ); |
|
102 |
|
103 /** |
|
104 * From CPhCntMatcher, gets VoIP call contact info from phonebook |
|
105 * by contact id. |
|
106 * @since Series60 3.0 |
|
107 * @param aMatch for found match, owership tranferred. Empty if not found. |
|
108 * @param aContactId for current contact. |
|
109 * @return Error code: KErrNone - VoIP call contact found |
|
110 * KErrNotFound - no VoIP call contact found |
|
111 * other - normal Symbian OS error |
|
112 */ |
|
113 TInt MatchVoipNumber( |
|
114 MPhCntMatch*& aMatch, |
|
115 const CPhCntContactId& aContactId ); |
|
116 |
|
117 /** |
|
118 * Determines if contact has other type of numbers |
|
119 * than VoIP numbers. |
|
120 * |
|
121 * @since S60 v3.2. |
|
122 * @param aContactId Id of the contact. |
|
123 * @return ETrue - CS numbers found from contact. |
|
124 * EFalse - No CS numbers found from contact. |
|
125 */ |
|
126 virtual TBool HasCSNumbers( |
|
127 const CPhCntContactId& aContactId ); |
|
128 |
|
129 /** |
|
130 * @see CPhCntMatcher::MatchNumber |
|
131 */ |
|
132 TInt MatchNumber( |
|
133 MPhCntMatch*& aMatch, |
|
134 const TDesC& aTelNumber, |
|
135 TInt aContactId ); |
|
136 |
|
137 |
|
138 private: |
|
139 |
|
140 /** |
|
141 * C++ constructor. |
|
142 */ |
|
143 CPhCntMatcherImpl2(QContactManager* aContactManager); |
|
144 |
|
145 /** |
|
146 * By default Symbian OS constructor is private. |
|
147 */ |
|
148 void ConstructL(); |
|
149 |
|
150 |
|
151 private: |
|
152 CPhCntMatch2* iMatch; //only one now, must delete anyway. |
|
153 QContactManager* iContactManager; |
|
154 |
|
155 |
|
156 }; |
|
157 |
|
158 #endif // CPHCNTMATCHERIMPL_H |
|
159 |
|
160 // End of File |