]> gitweb.fperrin.net Git - Dictionary.git/blob - jars/icu4j-4_2_1-src/src/com/ibm/richtext/styledtext/MParagraphBuffer.java
icu4jsrc
[Dictionary.git] / jars / icu4j-4_2_1-src / src / com / ibm / richtext / styledtext / MParagraphBuffer.java
1 /*\r
2  * (C) Copyright IBM Corp. 1998-2004.  All Rights Reserved.\r
3  *\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
12  */\r
13 package com.ibm.richtext.styledtext;\r
14 \r
15 import com.ibm.richtext.textlayout.attributes.AttributeMap;\r
16 \r
17 abstract class MParagraphBuffer\r
18 {\r
19     static final String COPYRIGHT =\r
20                 "(C) Copyright IBM Corp. 1998-1999 - All Rights Reserved";\r
21 \r
22 /**\r
23 * Returns the start of the paragraph containing offset <tt>pos</tt>.\r
24 */\r
25     abstract int paragraphStart(int pos);\r
26 \r
27 /**\r
28 * Returns the limit of the paragraph containing offset <tt>pos</tt>.\r
29 */\r
30     abstract int paragraphLimit(int pos);\r
31 \r
32 /**\r
33 * Returns the style of the paragraph containing offset <tt>pos</tt>.\r
34 */\r
35     abstract AttributeMap paragraphStyleAt(int offset);\r
36 \r
37 /**\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
41 */\r
42     abstract void insertText(int start, char insertedChar);\r
43 \r
44 /**\r
45 * Process character insertion at offset <tt>start</tt>.\r
46 * Each new paragraph gets paragraph style at\r
47 * <tt>start</tt>.\r
48 */\r
49     abstract void insertText(int start,\r
50                              char[] srcChars,\r
51                              int srcStart,\r
52                              int srcLimit);\r
53 \r
54 /**\r
55 * Process deletion by removing paragraph breaks contained in\r
56 * deleted range.  Propogate paragraph styles backward, if necessary.\r
57 */\r
58     abstract void deleteText(int start,\r
59                              int limit,\r
60                              int[] damagedRange);\r
61 \r
62 /*\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
70 */\r
71     abstract void replace(int start,\r
72                           int limit,\r
73                           MConstText srcText,\r
74                           int srcStart,\r
75                           int srcLimit,\r
76                           int[] damagedRange);\r
77 \r
78 /**\r
79 * Set the style of all paragraphs containing offsets in the range [start, limit) to\r
80 * <tt>style</tt>.\r
81 */\r
82     abstract boolean modifyParagraphStyles(int start,\r
83                                            int limit,\r
84                                            StyleModifier modifier,\r
85                                            int[] damagedRange);\r
86 \r
87 /**\r
88 * Minimize the amount of memory used by this object.\r
89 */\r
90     abstract void compress();\r
91 }\r