25
|
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: Abstract class for making matches.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef CPHCNTMATCHER_H
|
|
20 |
#define CPHCNTMATCHER_H
|
|
21 |
|
|
22 |
// INCLUDES
|
|
23 |
#include <e32base.h>
|
|
24 |
#include <cntdef.h> // TContactItemId
|
|
25 |
#include <badesca.h>
|
|
26 |
#include <cphcntsingleitemfetch.h>
|
|
27 |
// CONSTANTS
|
|
28 |
const TInt KPhCntInvalidFieldId = KErrNotFound;
|
|
29 |
|
|
30 |
// DATA TYPES
|
|
31 |
typedef TInt TFieldId;
|
|
32 |
|
|
33 |
// FORWARD DECLARATIONS
|
|
34 |
class MPhCntMatch;
|
|
35 |
class CGulIcon;
|
|
36 |
class MVPbkContactLink;
|
|
37 |
|
|
38 |
// CLASS DECLARATION
|
|
39 |
|
|
40 |
/**
|
|
41 |
* Abstract class for making matches.
|
|
42 |
*
|
|
43 |
* @lib PhoneCntFinder
|
|
44 |
* @since 1.0
|
|
45 |
*/
|
|
46 |
class CPhCntMatcher
|
|
47 |
: public CBase
|
|
48 |
{
|
|
49 |
public: // Constructors and destructor
|
|
50 |
|
|
51 |
/**
|
|
52 |
* Match number to phonebook.
|
|
53 |
* @param aMatch Found match, owership tranferred. NULL if not found any.
|
|
54 |
* @param aTelNumber Number to match against.
|
|
55 |
* @return Error code: KErrNone - one match found
|
|
56 |
* KErrNotFound - no matches found
|
|
57 |
* KErrNotFound - several matches -> no match
|
|
58 |
* KErrUnderflow - Number too short for matching
|
|
59 |
* KErrAccessDenied - Can't get phonebook instance
|
|
60 |
* other - normal Symbian OS error
|
|
61 |
*/
|
|
62 |
virtual TInt MatchNumber(
|
|
63 |
MPhCntMatch*& aMatch,
|
|
64 |
const TDesC& aTelNumber ) = 0;
|
|
65 |
|
|
66 |
/**
|
|
67 |
* Match number to phonebook.
|
|
68 |
* @param aMatch Found match, owership tranferred. NULL if not found any.
|
|
69 |
* @param aTelNumber Number to match against.
|
|
70 |
* @param aContactId Current contact.
|
|
71 |
* @return Error code: KErrNone - one match found
|
|
72 |
* KErrNotFound - no matches found
|
|
73 |
* KErrAlreadyExists - several matches -> no match
|
|
74 |
* KErrUnderflow - Number too short for matching
|
|
75 |
* KErrAccessDenied - Can't get phonebook instance
|
|
76 |
* other - normal Symbian OS error
|
|
77 |
*/
|
|
78 |
virtual TInt MatchNumber(
|
|
79 |
MPhCntMatch*& aMatch,
|
|
80 |
const TDesC& aTelNumber,
|
|
81 |
const CPhCntContactId& aContactLink ) = 0;
|
|
82 |
|
|
83 |
/**
|
|
84 |
* Match number to phonebook.
|
|
85 |
* @param aMatch Found match, owership tranferred. NULL if not found any.
|
|
86 |
* @param aTelNumber Number to match against.
|
|
87 |
* @param aContactId Current contact.
|
|
88 |
* @param aFieldId Current field id (index from CnmModel);
|
|
89 |
* @return Error code: KErrNone - one match found
|
|
90 |
* KErrNotFound - no matches found
|
|
91 |
* KErrAlreadyExists - several matches -> no match
|
|
92 |
* KErrUnderflow - Number too short for matching
|
|
93 |
* KErrAccessDenied - Can't get phonebook instance
|
|
94 |
* other - normal Symbian OS error
|
|
95 |
*/
|
|
96 |
virtual TInt MatchNumber(
|
|
97 |
MPhCntMatch*& aMatch,
|
|
98 |
const TDesC& aTelNumber,
|
|
99 |
const CPhCntContactId& aContactId,
|
|
100 |
MPhCntMatch::TNumberType aNumberType ) = 0;
|
|
101 |
|
|
102 |
/**
|
|
103 |
* Match number to phonebook.
|
|
104 |
* @param aMatch Found match, owership tranferred. NULL if not found any.
|
|
105 |
* @param aMatchString Number to match against.
|
|
106 |
* @param aAllowUsernameMatch
|
|
107 |
* is ETrue if username is sufficient for match.
|
|
108 |
* @param aContactStoreUris
|
|
109 |
* Pointer to array containing store uris
|
|
110 |
* @param aCharsForMatching Length of string to be used in matching.
|
|
111 |
* Starts from the end of VoIP number. Domain part
|
|
112 |
* not included for matching.
|
|
113 |
* @return Error code: KErrNone - one match found
|
|
114 |
* KErrNotFound - no matches found
|
|
115 |
* other - normal Symbian OS error
|
|
116 |
*/
|
|
117 |
virtual TInt MatchVoipNumber(
|
|
118 |
MPhCntMatch*& aMatch,
|
|
119 |
const TDesC& aMatchString,
|
|
120 |
const TBool aAllowUsernameMatch,
|
|
121 |
MDesCArray* aContactStoreUris,
|
|
122 |
TInt aCharsForMatching = 0 ) = 0;
|
|
123 |
|
|
124 |
/**
|
|
125 |
* Gets VoIP call contact info from phonebook
|
|
126 |
* by contact id.
|
|
127 |
* @since Series60 3.0
|
|
128 |
* @param aMatch for found match, owership tranferred. Empty if not found.
|
|
129 |
* @param aMatchString Number to match against.
|
|
130 |
* @param aContactId for current contact.
|
|
131 |
* @return Error code: KErrNone - VoIP call contact found
|
|
132 |
* KErrNotFound - no VoIP call contact found
|
|
133 |
* other - normal Symbian OS error
|
|
134 |
*/
|
|
135 |
virtual TInt MatchVoipNumber(
|
|
136 |
MPhCntMatch*& aMatch,
|
|
137 |
const TDesC& aMatchString,
|
|
138 |
const CPhCntContactId& aContactId ) = 0;
|
|
139 |
|
|
140 |
/**
|
|
141 |
* Determines if contact has other type of numbers
|
|
142 |
* than VoIP numbers.
|
|
143 |
*
|
|
144 |
* @since S60 v3.2.
|
|
145 |
* @param aContactId Id of the contact.
|
|
146 |
* @return ETrue - CS numbers found from contact.
|
|
147 |
* EFalse - No CS numbers found from contact.
|
|
148 |
*/
|
|
149 |
virtual TBool HasCSNumbers(
|
|
150 |
const CPhCntContactId& aContactId ) = 0;
|
|
151 |
|
|
152 |
};
|
|
153 |
|
|
154 |
#endif // CPHCNTMATCHER_H
|
|
155 |
|
|
156 |
// End of File
|