1 | /* ====================================================================
|
---|
2 | Licensed to the Apache Software Foundation (ASF) under one or more
|
---|
3 | contributor license agreements. See the NOTICE file distributed with
|
---|
4 | this work for additional information regarding copyright ownership.
|
---|
5 | The ASF licenses this file to You under the Apache License, Version 2.0
|
---|
6 | (the "License"); you may not use this file except in compliance with
|
---|
7 | the License. You may obtain a copy of the License at
|
---|
8 |
|
---|
9 | http://www.apache.org/licenses/LICENSE-2.0
|
---|
10 |
|
---|
11 | Unless required by applicable law or agreed to in writing, software
|
---|
12 | distributed under the License is distributed on an "AS IS" BASIS,
|
---|
13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
14 | See the License for the specific language governing permissions and
|
---|
15 | limitations under the License.
|
---|
16 | ==================================================================== */
|
---|
17 |
|
---|
18 | package org.apache.poi.ss.usermodel;
|
---|
19 |
|
---|
20 | /**
|
---|
21 | * Rich text unicode string. These strings can have fonts
|
---|
22 | * applied to arbitary parts of the string.
|
---|
23 | *
|
---|
24 | * @author Glen Stampoultzis (glens at apache.org)
|
---|
25 | * @author Jason Height (jheight at apache.org)
|
---|
26 | */
|
---|
27 | public interface RichTextString {
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * Applies a font to the specified characters of a string.
|
---|
31 | *
|
---|
32 | * @param startIndex The start index to apply the font to (inclusive)
|
---|
33 | * @param endIndex The end index to apply the font to (exclusive)
|
---|
34 | * @param fontIndex The font to use.
|
---|
35 | */
|
---|
36 | void applyFont(int startIndex, int endIndex, short fontIndex);
|
---|
37 |
|
---|
38 |
|
---|
39 |
|
---|
40 | /**
|
---|
41 | * Returns the plain string representation.
|
---|
42 | */
|
---|
43 | String getString();
|
---|
44 |
|
---|
45 | /**
|
---|
46 | * @return the number of characters in the font.
|
---|
47 | */
|
---|
48 | int length();
|
---|
49 |
|
---|
50 | /**
|
---|
51 | * @return The number of formatting runs used.
|
---|
52 | *
|
---|
53 | */
|
---|
54 | int numFormattingRuns();
|
---|
55 |
|
---|
56 | /**
|
---|
57 | * The index within the string to which the specified formatting run applies.
|
---|
58 | * @param index the index of the formatting run
|
---|
59 | * @return the index within the string.
|
---|
60 | */
|
---|
61 | int getIndexOfFormattingRun(int index);
|
---|
62 |
|
---|
63 | }
|
---|