diff -r d189ee25cf9d -r 3533d4323edc meetingrequest/mrgui/mrfieldevent/inc/cesmrfieldcommandevent.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldevent/inc/cesmrfieldcommandevent.h Wed Sep 01 12:28:57 2010 +0100 @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file defines class CESMRFieldCommandEvent. +* +*/ + + +#ifndef CESMRFIELDCOMMANDEVENT_H +#define CESMRFIELDCOMMANDEVENT_H + +#include +#include "mesmrfieldevent.h" + +/** + * Event class for sending command events from field to its observers. + * + * @code + * TESMRFieldCommandEvent event( ); + * CESMRField::NotifyEvent( event ); + * @endcode + * + * @lib esmrfieldbuildercommon.lib + */ +NONSHARABLE_CLASS( CESMRFieldCommandEvent ) : public CBase, + public MESMRFieldEvent + { + +public: + + /** + * Two-phased constructor. + * + * @param aCommand the command id. + * @return command event. + */ + IMPORT_C static CESMRFieldCommandEvent* NewL( MESMRFieldEventNotifier* aSource, + TInt aCommand ); + + /** + * Two-phased constructor. + * + * @param aCommand the command id. + * @return command event. + */ + IMPORT_C static CESMRFieldCommandEvent* NewLC( MESMRFieldEventNotifier* aSource, + TInt aCommand ); + + /** + * Destructor + */ + virtual ~CESMRFieldCommandEvent(); + +// from base class MESMRFieldEvent + + /** + * From MESMRFieldEvent. + * Gets event type. + * + * @return MESMRFieldEvent::EESMRFieldCommandEvent + */ + MESMRFieldEvent::TEventType Type() const; + + /** + * From MESMRFieldEvent. + * Gets the event source. + * + * @return pointer to the sender or NULL. + */ + MESMRFieldEventNotifier* Source() const; + + /** + * Gets the parameter count. + * @return 1. + */ + TInt ParamCount() const; + + /** + * Gets the event parameter. + * Index 0 returns the command id as TInt. + * + * @param aIndex parameter index. + * @return the parameter. + */ + TAny* Param( TInt aIndex ) const; + +private: + + CESMRFieldCommandEvent( MESMRFieldEventNotifier* aSource ); + + void ConstructL( TInt aCommand ); + +private: // data + + /** + * Source. + * Not owned. + */ + MESMRFieldEventNotifier* iSource; + + /** + * Command id. + * Own. + */ + TInt* iCommand; + + }; + +#endif // CESMRFIELDCOMMANDEVENT_H