|
1 // Copyright (c) 2004-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 #include <cntview.h> //mcontactviewobserver |
|
17 #include "t_utils2.h" //CRandomContactGenerator |
|
18 |
|
19 |
|
20 class CFilterFindContactsTestConductor : public CBase |
|
21 { |
|
22 public: |
|
23 static CFilterFindContactsTestConductor* NewL(); |
|
24 ~CFilterFindContactsTestConductor(); |
|
25 void RunTestsL(); |
|
26 |
|
27 private: |
|
28 CFilterFindContactsTestConductor(); |
|
29 void ConstructL(); |
|
30 void AddSomeContactsL(TInt aCount); |
|
31 |
|
32 private: |
|
33 CContactDatabase* iDb; |
|
34 CRandomContactGenerator* iRandomGenerator; |
|
35 }; |
|
36 |
|
37 |
|
38 class CFilterFindContactsTester : public CActive, public MContactViewObserver |
|
39 { |
|
40 public: |
|
41 static CFilterFindContactsTester* NewL(CContactDatabase& iDb); |
|
42 ~CFilterFindContactsTester(); |
|
43 private: |
|
44 CFilterFindContactsTester(CContactDatabase& iDb); |
|
45 void ConstructL(); |
|
46 void NextTest(); |
|
47 void DisplayL(); |
|
48 void AddEntryL(); |
|
49 |
|
50 private: // From MContactViewObserver. |
|
51 virtual void HandleContactViewEvent(const CContactViewBase& aView,const TContactViewEvent& aEvent); |
|
52 |
|
53 private:// From CActive |
|
54 virtual void RunL(); |
|
55 TInt RunError(TInt aError); |
|
56 virtual void DoCancel(); |
|
57 |
|
58 |
|
59 enum TTestNumber |
|
60 { |
|
61 EInit, |
|
62 ECreateLocalView, |
|
63 ECheckAddContactEntry, |
|
64 ECreateFindView, |
|
65 EFindAddContacts, |
|
66 EModifyUnsortableContact, |
|
67 EFindRemoveContacts, |
|
68 ECheckCorrectSeparators, |
|
69 ETestsComplete |
|
70 }; |
|
71 |
|
72 |
|
73 TInt iCurrentTest; |
|
74 TBool iAddedFindContacts; |
|
75 TContactItemId iFindAdd1; |
|
76 TContactItemId iFindAdd2; |
|
77 CContactDatabase& iDb; |
|
78 TContactItemId iContactId; |
|
79 RContactViewSortOrder iSortOrder; |
|
80 CContactLocalView* iLocalView; |
|
81 CContactFindView* iFindView; |
|
82 CPtrCArray* iFindDesArray; |
|
83 |
|
84 }; |
|
85 |