|
1 /** |
|
2 * Copyright (c) 2007-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 |
|
19 |
|
20 #ifndef __TEST_CONTACTVIEW_DATABASE_UTILITIES_H__ |
|
21 #define __TEST_CONTACTVIEW_DATABASE_UTILITIES_H__ |
|
22 |
|
23 // System Includes |
|
24 #include <test/testexecutestepbase.h> |
|
25 #include <cntdb.h> |
|
26 #include <cntitem.h> |
|
27 #include <cntviewbase.h> |
|
28 #include <cntfldst.h> |
|
29 #include <cntfilt.h> |
|
30 #include <e32math.h> |
|
31 #include <coreappstest/testserver.h> |
|
32 |
|
33 // User Includes |
|
34 #include "ContactUtilitiesCollection.h" |
|
35 #include "ClientServer.h" |
|
36 |
|
37 // Literals used |
|
38 _LIT(KTestContactViewDatabaseUtilitiesStep, "TestContactViewDatabaseUtilitiesStep"); |
|
39 |
|
40 /** |
|
41 * This class groups all commonlu used functions across test steps |
|
42 * supports contact views creation, Installing of Active Schedular |
|
43 * Handles for current database, view collections etc.. |
|
44 */ |
|
45 class CTestContactViewDatabaseUtilitiesStep : public CTestStep |
|
46 { |
|
47 public: |
|
48 ~CTestContactViewDatabaseUtilitiesStep(); |
|
49 TVerdict doTestStepPreambleL(); |
|
50 TVerdict doTestStepPostambleL(); |
|
51 void InstallActiveSchedularL(); |
|
52 void OpenDataBaseL(); |
|
53 void SetupUtilityL(); |
|
54 CContactDatabase* CreateAndOpenDataBaseL(const TPtrC& aDbName, TBool aCreateDataBase = EFalse); |
|
55 CContactDatabase& DatabaseReference(); |
|
56 CContactViewCollection& ViewCollectionReference(); |
|
57 CContactUtilitiesCollection& ViewUtilityReference(); |
|
58 RPIMTestServer& PimTestServerReference(); |
|
59 void ConstructViewsL(); |
|
60 TBool ListenForViewEventsL(TContactViewEvent& aEvent); |
|
61 void UnInstallActiveSchedularL(); |
|
62 void CloseDatabaseL(); |
|
63 void AddGroupsInDatabaseL(); |
|
64 void IterateThroAllGroupSectionsAndUpdateL(); |
|
65 void UpdateGroupsL(const TPtrC& aGroupSection, CContactGroup& aGroup); |
|
66 void CopyDatabaseL(); |
|
67 |
|
68 |
|
69 private: |
|
70 CActiveScheduler* iScheduler; |
|
71 CContactUtilitiesCollection* iContactUtility; |
|
72 CContactViewCollection* iContactViewCollection; |
|
73 CContactDatabase* iDb; |
|
74 RPIMTestServer iPimTestServer; |
|
75 |
|
76 }; |
|
77 |
|
78 #endif |
|
79 |