epoc32/include/frmcurs.h
branchSymbian2
changeset 2 2fe1408b6811
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/frmcurs.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,231 @@
     1.4 +// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// FORM Cursor Navigation header file holding policy interface class.
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#ifndef __FRMCURS_H__
    1.22 +#define __FRMCURS_H__
    1.23 +
    1.24 +
    1.25 +#include <frmconst.h>
    1.26 +
    1.27 +
    1.28 +class CTmViewAnchoredLayout;
    1.29 +class TTmDocPos;
    1.30 +
    1.31 +/**
    1.32 +This policy interface class maintains the cursor position and sets the 
    1.33 +policy for its movement.
    1.34 +@publishedPartner
    1.35 +@deprecated
    1.36 +*/
    1.37 +class MCursorPositioningPolicy
    1.38 +
    1.39 +	{
    1.40 +public:
    1.41 +
    1.42 +	//-- Interface enumerations ---------------------------------------------
    1.43 +
    1.44 +
    1.45 +	/** Types of delete operation. This is used when...???
    1.46 +	*/
    1.47 +	enum TDeleteType
    1.48 +		{
    1.49 +		EDeleteUndefined = 0,
    1.50 +		EDeleteBackspace = 1,
    1.51 +		EDeleteForward   = 2,
    1.52 +
    1.53 +		EDeleteLast
    1.54 +		};
    1.55 + 
    1.56 +	/** Types of reformatting. This is used when...???
    1.57 +	*/
    1.58 +	enum TTextChangeType
    1.59 +		{
    1.60 +		ETextChangeUndefined = 0,
    1.61 +		/** Change that causes no change in cursor position. */
    1.62 +		ETextChangeNonLocal  = 1,
    1.63 +		/** Change that moves the cursor to its trailing edge. */
    1.64 +		ETextChangeTyping    = 2,
    1.65 +
    1.66 +		// Maybe several more.
    1.67 +		// ...
    1.68 +		ETExtChangeLast
    1.69 +	};
    1.70 + 
    1.71 +	/** 
    1.72 +	Hint for positioning the visual cursor. Describes properties of the
    1.73 +	editing operation that is most likely to happen next. 
    1.74 +	*/
    1.75 +	enum TPosHint
    1.76 +		{
    1.77 +		EPosHintUndefined           = 0,
    1.78 +		/** Left to right typing expected. */
    1.79 +		EInsertStrongL2R = 1,
    1.80 +		/** Right to left typing expected. */
    1.81 +		EInsertStrongR2L = 2,
    1.82 +
    1.83 +		// Maybe several more.
    1.84 +		//...
    1.85 +		EPosHintLast
    1.86 +		};
    1.87 +
    1.88 +public:
    1.89 +
    1.90 +	//-- Object creation/setup API ------------------------------------------
    1.91 +
    1.92 +	/**
    1.93 +	*/
    1.94 +	virtual ~MCursorPositioningPolicy() {}
    1.95 +
    1.96 +	/**
    1.97 +	Sets the document/layout object on which all the cursor navigation will 
    1.98 +	take place. 
    1.99 +	*/
   1.100 +	virtual void SetTmLayout(CTmViewAnchoredLayout* aLayout) = 0;
   1.101 +
   1.102 +
   1.103 +	//-- Cursor positioning API ---------------------------------------------
   1.104 +	
   1.105 +	/** 
   1.106 +	Gets the cursor position for display and insertion. 
   1.107 +	@return TTmDocPos value holding cursor document position.
   1.108 +	*/
   1.109 +	virtual const TTmDocPos& Pos() const = 0;
   1.110 +
   1.111 +	/** 
   1.112 +	Sets the cursor position explicitly.
   1.113 +	@param aNewPos New position cursor is to be moved to.
   1.114 +	*/
   1.115 +	virtual void SetPos(const TTmDocPos& aNewPos) = 0;
   1.116 +
   1.117 +
   1.118 +	/** 
   1.119 +	@return ETrue if successful, EFalse otherwise e.g. no formatting	
   1.120 +	*/
   1.121 +	virtual void PosXyL(TPoint& aXy) const = 0;
   1.122 +
   1.123 +	/** 
   1.124 +	Sets the X, Y co-ordinates to jump to. 
   1.125 +	@param aXy Layout co-ordinates to approx. move the cursor to.
   1.126 +			   On exit
   1.127 +	@return ETrue if successful, EFalse otherwise e.g. no formatting	
   1.128 +	*/
   1.129 +	virtual void SetPosByXyL(TPoint& aNewXy) = 0;
   1.130 +
   1.131 +	/** 
   1.132 +	Allows change of cursor position in response to a hint as to 
   1.133 +	positioning. 
   1.134 +	@param aHint Text directional hint from client.
   1.135 +	*/
   1.136 +	virtual void SetPositioningHintL(TPosHint aHint) = 0;
   1.137 +	
   1.138 +	/** 
   1.139 +	Suggests a new latent X,Y position for Up/Down operations/scrolls. 
   1.140 +	@param aX X Layout co-ordinate for latent position of cursor.
   1.141 +	*/
   1.142 +	virtual void SetLatentX(TInt aX) = 0;
   1.143 +
   1.144 +	/** 
   1.145 +	Suggests a new latent X,Y position for Up/Down operations/scrolls. 
   1.146 +	@param aY Y Layout co-ordinate for latent position of cursor.
   1.147 +	*/
   1.148 +	virtual void SetLatentY(TInt aY) = 0;
   1.149 +
   1.150 +	/** 
   1.151 +	Suggests a new latent X,Y position for Up/Down operations/scrolls. 
   1.152 +	@param aXy X,Y Layout co-ordinate for latent position of cursor.
   1.153 +	*/
   1.154 +	virtual const TPoint& LatentXy() const = 0;
   1.155 +
   1.156 +	/** 
   1.157 +	Suggests a new latent X,Y position for Up/Down operations/scrolls. 
   1.158 +	@param aXy X,Y Layout co-ordinate for latent position of cursor.
   1.159 +	*/
   1.160 +	virtual void SetLatentXy(const TPoint& aXy) = 0;
   1.161 +
   1.162 +	/** 
   1.163 +	@leave 
   1.164 +	*/
   1.165 +	virtual const TPoint& UpdateLatentXyL() = 0;
   1.166 +
   1.167 +
   1.168 +	//--- Cursor navigation API ---------------------------------------------
   1.169 +	
   1.170 +
   1.171 +	/**
   1.172 +	Moves the cursor up or down a line.
   1.173 +	@param aUp ETrue if wish to move up, EFalse to go down.
   1.174 +	@return TCursorMove Actual movement that took place.
   1.175 +	*/
   1.176 +	virtual TCursorMove UpDownL(TBool aUp) = 0;
   1.177 +
   1.178 +	/** 
   1.179 +	Moves the cursor left or right a character position. 
   1.180 +	@param aDown ETrue if wish to move left, EFalse to go right.
   1.181 +	@return TCursorMove Actual movement that took place.
   1.182 +	*/
   1.183 +	virtual TCursorMove LeftRightL(TBool aLeft) = 0;
   1.184 +
   1.185 +	/** 
   1.186 +	Moves the cursor to the start or to the end of the line. 
   1.187 +	@param aStart ETrue if wish to move to the start, EFalse to go to the end.
   1.188 +	@return TCursorMove Actual movement that took place.
   1.189 +	*/
   1.190 +	virtual TCursorMove LineStartEndL(TBool aStart) = 0;
   1.191 +
   1.192 +
   1.193 +	//--- Cursor reactionary API to changes ---------------------------------
   1.194 +
   1.195 +
   1.196 +	/** 
   1.197 +	Responds to total change of formatting. 
   1.198 +	*/
   1.199 +	virtual void HandleGlobalReformatL() = 0;
   1.200 +
   1.201 +	/** 
   1.202 +	Responds to partial change of formatting.
   1.203 +	@param aStart ?
   1.204 +	@param aOldEnd ?
   1.205 +	@param aNewEnd ?
   1.206 +	@param aParaFormatChg ?
   1.207 +	@param aChgType ?
   1.208 +	*/
   1.209 +	virtual void HandleReformatL(TInt aStart, TInt aOldEnd, 
   1.210 +		TInt aNewEnd, TBool aParaFormatChg, TTextChangeType aChgType) = 0;
   1.211 +	
   1.212 +
   1.213 +	//-- Misc/Unknown API ---------------------------------------------------
   1.214 +
   1.215 +
   1.216 +	/** 
   1.217 +	Gets the cursor position for delete. ???
   1.218 +	@param aDelType ?
   1.219 +	@param aStart ?
   1.220 +	@param aEnd ?
   1.221 +	*/
   1.222 +	virtual void GetDeletePosition(TDeleteType aDelType, TInt& aStart, 
   1.223 +		TInt& aEnd) const = 0;
   1.224 +		
   1.225 +	/**
   1.226 +	Place holder for future expansion when if more virtual methods 
   1.227 +	are requried.
   1.228 +	*/
   1.229 +	virtual void* ExtendedInterface(TUid aInterfaceId) = 0;
   1.230 +
   1.231 +	};
   1.232 +
   1.233 +
   1.234 +#endif // __FRMCURS_H__