|
1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @SYMTestCaseID INC049017 |
|
18 @SYMTestType CT |
|
19 @SYMTestPriority High |
|
20 @SYMDEF INC049017 |
|
21 @SYMTestCaseDependencies cnttutil |
|
22 @SYMTestCaseDesc Tests that Identity fields are searched when FindAsyncL and FindLC are used with KUidContactFieldMatchAll. |
|
23 @SYMTestActions Create a contact database and add four contacts. |
|
24 Search the database by using identity fields: GivenName, FamilyName and CompanyName. |
|
25 Search for contacts by providing a name and using KUidContactFieldMatchAll. |
|
26 Perform the search synchronously and asynchronously. |
|
27 @SYMTestExpectedResults Contacts are found by given name, family name or company name when using KUidContactFieldMatchAll. |
|
28 */ |
|
29 |
|
30 // |
|
31 //CFindTest |
|
32 // |
|
33 |
|
34 class CFindTest : public CBase, public MIdleFindObserver |
|
35 { |
|
36 public: |
|
37 CFindTest(); |
|
38 ~CFindTest(); |
|
39 void ConstructL(); |
|
40 void DoTestsL(); |
|
41 private: // From MIdleFindObserver. |
|
42 void IdleFindCallback(); |
|
43 private: |
|
44 void AddContactL(const TDesC& aFirstName,const TDesC& aLastName,const TDesC& aCompanyName,const TDesC& aWorkPhone,const TDesC& aHomePhone,const TDesC& aWorkMobile,const TDesC& aHomeMobile,const TDesC& aEmail); |
|
45 void AddContactCompactL(const TDesC& aFirstName,const TDesC& aLastName,const TDesC& aCompanyName,const TDesC& aWorkPhone,const TDesC& aHomePhone,const TDesC& aWorkMobile,const TDesC& aHomeMobile,const TDesC& aEmail); |
|
46 void FindPhoneNumberL(const TDesC& aTextToFind, const TInt aNumExpectedFinds,TBool aAsync=EFalse); |
|
47 void FindEmailAddressL(const TDesC& aTextToFind, const TInt aNumExpectedFinds,TBool aAsync=EFalse); |
|
48 void FindNameInFirstNameFieldL(const TDesC& aTextToFind, const TInt aNumExpectedFinds,TBool aAsync=EFalse); |
|
49 void FindNameInLastNameFieldL(const TDesC& aTextToFind, const TInt aNumExpectedFinds,TBool aAsync=EFalse); |
|
50 void FindInCompanyFieldL(const TDesC& aTextToFind, const TInt aNumExpectedFinds,TBool aAsync=EFalse); |
|
51 void FindInSipAddressL(const TDesC& aTextToFind, const TInt aNumExpectedFinds,TBool aAsync=EFalse); |
|
52 void FindInAllFieldsL(const TDesC& aTextToFind, const TInt aNumExpectedFinds,TBool aAsync=EFalse); |
|
53 void FindNotesL(const TDesC& aTextToFind, const TInt aNumExpectedFinds,TBool aAsync=EFalse); |
|
54 void DoFindL(const TDesC& aTextToFind,const CContactItemFieldDef& aFieldDef, const TInt aNumExpectedFinds); |
|
55 void DoFindAsyncL(const TDesC& aTextToFind,const CContactItemFieldDef& aFieldDef, const TInt aNumExpectedFinds); |
|
56 private: |
|
57 RTest iTest; |
|
58 TFileName iLogFileName; |
|
59 TFileName iDbFileName; |
|
60 CLog* iLog; |
|
61 CContactDatabase* iDb; |
|
62 CIdleFinder* iIdleFinder; |
|
63 CContactTemplate* iTemplate; |
|
64 }; |
|
65 |