Symbian3/SDK/Source/GUID-BE26CD1E-C566-572D-9B2D-B6CFCA647C72.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-BE26CD1E-C566-572D-9B2D-B6CFCA647C72"><title>Text objects</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>Four classes provide increasing levels of support for text content:</p> <ul><li id="GUID-F9C43495-C400-5520-9DC9-D97968C79DD4"><p><xref href="GUID-49DBB305-A043-3D23-AC33-6E5C8ABAD1EE.dita"><apiname>CEditableText</apiname></xref> provides just text content, no formatting</p> </li> <li id="GUID-1E267A97-3E79-5909-98E2-A6461EB3FF18"><p><xref href="GUID-ED1FFBC5-23C3-3C9E-B5D1-04B72B9369E6.dita"><apiname>CPlainText</apiname></xref> supports characters and paragraphs, <i>fields</i> and a page table. It can be manipulated and stored (using either a flat or segmented memory buffer), but has no formatting information and cannot be displayed. Examples of possible uses are spell checking and for explicit text handling buffers. </p> </li> <li id="GUID-80E7E899-F8B4-51B6-BC28-BB80F46D7788"><p><xref href="GUID-4F502FE5-44D4-3947-9D73-67EF4886059A.dita"><apiname>CGlobalText</apiname></xref> has a global format for all characters and all paragraphs</p> <p>This is the lowest-specification text class that can be laid out and displayed on the screen or printer. This is because layout and display require paragraph and character formats, however primitive.</p> </li> <li id="GUID-FCAAC812-263E-5144-9690-494C5408F66B"><p><xref href="GUID-39945DA4-B362-3DF6-BF9E-DD079EEA7934.dita"><apiname>CRichText</apiname></xref> all characters and paragraphs may have individually set format attributes; pictures are supported</p> <p>This provides fully general formatting.</p> </li> </ul> <p>A text object has any number of characters, and always ends with a paragraph mark, which is not included in the length. The shortest document contains zero characters. The characters in a text object are contained in a dynamic buffer, usually a <codeph>CBufSeg</codeph> but, for short text objects of bounded length, a <codeph>CBufFlat</codeph> may be more appropriate. </p> <section><title>Manipulating text objects</title> <p>Text objects provide functions to insert and delete text, and to exchange text with descriptors. Definitions for special characters are also provided. </p> <p>Facilities to count characters, words and paragraphs are provided, and also to find the beginning of the next or previous word or paragraph. When scanning words, various types of delimiters may be used. For example picture characters and punctuation delimiters may be set, which is useful for spell checking. Delimeters, such as <codeph>EScanPictureIsDelimiter</codeph>, are set in a scan mask parameter to the <codeph>ScanWords()</codeph> functions of the <codeph>CEditableText</codeph> and <codeph>CPlainText</codeph> classes.</p> </section> <section><title>Addressable document positions</title> <p>Characters are addressed by a document position, which may range from zero through to the length of the buffer. A document position is considered to mark the point between two adjacent characters. Thus document position 2 is located between the second and third characters. Document position 0 is located before the first character in the text object. Inserting text at position 5 will insert text immediately after the fifth character. Special elements such as paragraph marks, non-breaking spaces etc. are assigned to their Unicode character codes.</p> </section> </conbody></concept>