diff -r 000000000000 -r 2f259fa3e83a uifw/EikStd/coctlinc/FormCursorModifier.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uifw/EikStd/coctlinc/FormCursorModifier.h Tue Feb 02 01:00:49 2010 +0200 @@ -0,0 +1,75 @@ +/* +* 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: +* +*/ +#ifndef FORMCURSORMODIFIER_H +#define FORMCURSORMODIFIER_H + +#include +#include + +// forward declarations +class CTextView; +class CTextLayout; + +NONSHARABLE_CLASS(CFormCursorModifier) : public CBase, public MFormCursorModifier + { +private: + enum TDirectionality + { + ELeftToRight, + ERightToLeft + }; +public: + /** + * 2 phase constructor + */ + static CFormCursorModifier* NewL(CTextView* aTextView, CTextLayout* aTextLayout); + /** + * Destructor + */ + virtual ~CFormCursorModifier(); + /** + * Forwards externally generated events to the appropriate cursor + * manager handler method + */ + void HandleFormCursorModifierEventL(TFormCursorModifierEvent aEvent, TInt aData1, TAny* aData2); + /** + * Allows setting of text view + */ + void SetTextView(CTextView* aTextView); + /** + * Allows setting of text layout + */ + void SetTextLayout(CTextLayout* aTextLayout); + +private: + CFormCursorModifier(CTextView* aTextView, CTextLayout* aTextLayout); + void ConstructL(); + + void NormaliseCursorPositionFollowingDeleteL(); + void NormaliseCursorPositionFollowingNavigationL(); + void InitialiseCursorPositionL(CEikEdwin* aEdwin); + void SetDirectionality(TDirectionality aDirectionality); +private: + // not owned + CTextView* iTextView; + CTextLayout* iTextLayout; + + TDirectionality iDirectionality; + }; + + +#endif