2008-04-11 17:22:40 +00:00
|
|
|
/* ====================================================================
|
|
|
|
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
|
contributor license agreements. See the NOTICE file distributed with
|
|
|
|
|
this work for additional information regarding copyright ownership.
|
|
|
|
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
|
(the "License"); you may not use this file except in compliance with
|
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
|
limitations under the License.
|
|
|
|
|
==================================================================== */
|
2009-05-21 18:12:22 +00:00
|
|
|
|
2008-04-11 17:22:40 +00:00
|
|
|
package org.apache.poi.sl.usermodel;
|
|
|
|
|
|
2015-02-21 10:56:03 +00:00
|
|
|
import java.awt.Color;
|
|
|
|
|
|
2015-08-09 22:44:13 +00:00
|
|
|
import org.apache.poi.sl.usermodel.PaintStyle.SolidPaint;
|
|
|
|
|
|
2008-04-11 17:22:40 +00:00
|
|
|
/**
|
|
|
|
|
* Some text.
|
|
|
|
|
*/
|
|
|
|
|
public interface TextRun {
|
2015-02-21 10:56:03 +00:00
|
|
|
enum TextCap {
|
|
|
|
|
NONE,
|
|
|
|
|
SMALL,
|
|
|
|
|
ALL
|
|
|
|
|
}
|
2015-10-29 01:05:27 +00:00
|
|
|
|
2015-06-17 22:21:13 +00:00
|
|
|
String getRawText();
|
2015-10-29 01:05:27 +00:00
|
|
|
void setText(String text);
|
|
|
|
|
|
|
|
|
|
TextCap getTextCap();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the font color.
|
|
|
|
|
* This usually returns a {@link SolidPaint}, but but also other classes are possible
|
|
|
|
|
*
|
|
|
|
|
* @return the font color/paint
|
|
|
|
|
*
|
2015-08-09 22:44:13 +00:00
|
|
|
* @see org.apache.poi.sl.draw.DrawPaint#getPaint(java.awt.Graphics2D, PaintStyle)
|
|
|
|
|
* @see SolidPaint#getSolidColor()
|
2015-10-29 01:05:27 +00:00
|
|
|
* @see org.apache.poi.sl.draw.DrawPaint#applyColorTransform(ColorStyle)
|
|
|
|
|
*/
|
|
|
|
|
PaintStyle getFontColor();
|
2015-08-09 22:44:13 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets the (solid) font color - convenience function
|
|
|
|
|
*
|
|
|
|
|
* @param color the color
|
|
|
|
|
*/
|
|
|
|
|
void setFontColor(Color color);
|
|
|
|
|
|
|
|
|
|
/**
|
2015-10-29 01:05:27 +00:00
|
|
|
* Sets the font color
|
|
|
|
|
*
|
|
|
|
|
* @param color the color
|
|
|
|
|
*
|
|
|
|
|
* @see org.apache.poi.sl.draw.DrawPaint#createSolidPaint(Color)
|
|
|
|
|
*/
|
|
|
|
|
void setFontColor(PaintStyle color);
|
|
|
|
|
|
|
|
|
|
|
2015-07-15 00:30:21 +00:00
|
|
|
/**
|
2015-10-05 00:28:54 +00:00
|
|
|
* Returns the font size which is either set directly on this text run or
|
|
|
|
|
* given from the slide layout
|
2015-10-29 01:05:27 +00:00
|
|
|
*
|
2015-07-15 00:30:21 +00:00
|
|
|
* @return font size in points or null if font size is not set.
|
|
|
|
|
*/
|
2015-10-29 01:05:27 +00:00
|
|
|
Double getFontSize();
|
2015-07-15 00:30:21 +00:00
|
|
|
|
|
|
|
|
/**
|
2015-10-05 00:28:54 +00:00
|
|
|
* Sets the font size directly on this text run, if null is given, the
|
|
|
|
|
* font size defaults to the values given from the slide layout
|
2015-10-29 01:05:27 +00:00
|
|
|
*
|
2015-07-15 00:30:21 +00:00
|
|
|
* @param fontSize font size in points, if null the underlying fontsize will be unset
|
|
|
|
|
*/
|
2015-10-29 01:05:27 +00:00
|
|
|
void setFontSize(Double fontSize);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return font family or null if not set
|
|
|
|
|
*/
|
|
|
|
|
String getFontFamily();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Specifies the typeface, or name of the font that is to be used for this text run.
|
|
|
|
|
*
|
|
|
|
|
* @param typeface the font to apply to this text run.
|
|
|
|
|
* The value of <code>null</code> unsets the Typeface attrubute from the underlying xml.
|
|
|
|
|
*/
|
|
|
|
|
void setFontFamily(String typeface);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return true, if text is bold
|
|
|
|
|
*/
|
|
|
|
|
boolean isBold();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets the bold state
|
|
|
|
|
*
|
|
|
|
|
* @param bold set to true for bold text, false for normal weight
|
|
|
|
|
*/
|
|
|
|
|
void setBold(boolean bold);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return true, if text is italic
|
|
|
|
|
*/
|
|
|
|
|
boolean isItalic();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets the italic state
|
|
|
|
|
*
|
|
|
|
|
* @param italic set to true for italic text, false for non-italics
|
|
|
|
|
*/
|
|
|
|
|
void setItalic(boolean italic);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return true, if text is underlined
|
|
|
|
|
*/
|
|
|
|
|
boolean isUnderlined();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets the underlined state
|
|
|
|
|
*
|
|
|
|
|
* @param underlined set to true for underlined text, false for no underlining
|
|
|
|
|
*/
|
|
|
|
|
void setUnderlined(boolean underlined);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return true, if text is stroked
|
|
|
|
|
*/
|
|
|
|
|
boolean isStrikethrough();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets the strikethrough state
|
|
|
|
|
*
|
|
|
|
|
* @param stroked set to true for stroked text, false for no stroking
|
|
|
|
|
*/
|
|
|
|
|
void setStrikethrough(boolean stroked);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return true, if text is sub scripted
|
|
|
|
|
*/
|
|
|
|
|
boolean isSubscript();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return true, if text is super scripted
|
|
|
|
|
*/
|
|
|
|
|
boolean isSuperscript();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return the pitch and family id or -1 if not applicable
|
|
|
|
|
*/
|
|
|
|
|
byte getPitchAndFamily();
|
2016-01-12 23:20:48 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Return the associated hyperlink
|
|
|
|
|
*
|
|
|
|
|
* @return the associated hyperlink or null if no hyperlink was set
|
2016-01-24 00:12:10 +00:00
|
|
|
*
|
|
|
|
|
* @since POI 3.14-Beta2
|
|
|
|
|
*/
|
|
|
|
|
Hyperlink<?,?> getHyperlink();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Creates a new hyperlink and assigns it to this text run.
|
|
|
|
|
* If the text run has already a hyperlink assigned, return it instead
|
|
|
|
|
*
|
|
|
|
|
* @return the associated hyperlink
|
|
|
|
|
*
|
|
|
|
|
* @since POI 3.14-Beta2
|
2016-01-12 23:20:48 +00:00
|
|
|
*/
|
2016-01-24 00:12:10 +00:00
|
|
|
Hyperlink<?,?> createHyperlink();
|
2008-04-11 17:22:40 +00:00
|
|
|
}
|