epoc32/include/frmcurs.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
williamr@2
     1
// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@2
     4
// 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
williamr@2
     5
// which accompanies this distribution, and is available
williamr@2
     6
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
// FORM Cursor Navigation header file holding policy interface class.
williamr@2
    15
// 
williamr@2
    16
//
williamr@2
    17
williamr@2
    18
#ifndef __FRMCURS_H__
williamr@2
    19
#define __FRMCURS_H__
williamr@2
    20
williamr@2
    21
williamr@2
    22
#include <frmconst.h>
williamr@2
    23
williamr@2
    24
williamr@2
    25
class CTmViewAnchoredLayout;
williamr@2
    26
class TTmDocPos;
williamr@2
    27
williamr@2
    28
/**
williamr@2
    29
This policy interface class maintains the cursor position and sets the 
williamr@2
    30
policy for its movement.
williamr@2
    31
@publishedPartner
williamr@2
    32
@deprecated
williamr@2
    33
*/
williamr@2
    34
class MCursorPositioningPolicy
williamr@2
    35
williamr@2
    36
	{
williamr@2
    37
public:
williamr@2
    38
williamr@2
    39
	//-- Interface enumerations ---------------------------------------------
williamr@2
    40
williamr@2
    41
williamr@2
    42
	/** Types of delete operation. This is used when...???
williamr@2
    43
	*/
williamr@2
    44
	enum TDeleteType
williamr@2
    45
		{
williamr@2
    46
		EDeleteUndefined = 0,
williamr@2
    47
		EDeleteBackspace = 1,
williamr@2
    48
		EDeleteForward   = 2,
williamr@2
    49
williamr@2
    50
		EDeleteLast
williamr@2
    51
		};
williamr@2
    52
 
williamr@2
    53
	/** Types of reformatting. This is used when...???
williamr@2
    54
	*/
williamr@2
    55
	enum TTextChangeType
williamr@2
    56
		{
williamr@2
    57
		ETextChangeUndefined = 0,
williamr@2
    58
		/** Change that causes no change in cursor position. */
williamr@2
    59
		ETextChangeNonLocal  = 1,
williamr@2
    60
		/** Change that moves the cursor to its trailing edge. */
williamr@2
    61
		ETextChangeTyping    = 2,
williamr@2
    62
williamr@2
    63
		// Maybe several more.
williamr@2
    64
		// ...
williamr@2
    65
		ETExtChangeLast
williamr@2
    66
	};
williamr@2
    67
 
williamr@2
    68
	/** 
williamr@2
    69
	Hint for positioning the visual cursor. Describes properties of the
williamr@2
    70
	editing operation that is most likely to happen next. 
williamr@2
    71
	*/
williamr@2
    72
	enum TPosHint
williamr@2
    73
		{
williamr@2
    74
		EPosHintUndefined           = 0,
williamr@2
    75
		/** Left to right typing expected. */
williamr@2
    76
		EInsertStrongL2R = 1,
williamr@2
    77
		/** Right to left typing expected. */
williamr@2
    78
		EInsertStrongR2L = 2,
williamr@2
    79
williamr@2
    80
		// Maybe several more.
williamr@2
    81
		//...
williamr@2
    82
		EPosHintLast
williamr@2
    83
		};
williamr@2
    84
williamr@2
    85
public:
williamr@2
    86
williamr@2
    87
	//-- Object creation/setup API ------------------------------------------
williamr@2
    88
williamr@2
    89
	/**
williamr@2
    90
	*/
williamr@2
    91
	virtual ~MCursorPositioningPolicy() {}
williamr@2
    92
williamr@2
    93
	/**
williamr@2
    94
	Sets the document/layout object on which all the cursor navigation will 
williamr@2
    95
	take place. 
williamr@2
    96
	*/
williamr@2
    97
	virtual void SetTmLayout(CTmViewAnchoredLayout* aLayout) = 0;
williamr@2
    98
williamr@2
    99
williamr@2
   100
	//-- Cursor positioning API ---------------------------------------------
williamr@2
   101
	
williamr@2
   102
	/** 
williamr@2
   103
	Gets the cursor position for display and insertion. 
williamr@2
   104
	@return TTmDocPos value holding cursor document position.
williamr@2
   105
	*/
williamr@2
   106
	virtual const TTmDocPos& Pos() const = 0;
williamr@2
   107
williamr@2
   108
	/** 
williamr@2
   109
	Sets the cursor position explicitly.
williamr@2
   110
	@param aNewPos New position cursor is to be moved to.
williamr@2
   111
	*/
williamr@2
   112
	virtual void SetPos(const TTmDocPos& aNewPos) = 0;
williamr@2
   113
williamr@2
   114
williamr@2
   115
	/** 
williamr@2
   116
	@return ETrue if successful, EFalse otherwise e.g. no formatting	
williamr@2
   117
	*/
williamr@2
   118
	virtual void PosXyL(TPoint& aXy) const = 0;
williamr@2
   119
williamr@2
   120
	/** 
williamr@2
   121
	Sets the X, Y co-ordinates to jump to. 
williamr@2
   122
	@param aXy Layout co-ordinates to approx. move the cursor to.
williamr@2
   123
			   On exit
williamr@2
   124
	@return ETrue if successful, EFalse otherwise e.g. no formatting	
williamr@2
   125
	*/
williamr@2
   126
	virtual void SetPosByXyL(TPoint& aNewXy) = 0;
williamr@2
   127
williamr@2
   128
	/** 
williamr@2
   129
	Allows change of cursor position in response to a hint as to 
williamr@2
   130
	positioning. 
williamr@2
   131
	@param aHint Text directional hint from client.
williamr@2
   132
	*/
williamr@2
   133
	virtual void SetPositioningHintL(TPosHint aHint) = 0;
williamr@2
   134
	
williamr@2
   135
	/** 
williamr@2
   136
	Suggests a new latent X,Y position for Up/Down operations/scrolls. 
williamr@2
   137
	@param aX X Layout co-ordinate for latent position of cursor.
williamr@2
   138
	*/
williamr@2
   139
	virtual void SetLatentX(TInt aX) = 0;
williamr@2
   140
williamr@2
   141
	/** 
williamr@2
   142
	Suggests a new latent X,Y position for Up/Down operations/scrolls. 
williamr@2
   143
	@param aY Y Layout co-ordinate for latent position of cursor.
williamr@2
   144
	*/
williamr@2
   145
	virtual void SetLatentY(TInt aY) = 0;
williamr@2
   146
williamr@2
   147
	/** 
williamr@2
   148
	Suggests a new latent X,Y position for Up/Down operations/scrolls. 
williamr@2
   149
	@param aXy X,Y Layout co-ordinate for latent position of cursor.
williamr@2
   150
	*/
williamr@2
   151
	virtual const TPoint& LatentXy() const = 0;
williamr@2
   152
williamr@2
   153
	/** 
williamr@2
   154
	Suggests a new latent X,Y position for Up/Down operations/scrolls. 
williamr@2
   155
	@param aXy X,Y Layout co-ordinate for latent position of cursor.
williamr@2
   156
	*/
williamr@2
   157
	virtual void SetLatentXy(const TPoint& aXy) = 0;
williamr@2
   158
williamr@2
   159
	/** 
williamr@2
   160
	@leave 
williamr@2
   161
	*/
williamr@2
   162
	virtual const TPoint& UpdateLatentXyL() = 0;
williamr@2
   163
williamr@2
   164
williamr@2
   165
	//--- Cursor navigation API ---------------------------------------------
williamr@2
   166
	
williamr@2
   167
williamr@2
   168
	/**
williamr@2
   169
	Moves the cursor up or down a line.
williamr@2
   170
	@param aUp ETrue if wish to move up, EFalse to go down.
williamr@2
   171
	@return TCursorMove Actual movement that took place.
williamr@2
   172
	*/
williamr@2
   173
	virtual TCursorMove UpDownL(TBool aUp) = 0;
williamr@2
   174
williamr@2
   175
	/** 
williamr@2
   176
	Moves the cursor left or right a character position. 
williamr@2
   177
	@param aDown ETrue if wish to move left, EFalse to go right.
williamr@2
   178
	@return TCursorMove Actual movement that took place.
williamr@2
   179
	*/
williamr@2
   180
	virtual TCursorMove LeftRightL(TBool aLeft) = 0;
williamr@2
   181
williamr@2
   182
	/** 
williamr@2
   183
	Moves the cursor to the start or to the end of the line. 
williamr@2
   184
	@param aStart ETrue if wish to move to the start, EFalse to go to the end.
williamr@2
   185
	@return TCursorMove Actual movement that took place.
williamr@2
   186
	*/
williamr@2
   187
	virtual TCursorMove LineStartEndL(TBool aStart) = 0;
williamr@2
   188
williamr@2
   189
williamr@2
   190
	//--- Cursor reactionary API to changes ---------------------------------
williamr@2
   191
williamr@2
   192
williamr@2
   193
	/** 
williamr@2
   194
	Responds to total change of formatting. 
williamr@2
   195
	*/
williamr@2
   196
	virtual void HandleGlobalReformatL() = 0;
williamr@2
   197
williamr@2
   198
	/** 
williamr@2
   199
	Responds to partial change of formatting.
williamr@2
   200
	@param aStart ?
williamr@2
   201
	@param aOldEnd ?
williamr@2
   202
	@param aNewEnd ?
williamr@2
   203
	@param aParaFormatChg ?
williamr@2
   204
	@param aChgType ?
williamr@2
   205
	*/
williamr@2
   206
	virtual void HandleReformatL(TInt aStart, TInt aOldEnd, 
williamr@2
   207
		TInt aNewEnd, TBool aParaFormatChg, TTextChangeType aChgType) = 0;
williamr@2
   208
	
williamr@2
   209
williamr@2
   210
	//-- Misc/Unknown API ---------------------------------------------------
williamr@2
   211
williamr@2
   212
williamr@2
   213
	/** 
williamr@2
   214
	Gets the cursor position for delete. ???
williamr@2
   215
	@param aDelType ?
williamr@2
   216
	@param aStart ?
williamr@2
   217
	@param aEnd ?
williamr@2
   218
	*/
williamr@2
   219
	virtual void GetDeletePosition(TDeleteType aDelType, TInt& aStart, 
williamr@2
   220
		TInt& aEnd) const = 0;
williamr@2
   221
		
williamr@2
   222
	/**
williamr@2
   223
	Place holder for future expansion when if more virtual methods 
williamr@2
   224
	are requried.
williamr@2
   225
	*/
williamr@2
   226
	virtual void* ExtendedInterface(TUid aInterfaceId) = 0;
williamr@2
   227
williamr@2
   228
	};
williamr@2
   229
williamr@2
   230
williamr@2
   231
#endif // __FRMCURS_H__