uifw/EikStd/coctlinc/FormCursorModifier.h
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 #ifndef FORMCURSORMODIFIER_H
       
    18 #define FORMCURSORMODIFIER_H
       
    19 
       
    20 #include <e32base.h>
       
    21 #include <formcursormodifierint.h>
       
    22 
       
    23 // forward declarations
       
    24 class CTextView;
       
    25 class CTextLayout;
       
    26 
       
    27 NONSHARABLE_CLASS(CFormCursorModifier) : public CBase, public MFormCursorModifier
       
    28 	{
       
    29 private:
       
    30 	enum TDirectionality
       
    31 		{
       
    32 		ELeftToRight,
       
    33 		ERightToLeft
       
    34 		};
       
    35 public:
       
    36 	/** 
       
    37 	* 2 phase constructor
       
    38 	*/
       
    39 	static CFormCursorModifier* NewL(CTextView* aTextView, CTextLayout* aTextLayout);
       
    40 	/** 
       
    41 	* Destructor
       
    42 	*/
       
    43 	virtual ~CFormCursorModifier();
       
    44 	/** 
       
    45 	* Forwards externally generated events to the appropriate cursor
       
    46 	* manager handler method
       
    47 	*/
       
    48 	void HandleFormCursorModifierEventL(TFormCursorModifierEvent aEvent, TInt aData1, TAny* aData2);
       
    49 	/** 
       
    50 	* Allows setting of text view
       
    51 	*/
       
    52 	void SetTextView(CTextView* aTextView);
       
    53 	/** 
       
    54 	* Allows setting of text layout
       
    55 	*/
       
    56 	void SetTextLayout(CTextLayout* aTextLayout);
       
    57 
       
    58 private:
       
    59 	CFormCursorModifier(CTextView* aTextView, CTextLayout* aTextLayout);
       
    60 	void ConstructL();
       
    61 
       
    62 	void NormaliseCursorPositionFollowingDeleteL();
       
    63 	void NormaliseCursorPositionFollowingNavigationL();
       
    64 	void InitialiseCursorPositionL(CEikEdwin* aEdwin);
       
    65 	void SetDirectionality(TDirectionality aDirectionality);
       
    66 private:
       
    67 	// not owned
       
    68 	CTextView* iTextView;
       
    69 	CTextLayout* iTextLayout;
       
    70 
       
    71 	TDirectionality iDirectionality;
       
    72 	};
       
    73 
       
    74 
       
    75 #endif