2 * (C) Copyright IBM Corp. 1998-2004. All Rights Reserved.
\r
4 * The program is provided "as is" without any warranty express or
\r
5 * implied, including the warranty of non-infringement and the implied
\r
6 * warranties of merchantibility and fitness for a particular purpose.
\r
7 * IBM will not be liable for any damages suffered by you as a result
\r
8 * of using the Program. In no event will IBM be liable for any
\r
9 * special, indirect or consequential damages or lost profits even if
\r
10 * IBM has been advised of the possibility of their occurrence. IBM
\r
11 * will not be liable for any third party claims against you.
\r
13 package com.ibm.richtext.styledtext;
\r
15 import com.ibm.richtext.textlayout.attributes.AttributeMap;
\r
17 abstract class MParagraphBuffer
\r
19 static final String COPYRIGHT =
\r
20 "(C) Copyright IBM Corp. 1998-1999 - All Rights Reserved";
\r
23 * Returns the start of the paragraph containing offset <tt>pos</tt>.
\r
25 abstract int paragraphStart(int pos);
\r
28 * Returns the limit of the paragraph containing offset <tt>pos</tt>.
\r
30 abstract int paragraphLimit(int pos);
\r
33 * Returns the style of the paragraph containing offset <tt>pos</tt>.
\r
35 abstract AttributeMap paragraphStyleAt(int offset);
\r
38 * Process a character insertion at offset <tt>start</tt>.
\r
39 * If a paragraph break was inserted, propogate paragraph style at
\r
40 * <tt>start</tt> to new paragraph.
\r
42 abstract void insertText(int start, char insertedChar);
\r
45 * Process character insertion at offset <tt>start</tt>.
\r
46 * Each new paragraph gets paragraph style at
\r
49 abstract void insertText(int start,
\r
55 * Process deletion by removing paragraph breaks contained in
\r
56 * deleted range. Propogate paragraph styles backward, if necessary.
\r
58 abstract void deleteText(int start,
\r
60 int[] damagedRange);
\r
63 * Replace paragraph breaks/styles between start and limit with paragraph breaks/styles
\r
64 * from <tt>srcText</tt>.
\r
65 * @param start an offset into the text
\r
66 * @param limit the index after the last character to replace
\r
67 * @param srcText the text from which new paragraphs are taken
\r
68 * @param srcStart the start of the range in <code>srcText</code> to copy
\r
69 * @param srcLimit the first index after the range in <code>srcText</code> to copy
\r
71 abstract void replace(int start,
\r
76 int[] damagedRange);
\r
79 * Set the style of all paragraphs containing offsets in the range [start, limit) to
\r
82 abstract boolean modifyParagraphStyles(int start,
\r
84 StyleModifier modifier,
\r
85 int[] damagedRange);
\r
88 * Minimize the amount of memory used by this object.
\r
90 abstract void compress();
\r