buildverification/autosmoketest/contacts/inc/TestContact.h
changeset 15 5b5908ec640f
parent 13 3a35f7917fa6
child 17 03d9ade4748d
equal deleted inserted replaced
13:3a35f7917fa6 15:5b5908ec640f
     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 // This contains CTestContact
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef TEST_CONTACT_H
       
    19 #define TEST_CONTACT_H
       
    20 
       
    21 #include <cntitem.h>
       
    22 
       
    23 class MTestContactInstrumentation
       
    24 {
       
    25 public:
       
    26 	virtual void			RaiseInstrumentationEventNotificationL(TInt aEventTag) = 0;
       
    27 };
       
    28 
       
    29 class CTestContact : public CBase
       
    30 	{
       
    31 public:
       
    32 	static CTestContact*	NewL(CContactItem& aSeedContact);
       
    33 	static CTestContact*	NewLC(CContactItem& aSeedContact);
       
    34 	static CTestContact*	NewL(CContactItem* aSeedContact);
       
    35 	static CTestContact*	NewLC(CContactItem* aSeedContact);
       
    36 	~CTestContact();
       
    37 
       
    38 	CContactItem&	ContactItem();
       
    39 	const TPtrC		FirstNameL();
       
    40 	const TPtrC		LastNameL();
       
    41 	const TPtrC		CompanyNameL();
       
    42 	const TPtrC		JobTitleL();
       
    43 	const TPtrC		WorkPhoneL();
       
    44 	const TPtrC		WorkMobileL();
       
    45 	const TPtrC		HomePhoneL();
       
    46 	const TPtrC		HomeMobileL();
       
    47 	const TPtrC		FaxL();
       
    48 	const TPtrC		EmailAddressL();
       
    49 	const TPtrC		InternetAddressL();
       
    50 	const TPtrC		StreetL();
       
    51 	const TPtrC		TownL();
       
    52 	const TPtrC		CountyL();
       
    53 	const TPtrC		PostCodeL();
       
    54 	const TPtrC		CountryL();
       
    55 	const TPtrC		NotesL();
       
    56 	const TPtrC		NickNameL();
       
    57 	const TPtrC		PictureL();
       
    58 
       
    59 	void	SetFirstNameL(const TDesC& aFirstName);
       
    60 	void	SetLastNameL(const TDesC& aLastName);
       
    61 	void	SetCompanyNameL(const TDesC& aCompanyName);
       
    62 	void	SetJobTitleL(const TDesC& aJobTitle);
       
    63 	void	SetWorkPhoneL(const TDesC& aWorkPhone);
       
    64 	void	SetWorkMobileL(const TDesC& aWorkMobile);
       
    65 	void	SetHomePhoneL(const TDesC& aHomePhone);
       
    66 	void	SetHomeMobileL(const TDesC& aHomeMobile);
       
    67 	void	SetFaxL(const TDesC& aFax);
       
    68 	void	SetHomeEmailAddressL(const TDesC& aEmailAddress);
       
    69 	void	SetWorkEmailAddressL(const TDesC& aEmailAddress);
       
    70 	void	SetInternetAddressL(const TDesC& aInternetAddress);
       
    71 	void	SetStreetL(const TDesC& aStreet);
       
    72 	void	SetTownL(const TDesC& aTown);
       
    73 	void	SetCountyL(const TDesC& aCounty);
       
    74 	void	SetPostCodeL(const TDesC& aPostCode);
       
    75 	void	SetCountryL(const TDesC& aCountry);
       
    76 	void	SetNotesL(const TDesC& aNotes);
       
    77 	void	SetNickNameL(const TDesC& aNickName);
       
    78 	void 	SetPictureL(const TDesC8& aPicture);
       
    79 
       
    80 private:
       
    81 	CTestContact();
       
    82 	void				ConstructL(CContactItem& aSeedContact);
       
    83 	void				ConstructL(CContactItem* aSeedContact);
       
    84 	const TPtrC			TextFieldL(TFieldType aFieldType) const;
       
    85 	const TPtrC			TextFieldL(const CContentType& aTypesToMatch) const;
       
    86   	void 				SetTextFieldL(const CContentType& aTypesToMatch,const TDesC& aText) const;
       
    87   	void 				SetTextFieldL(TFieldType aFieldType, const TDesC& aText);
       
    88   	void 				SetTextFieldL(TFieldType aFieldType, const TDesC& aText, TUid aAddOnContentType);
       
    89 	CContactItemField&	FindFieldL(TFieldType aFieldType) const;
       
    90 	CContactItemField&	FindFieldL(const CContentType& aTypesToMatch) const;
       
    91 	void SetPictureFieldL(const TDesC8& aPicture) const;
       
    92 	TInt FindField(TFieldType aFieldType) const;
       
    93   	void InsertTextFieldL(TUid aID, const TDesC& aStringOfStuff);
       
    94 
       
    95 private:
       
    96 	CContactItem*	iContactItem;
       
    97 	TBool			iDestroyOnExit;
       
    98 	};
       
    99 
       
   100 #endif /* __TEST_CONTACT_H__ */