phonebookengines_old/contactsmodel/tsrc/t_groupview_unfiled_profile.h
changeset 40 b46a585f6909
equal deleted inserted replaced
37:fd64c38c277d 40:b46a585f6909
       
     1 // Copyright (c) 2003-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>
       
    17 #include "t_utils2.h"
       
    18 
       
    19 
       
    20 //
       
    21 // Forward declarations.
       
    22 //
       
    23 
       
    24 class CGroupViewTesterBase;
       
    25 
       
    26 
       
    27 //
       
    28 // CTestConductor.
       
    29 //
       
    30 
       
    31 class CTestConductor : public CBase
       
    32 	{
       
    33 public:
       
    34 	static CTestConductor* NewL();
       
    35 	~CTestConductor();
       
    36 	void AddSingleContactL();
       
    37 	void PrintTimeTaken(TInt aTime);
       
    38 	void SetTestError(TInt aTestError);
       
    39 
       
    40 private:
       
    41 	CTestConductor();
       
    42 	void ConstructL();
       
    43 	void RunTestsL();
       
    44 	void AddContactsL();
       
    45 	void CreateGroupTestDataL();
       
    46 private:
       
    47 	RFs iFs;
       
    48 	CLog* iLog;
       
    49 	CContactDatabase* iDb;
       
    50 	CRandomContactGenerator* iRandomGenerator;
       
    51 	TInt iTotalContacts;
       
    52 	//TInt iCurrentContactId;
       
    53 	TContactItemId iGroupOneId;
       
    54 	TInt iTestError;
       
    55 	};
       
    56 
       
    57 
       
    58 //
       
    59 // CGroupViewTester.
       
    60 //
       
    61 
       
    62 class CUnfiledGroupViewTester : public CActive, public MContactViewObserver
       
    63 	{
       
    64 public:
       
    65 	static CUnfiledGroupViewTester* NewL(CLog& aLog,  CContactDatabase& aDb, CTestConductor& aTestConductor, CContactViewBase& aView, TRequestStatus& aClientStatus);
       
    66 	CUnfiledGroupViewTester(CLog& aLog,  CContactDatabase& aDb, CTestConductor& aTestConductor, CContactViewBase& aView, TRequestStatus& aClientStatus);
       
    67 	~CUnfiledGroupViewTester();
       
    68 	void ConstructL();
       
    69 	void NextTest();
       
    70 	void StartL();
       
    71 private: // From CActive.
       
    72 	void RunL();
       
    73 	TInt RunError(TInt aError);
       
    74 	void DoCancel();
       
    75 private: // From MContactViewObserver.
       
    76 	virtual void HandleContactViewEvent(const CContactViewBase& aView,const TContactViewEvent& aEvent);
       
    77 private:
       
    78 	enum TTest
       
    79 		{
       
    80 		EPreStartTest,
       
    81 		ECreateUnfiledGroupView,
       
    82 		ETestAddUnfiledContacts,
       
    83 		ETestRemoveUnfiledContacts,
       
    84 		ENumTests
       
    85 		};
       
    86 private:
       
    87 	CLog& iLog;
       
    88 	CContactDatabase& iDb;
       
    89 	CContactViewBase& iView;
       
    90 	CTestConductor& iTestConductor;
       
    91 	TTest iCurrentTest;
       
    92 	TRequestStatus& iClientStatus;
       
    93 	CContactGroupView* iGroupViewUnfiled;
       
    94 	TInt iSizeOfViewToExpect;
       
    95 	};
       
    96 
       
    97 
       
    98 //
       
    99 // CGroupViewTester
       
   100 //
       
   101 class CGroupViewTester : public CActive, public MContactViewObserver
       
   102 	{
       
   103 public:
       
   104 	static CGroupViewTester* NewL(CLog& aLog,CContactDatabase& iDb, CTestConductor& aTestConductor);
       
   105 	~CGroupViewTester();
       
   106 private:
       
   107 	CGroupViewTester(CLog& aLog,CContactDatabase& iDb, CTestConductor& aTestConductor);
       
   108 	void ConstructL();
       
   109 	void NextTest();
       
   110 	void ExceriseViewL(CContactViewBase& aView);
       
   111 	void TestGroupViewSortOrderL(CContactGroupView& aView);
       
   112 private: // From CActive.
       
   113 	void RunL();
       
   114 	TInt RunError(TInt aError);
       
   115 	void DoCancel();
       
   116 private: // From MContactViewObserver.
       
   117 	virtual void HandleContactViewEvent(const CContactViewBase& aView,const TContactViewEvent& aEvent);
       
   118 private:
       
   119 	enum TTest
       
   120 		{
       
   121 		EPreStartTest,
       
   122 		ECreateLocalView,
       
   123 		ECreateRemoteNamedView,
       
   124 		EStartLocalTests,
       
   125 		EEndLocalTests,
       
   126 		EStartRemoteTests,
       
   127 		EEndRemoteTests,
       
   128 		ENumTests
       
   129 		};
       
   130 private:
       
   131 	CLog& iLog;
       
   132 	CContactDatabase& iDb;
       
   133 	CTestConductor& iTestConductor;
       
   134 	TTest iCurrentTest;
       
   135 	RContactViewSortOrder iSortOrder_1;
       
   136 	CContactTextDef* iTextDef;
       
   137 	TBuf<128> iScratchBuf;
       
   138 
       
   139 	CContactLocalView* iLocalView;
       
   140 	CContactNamedRemoteView* iNamedRemoteView;
       
   141 	CUnfiledGroupViewTester* iTester;
       
   142 	};