Symbian3/SDK/Source/GUID-5C79E34A-4048-57C4-A7CF-2D56DC9702FB.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Tue, 20 Jul 2010 12:00:49 +0100
changeset 13 48780e181b38
parent 0 89d6a7a84779
permissions -rw-r--r--
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"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: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept xml:lang="en" id="GUID-5C79E34A-4048-57C4-A7CF-2D56DC9702FB"><title>Editing</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>When a user program edits data, it must change the document content, and change the view correspondingly.</p> <p>The text model requires the following sequence of operations for any kind of edit:</p> <ul><li id="GUID-CACBDFC7-B3AC-5590-B495-BAC770FF53D0"><p>the application identifies which command is to be performed, by interpreting user input (pointer and key events etc)</p> <p>Pointer-driven input may first use the view to set a cursor selection, and then invoke a function. Regardless of the method of input, the text view's cursor selection will often define the region of the text object affected by the command.</p> </li> <li id="GUID-B623C426-6AE3-5947-BC4E-A188F95C2343"><p>the application invokes the relevant text content function to execute the command — a change to content, format or both</p> <p>By this means, the document is changed, and the text view is now out of date.</p> </li> <li id="GUID-D9A77A7E-62C5-5F7D-81F4-0DEED27EECFD"><p>the application notifies the text view what type of change occurred and, if appropriate, specifies the range of the document that was affected</p> <p>This allows the text view to interrogate the document (through its laydoc interface) about its changed content, and to perform the minimal changes to its layout and view, and then to redraw the view.</p> </li> </ul> <p>It is the application's responsibility to identify the command, change the content, and specify the kind of updating needed in the view.</p> <p>The application should choose the function used to notify the view about the type of content update. After a major change (such as loading the document), the application should ask the view to reformat and redraw the entire format band. But this is overkill for most purposes: after a single character has been inserted, for instance, only a limited amount of reformatting may be necessary, usually confined to the remainder of the line in which the character was inserted. The general rule is that the application should choose the lightest-weight function that is guaranteed to do the necessary reformatting. This is what makes text views efficient.</p> <p>See <xref href="GUID-E9E26499-1102-578E-93F6-A8E14181A25C.dita">How to handle changes to the text view</xref>.</p> </conbody></concept>