phonebookengines/contactsmodel/tsrc/performance/T_PerfStartUp.h
changeset 0 e686773b3f54
child 24 0ba2181d7c28
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 // Copyright (c) 2005-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 #ifndef __TPERFSTARTUP__
       
    17 #define __TPERFSTARTUP__
       
    18 
       
    19 #include "../T_UTILS.H"
       
    20 #include <e32std.h>
       
    21 #include <e32test.h>
       
    22 #include <cntview.h>
       
    23 
       
    24 const TInt KNumTimings = 4; // number enums in TTimings and timing slots required in iTimes
       
    25 
       
    26 class CStartUp : public CActive, public MContactViewObserver
       
    27 	{
       
    28 public:
       
    29 	enum TViewType
       
    30 		{
       
    31 		ERemoteContactsView,
       
    32 		ERemoteGroupsView
       
    33 		};
       
    34 private:
       
    35 	enum TTimings
       
    36 		{
       
    37 		EOpenDatabase,
       
    38 		ECreateView,
       
    39 		EGetFirstTwenty,
       
    40 		EGetTwentyFirst
       
    41 		};
       
    42 
       
    43 public:
       
    44 	static CStartUp* NewLC(RTest& aTest);
       
    45 	
       
    46 	void RunL();
       
    47 	void DoCancel();
       
    48 	
       
    49 	void HandleContactViewEvent(const CContactViewBase& aView, const TContactViewEvent& aEvent);
       
    50 	
       
    51 	void DoTestL(const TDesC& aDbName, TViewType aViewType, TInt& aNumMsToGet20ItemsFromView);
       
    52 	
       
    53 private:
       
    54 	~CStartUp();
       
    55 	CStartUp(RTest& aTest);
       
    56 	void ConstructL();
       
    57 	void CompleteSelf();
       
    58 
       
    59 	void OpenDatabaseL(const TDesC& aDBName);
       
    60 	void CreateRemoteViewL();
       
    61 	void Cleanup();
       
    62 	void RetrieveContactsL();
       
    63 			
       
    64 private:
       
    65 
       
    66 	RTest& iTest;  //not owned
       
    67 	CContactDatabase* iContactsDb;
       
    68 	CContactRemoteView * iContactRemoteView;
       
    69 	TViewType iViewType;
       
    70 	RArray<TInt> iTimes;
       
    71 	TCntPerfTimer iTimer;
       
    72 	TInt* iNumMsToGet20ItemsFromViewPtr;
       
    73 	};
       
    74 
       
    75 
       
    76 #endif //__TPERFSTARTUP__