meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewerlocationfield.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 31 Mar 2010 21:08:33 +0300
branchRCL_3
changeset 12 4ce476e64c59
parent 0 8466d47a6819
child 16 b5fbb9b25d57
permissions -rw-r--r--
Revision: 201011 Kit: 201013

/*
* 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:  Meeting request location field
 *
*/


#ifndef CESMRVIEWERLOCATIONFIELD_H_
#define CESMRVIEWERLOCATIONFIELD_H_

// INCLUDES
#include <e32base.h>
#include <eikedwob.h>
#include <eikmobs.h>
#include <coecobs.h>

#include "cesmrfield.h"

// FORWARD DECLARATIONS
class CMRImage;
class CESMRRichTextViewer;
class CAknButton;
class CESMRFeatureSettings;

/**
 * Shows the location of the meeting/event
 */
NONSHARABLE_CLASS( CESMRViewerLocationField ): public CESMRField,
                                                      public MEikEdwinSizeObserver,
                                                      public MCoeControlObserver
    {
    public:
        /**
         * Creates new CESMRViewerLocationField object. Ownership
         * is transferred to caller.
         * @return Pointer to created object,
         */
        static CESMRViewerLocationField* NewL( );


        /**
         * C++ Destructor.
         */
        ~CESMRViewerLocationField( );

    public:// From CESMRField
        void InternalizeL( MESMRCalEntry& aEntry );
        TSize MinimumSize();
        void InitializeL();
        void ListObserverSet();
        TBool ExecuteGenericCommandL( TInt aCommand );
        void SetOutlineFocusL( TBool aFocus );
        void HandleLongtapEventL( const TPoint& aPosition );
        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
        void LockL();
    protected:
		TBool HandleSingletapEventL( const TPoint& aPosition );

    public: // From CCoeControl
        TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType );
        TInt CountComponentControls() const;
        CCoeControl* ComponentControl( TInt aInd ) const;
        void SizeChanged();
        void SetContainerWindowL( const CCoeControl& aContainer );
        void GetCursorLineVerticalPos(TInt& aUpper, TInt& aLower);

    public: // From MEikEdwinSizeObserver
        TBool HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent aType,
                TSize aSize );

    public: // From MCoeControlObserver
        void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);

    private: // Implementation
        CESMRViewerLocationField( );
        void ConstructL( );
        void SetWaypointIconL( TBool aEnabled );
        TBool HandleTapEventL( const TPoint& aPosition );

    private: // data
        // Own: Edwin size
        TSize iSize;
        /// Own: Field button
        CAknButton* iFieldButton;
        /// Ref: Field text label
        CESMRRichTextViewer* iRichTextViewer;
        /// Own: Waypoint icon
        CMRImage* iWaypointIcon;
        /// Own: RichTextViewer line count.
        TInt iLineCount;
        /// Own: Middle softkey command id
        TInt iMskCommandId;
        /// Own: Feature settings
        CESMRFeatureSettings* iFeatures;
    };

#endif /*CESMRVIEWERLOCATIONFIELD_H_*/