init: 폴더구조 설계 및 인프라 설계
This commit is contained in:
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -0,0 +1,71 @@
|
||||
"""Enumerations that describe click-action settings."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from pptx.enum.base import BaseEnum
|
||||
|
||||
|
||||
class PP_ACTION_TYPE(BaseEnum):
|
||||
"""
|
||||
Specifies the type of a mouse action (click or hover action).
|
||||
|
||||
Alias: ``PP_ACTION``
|
||||
|
||||
Example::
|
||||
|
||||
from pptx.enum.action import PP_ACTION
|
||||
|
||||
assert shape.click_action.action == PP_ACTION.HYPERLINK
|
||||
|
||||
MS API name: `PpActionType`
|
||||
|
||||
https://msdn.microsoft.com/EN-US/library/office/ff744895.aspx
|
||||
"""
|
||||
|
||||
END_SHOW = (6, "Slide show ends.")
|
||||
"""Slide show ends."""
|
||||
|
||||
FIRST_SLIDE = (3, "Returns to the first slide.")
|
||||
"""Returns to the first slide."""
|
||||
|
||||
HYPERLINK = (7, "Hyperlink.")
|
||||
"""Hyperlink."""
|
||||
|
||||
LAST_SLIDE = (4, "Moves to the last slide.")
|
||||
"""Moves to the last slide."""
|
||||
|
||||
LAST_SLIDE_VIEWED = (5, "Moves to the last slide viewed.")
|
||||
"""Moves to the last slide viewed."""
|
||||
|
||||
NAMED_SLIDE = (101, "Moves to slide specified by slide number.")
|
||||
"""Moves to slide specified by slide number."""
|
||||
|
||||
NAMED_SLIDE_SHOW = (10, "Runs the slideshow.")
|
||||
"""Runs the slideshow."""
|
||||
|
||||
NEXT_SLIDE = (1, "Moves to the next slide.")
|
||||
"""Moves to the next slide."""
|
||||
|
||||
NONE = (0, "No action is performed.")
|
||||
"""No action is performed."""
|
||||
|
||||
OPEN_FILE = (102, "Opens the specified file.")
|
||||
"""Opens the specified file."""
|
||||
|
||||
OLE_VERB = (11, "OLE Verb.")
|
||||
"""OLE Verb."""
|
||||
|
||||
PLAY = (12, "Begins the slideshow.")
|
||||
"""Begins the slideshow."""
|
||||
|
||||
PREVIOUS_SLIDE = (2, "Moves to the previous slide.")
|
||||
"""Moves to the previous slide."""
|
||||
|
||||
RUN_MACRO = (8, "Runs a macro.")
|
||||
"""Runs a macro."""
|
||||
|
||||
RUN_PROGRAM = (9, "Runs a program.")
|
||||
"""Runs a program."""
|
||||
|
||||
|
||||
PP_ACTION = PP_ACTION_TYPE
|
||||
@@ -0,0 +1,175 @@
|
||||
"""Base classes and other objects used by enumerations."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import enum
|
||||
import textwrap
|
||||
from typing import TYPE_CHECKING, Any, Type, TypeVar
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing_extensions import Self
|
||||
|
||||
_T = TypeVar("_T", bound="BaseXmlEnum")
|
||||
|
||||
|
||||
class BaseEnum(int, enum.Enum):
|
||||
"""Base class for Enums that do not map XML attr values.
|
||||
|
||||
The enum's value will be an integer, corresponding to the integer assigned the
|
||||
corresponding member in the MS API enum of the same name.
|
||||
"""
|
||||
|
||||
def __new__(cls, ms_api_value: int, docstr: str):
|
||||
self = int.__new__(cls, ms_api_value)
|
||||
self._value_ = ms_api_value
|
||||
self.__doc__ = docstr.strip()
|
||||
return self
|
||||
|
||||
def __str__(self):
|
||||
"""The symbolic name and string value of this member, e.g. 'MIDDLE (3)'."""
|
||||
return f"{self.name} ({self.value})"
|
||||
|
||||
|
||||
class BaseXmlEnum(int, enum.Enum):
|
||||
"""Base class for Enums that also map XML attr values.
|
||||
|
||||
The enum's value will be an integer, corresponding to the integer assigned the
|
||||
corresponding member in the MS API enum of the same name.
|
||||
"""
|
||||
|
||||
xml_value: str | None
|
||||
|
||||
def __new__(cls, ms_api_value: int, xml_value: str | None, docstr: str):
|
||||
self = int.__new__(cls, ms_api_value)
|
||||
self._value_ = ms_api_value
|
||||
self.xml_value = xml_value
|
||||
self.__doc__ = docstr.strip()
|
||||
return self
|
||||
|
||||
def __str__(self):
|
||||
"""The symbolic name and string value of this member, e.g. 'MIDDLE (3)'."""
|
||||
return f"{self.name} ({self.value})"
|
||||
|
||||
@classmethod
|
||||
def from_xml(cls, xml_value: str) -> Self:
|
||||
"""Enumeration member corresponding to XML attribute value `xml_value`.
|
||||
|
||||
Raises `ValueError` if `xml_value` is the empty string ("") or is not an XML attribute
|
||||
value registered on the enumeration. Note that enum members that do not correspond to one
|
||||
of the defined values for an XML attribute have `xml_value == ""`. These
|
||||
"return-value only" members cannot be automatically mapped from an XML attribute value and
|
||||
must be selected explicitly by code, based on the appropriate conditions.
|
||||
|
||||
Example::
|
||||
|
||||
>>> WD_PARAGRAPH_ALIGNMENT.from_xml("center")
|
||||
WD_PARAGRAPH_ALIGNMENT.CENTER
|
||||
|
||||
"""
|
||||
# -- the empty string never maps to a member --
|
||||
member = (
|
||||
next((member for member in cls if member.xml_value == xml_value), None)
|
||||
if xml_value
|
||||
else None
|
||||
)
|
||||
|
||||
if member is None:
|
||||
raise ValueError(f"{cls.__name__} has no XML mapping for {repr(xml_value)}")
|
||||
|
||||
return member
|
||||
|
||||
@classmethod
|
||||
def to_xml(cls: Type[_T], value: int | _T) -> str:
|
||||
"""XML value of this enum member, generally an XML attribute value."""
|
||||
# -- presence of multi-arg `__new__()` method fools type-checker, but getting a
|
||||
# -- member by its value using EnumCls(val) works as usual.
|
||||
member = cls(value)
|
||||
xml_value = member.xml_value
|
||||
if not xml_value:
|
||||
raise ValueError(f"{cls.__name__}.{member.name} has no XML representation")
|
||||
return xml_value
|
||||
|
||||
@classmethod
|
||||
def validate(cls: Type[_T], value: _T):
|
||||
"""Raise |ValueError| if `value` is not an assignable value."""
|
||||
if value not in cls:
|
||||
raise ValueError(f"{value} not a member of {cls.__name__} enumeration")
|
||||
|
||||
|
||||
class DocsPageFormatter(object):
|
||||
"""Formats a reStructuredText documention page (string) for an enumeration."""
|
||||
|
||||
def __init__(self, clsname: str, clsdict: dict[str, Any]):
|
||||
self._clsname = clsname
|
||||
self._clsdict = clsdict
|
||||
|
||||
@property
|
||||
def page_str(self):
|
||||
"""
|
||||
The RestructuredText documentation page for the enumeration. This is
|
||||
the only API member for the class.
|
||||
"""
|
||||
tmpl = ".. _%s:\n\n%s\n\n%s\n\n----\n\n%s"
|
||||
components = (
|
||||
self._ms_name,
|
||||
self._page_title,
|
||||
self._intro_text,
|
||||
self._member_defs,
|
||||
)
|
||||
return tmpl % components
|
||||
|
||||
@property
|
||||
def _intro_text(self):
|
||||
"""
|
||||
The docstring of the enumeration, formatted for use at the top of the
|
||||
documentation page
|
||||
"""
|
||||
try:
|
||||
cls_docstring = self._clsdict["__doc__"]
|
||||
except KeyError:
|
||||
cls_docstring = ""
|
||||
|
||||
if cls_docstring is None:
|
||||
return ""
|
||||
|
||||
return textwrap.dedent(cls_docstring).strip()
|
||||
|
||||
def _member_def(self, member: BaseEnum | BaseXmlEnum):
|
||||
"""Return an individual member definition formatted as an RST glossary entry.
|
||||
|
||||
Output is wrapped to fit within 78 columns.
|
||||
"""
|
||||
member_docstring = textwrap.dedent(member.__doc__ or "").strip()
|
||||
member_docstring = textwrap.fill(
|
||||
member_docstring,
|
||||
width=78,
|
||||
initial_indent=" " * 4,
|
||||
subsequent_indent=" " * 4,
|
||||
)
|
||||
return "%s\n%s\n" % (member.name, member_docstring)
|
||||
|
||||
@property
|
||||
def _member_defs(self):
|
||||
"""
|
||||
A single string containing the aggregated member definitions section
|
||||
of the documentation page
|
||||
"""
|
||||
members = self._clsdict["__members__"]
|
||||
member_defs = [self._member_def(member) for member in members if member.name is not None]
|
||||
return "\n".join(member_defs)
|
||||
|
||||
@property
|
||||
def _ms_name(self):
|
||||
"""
|
||||
The Microsoft API name for this enumeration
|
||||
"""
|
||||
return self._clsdict["__ms_name__"]
|
||||
|
||||
@property
|
||||
def _page_title(self):
|
||||
"""
|
||||
The title for the documentation page, formatted as code (surrounded
|
||||
in double-backtics) and underlined with '=' characters
|
||||
"""
|
||||
title_underscore = "=" * (len(self._clsname) + 4)
|
||||
return "``%s``\n%s" % (self._clsname, title_underscore)
|
||||
@@ -0,0 +1,492 @@
|
||||
"""Enumerations used by charts and related objects."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from pptx.enum.base import BaseEnum, BaseXmlEnum
|
||||
|
||||
|
||||
class XL_AXIS_CROSSES(BaseXmlEnum):
|
||||
"""Specifies the point on an axis where the other axis crosses.
|
||||
|
||||
Example::
|
||||
|
||||
from pptx.enum.chart import XL_AXIS_CROSSES
|
||||
|
||||
value_axis.crosses = XL_AXIS_CROSSES.MAXIMUM
|
||||
|
||||
MS API Name: `XlAxisCrosses`
|
||||
|
||||
https://msdn.microsoft.com/en-us/library/office/ff745402.aspx
|
||||
"""
|
||||
|
||||
AUTOMATIC = (-4105, "autoZero", "The axis crossing point is set automatically, often at zero.")
|
||||
"""The axis crossing point is set automatically, often at zero."""
|
||||
|
||||
CUSTOM = (-4114, "", "The .crosses_at property specifies the axis crossing point.")
|
||||
"""The .crosses_at property specifies the axis crossing point."""
|
||||
|
||||
MAXIMUM = (2, "max", "The axis crosses at the maximum value.")
|
||||
"""The axis crosses at the maximum value."""
|
||||
|
||||
MINIMUM = (4, "min", "The axis crosses at the minimum value.")
|
||||
"""The axis crosses at the minimum value."""
|
||||
|
||||
|
||||
class XL_CATEGORY_TYPE(BaseEnum):
|
||||
"""Specifies the type of the category axis.
|
||||
|
||||
Example::
|
||||
|
||||
from pptx.enum.chart import XL_CATEGORY_TYPE
|
||||
|
||||
date_axis = chart.category_axis
|
||||
assert date_axis.category_type == XL_CATEGORY_TYPE.TIME_SCALE
|
||||
|
||||
MS API Name: `XlCategoryType`
|
||||
|
||||
https://msdn.microsoft.com/EN-US/library/office/ff746136.aspx
|
||||
"""
|
||||
|
||||
AUTOMATIC_SCALE = (-4105, "The application controls the axis type.")
|
||||
"""The application controls the axis type."""
|
||||
|
||||
CATEGORY_SCALE = (2, "Axis groups data by an arbitrary set of categories")
|
||||
"""Axis groups data by an arbitrary set of categories"""
|
||||
|
||||
TIME_SCALE = (3, "Axis groups data on a time scale of days, months, or years.")
|
||||
"""Axis groups data on a time scale of days, months, or years."""
|
||||
|
||||
|
||||
class XL_CHART_TYPE(BaseEnum):
|
||||
"""Specifies the type of a chart.
|
||||
|
||||
Example::
|
||||
|
||||
from pptx.enum.chart import XL_CHART_TYPE
|
||||
|
||||
assert chart.chart_type == XL_CHART_TYPE.BAR_STACKED
|
||||
|
||||
MS API Name: `XlChartType`
|
||||
|
||||
http://msdn.microsoft.com/en-us/library/office/ff838409.aspx
|
||||
"""
|
||||
|
||||
THREE_D_AREA = (-4098, "3D Area.")
|
||||
"""3D Area."""
|
||||
|
||||
THREE_D_AREA_STACKED = (78, "3D Stacked Area.")
|
||||
"""3D Stacked Area."""
|
||||
|
||||
THREE_D_AREA_STACKED_100 = (79, "100% Stacked Area.")
|
||||
"""100% Stacked Area."""
|
||||
|
||||
THREE_D_BAR_CLUSTERED = (60, "3D Clustered Bar.")
|
||||
"""3D Clustered Bar."""
|
||||
|
||||
THREE_D_BAR_STACKED = (61, "3D Stacked Bar.")
|
||||
"""3D Stacked Bar."""
|
||||
|
||||
THREE_D_BAR_STACKED_100 = (62, "3D 100% Stacked Bar.")
|
||||
"""3D 100% Stacked Bar."""
|
||||
|
||||
THREE_D_COLUMN = (-4100, "3D Column.")
|
||||
"""3D Column."""
|
||||
|
||||
THREE_D_COLUMN_CLUSTERED = (54, "3D Clustered Column.")
|
||||
"""3D Clustered Column."""
|
||||
|
||||
THREE_D_COLUMN_STACKED = (55, "3D Stacked Column.")
|
||||
"""3D Stacked Column."""
|
||||
|
||||
THREE_D_COLUMN_STACKED_100 = (56, "3D 100% Stacked Column.")
|
||||
"""3D 100% Stacked Column."""
|
||||
|
||||
THREE_D_LINE = (-4101, "3D Line.")
|
||||
"""3D Line."""
|
||||
|
||||
THREE_D_PIE = (-4102, "3D Pie.")
|
||||
"""3D Pie."""
|
||||
|
||||
THREE_D_PIE_EXPLODED = (70, "Exploded 3D Pie.")
|
||||
"""Exploded 3D Pie."""
|
||||
|
||||
AREA = (1, "Area")
|
||||
"""Area"""
|
||||
|
||||
AREA_STACKED = (76, "Stacked Area.")
|
||||
"""Stacked Area."""
|
||||
|
||||
AREA_STACKED_100 = (77, "100% Stacked Area.")
|
||||
"""100% Stacked Area."""
|
||||
|
||||
BAR_CLUSTERED = (57, "Clustered Bar.")
|
||||
"""Clustered Bar."""
|
||||
|
||||
BAR_OF_PIE = (71, "Bar of Pie.")
|
||||
"""Bar of Pie."""
|
||||
|
||||
BAR_STACKED = (58, "Stacked Bar.")
|
||||
"""Stacked Bar."""
|
||||
|
||||
BAR_STACKED_100 = (59, "100% Stacked Bar.")
|
||||
"""100% Stacked Bar."""
|
||||
|
||||
BUBBLE = (15, "Bubble.")
|
||||
"""Bubble."""
|
||||
|
||||
BUBBLE_THREE_D_EFFECT = (87, "Bubble with 3D effects.")
|
||||
"""Bubble with 3D effects."""
|
||||
|
||||
COLUMN_CLUSTERED = (51, "Clustered Column.")
|
||||
"""Clustered Column."""
|
||||
|
||||
COLUMN_STACKED = (52, "Stacked Column.")
|
||||
"""Stacked Column."""
|
||||
|
||||
COLUMN_STACKED_100 = (53, "100% Stacked Column.")
|
||||
"""100% Stacked Column."""
|
||||
|
||||
CONE_BAR_CLUSTERED = (102, "Clustered Cone Bar.")
|
||||
"""Clustered Cone Bar."""
|
||||
|
||||
CONE_BAR_STACKED = (103, "Stacked Cone Bar.")
|
||||
"""Stacked Cone Bar."""
|
||||
|
||||
CONE_BAR_STACKED_100 = (104, "100% Stacked Cone Bar.")
|
||||
"""100% Stacked Cone Bar."""
|
||||
|
||||
CONE_COL = (105, "3D Cone Column.")
|
||||
"""3D Cone Column."""
|
||||
|
||||
CONE_COL_CLUSTERED = (99, "Clustered Cone Column.")
|
||||
"""Clustered Cone Column."""
|
||||
|
||||
CONE_COL_STACKED = (100, "Stacked Cone Column.")
|
||||
"""Stacked Cone Column."""
|
||||
|
||||
CONE_COL_STACKED_100 = (101, "100% Stacked Cone Column.")
|
||||
"""100% Stacked Cone Column."""
|
||||
|
||||
CYLINDER_BAR_CLUSTERED = (95, "Clustered Cylinder Bar.")
|
||||
"""Clustered Cylinder Bar."""
|
||||
|
||||
CYLINDER_BAR_STACKED = (96, "Stacked Cylinder Bar.")
|
||||
"""Stacked Cylinder Bar."""
|
||||
|
||||
CYLINDER_BAR_STACKED_100 = (97, "100% Stacked Cylinder Bar.")
|
||||
"""100% Stacked Cylinder Bar."""
|
||||
|
||||
CYLINDER_COL = (98, "3D Cylinder Column.")
|
||||
"""3D Cylinder Column."""
|
||||
|
||||
CYLINDER_COL_CLUSTERED = (92, "Clustered Cone Column.")
|
||||
"""Clustered Cone Column."""
|
||||
|
||||
CYLINDER_COL_STACKED = (93, "Stacked Cone Column.")
|
||||
"""Stacked Cone Column."""
|
||||
|
||||
CYLINDER_COL_STACKED_100 = (94, "100% Stacked Cylinder Column.")
|
||||
"""100% Stacked Cylinder Column."""
|
||||
|
||||
DOUGHNUT = (-4120, "Doughnut.")
|
||||
"""Doughnut."""
|
||||
|
||||
DOUGHNUT_EXPLODED = (80, "Exploded Doughnut.")
|
||||
"""Exploded Doughnut."""
|
||||
|
||||
LINE = (4, "Line.")
|
||||
"""Line."""
|
||||
|
||||
LINE_MARKERS = (65, "Line with Markers.")
|
||||
"""Line with Markers."""
|
||||
|
||||
LINE_MARKERS_STACKED = (66, "Stacked Line with Markers.")
|
||||
"""Stacked Line with Markers."""
|
||||
|
||||
LINE_MARKERS_STACKED_100 = (67, "100% Stacked Line with Markers.")
|
||||
"""100% Stacked Line with Markers."""
|
||||
|
||||
LINE_STACKED = (63, "Stacked Line.")
|
||||
"""Stacked Line."""
|
||||
|
||||
LINE_STACKED_100 = (64, "100% Stacked Line.")
|
||||
"""100% Stacked Line."""
|
||||
|
||||
PIE = (5, "Pie.")
|
||||
"""Pie."""
|
||||
|
||||
PIE_EXPLODED = (69, "Exploded Pie.")
|
||||
"""Exploded Pie."""
|
||||
|
||||
PIE_OF_PIE = (68, "Pie of Pie.")
|
||||
"""Pie of Pie."""
|
||||
|
||||
PYRAMID_BAR_CLUSTERED = (109, "Clustered Pyramid Bar.")
|
||||
"""Clustered Pyramid Bar."""
|
||||
|
||||
PYRAMID_BAR_STACKED = (110, "Stacked Pyramid Bar.")
|
||||
"""Stacked Pyramid Bar."""
|
||||
|
||||
PYRAMID_BAR_STACKED_100 = (111, "100% Stacked Pyramid Bar.")
|
||||
"""100% Stacked Pyramid Bar."""
|
||||
|
||||
PYRAMID_COL = (112, "3D Pyramid Column.")
|
||||
"""3D Pyramid Column."""
|
||||
|
||||
PYRAMID_COL_CLUSTERED = (106, "Clustered Pyramid Column.")
|
||||
"""Clustered Pyramid Column."""
|
||||
|
||||
PYRAMID_COL_STACKED = (107, "Stacked Pyramid Column.")
|
||||
"""Stacked Pyramid Column."""
|
||||
|
||||
PYRAMID_COL_STACKED_100 = (108, "100% Stacked Pyramid Column.")
|
||||
"""100% Stacked Pyramid Column."""
|
||||
|
||||
RADAR = (-4151, "Radar.")
|
||||
"""Radar."""
|
||||
|
||||
RADAR_FILLED = (82, "Filled Radar.")
|
||||
"""Filled Radar."""
|
||||
|
||||
RADAR_MARKERS = (81, "Radar with Data Markers.")
|
||||
"""Radar with Data Markers."""
|
||||
|
||||
STOCK_HLC = (88, "High-Low-Close.")
|
||||
"""High-Low-Close."""
|
||||
|
||||
STOCK_OHLC = (89, "Open-High-Low-Close.")
|
||||
"""Open-High-Low-Close."""
|
||||
|
||||
STOCK_VHLC = (90, "Volume-High-Low-Close.")
|
||||
"""Volume-High-Low-Close."""
|
||||
|
||||
STOCK_VOHLC = (91, "Volume-Open-High-Low-Close.")
|
||||
"""Volume-Open-High-Low-Close."""
|
||||
|
||||
SURFACE = (83, "3D Surface.")
|
||||
"""3D Surface."""
|
||||
|
||||
SURFACE_TOP_VIEW = (85, "Surface (Top View).")
|
||||
"""Surface (Top View)."""
|
||||
|
||||
SURFACE_TOP_VIEW_WIREFRAME = (86, "Surface (Top View wireframe).")
|
||||
"""Surface (Top View wireframe)."""
|
||||
|
||||
SURFACE_WIREFRAME = (84, "3D Surface (wireframe).")
|
||||
"""3D Surface (wireframe)."""
|
||||
|
||||
XY_SCATTER = (-4169, "Scatter.")
|
||||
"""Scatter."""
|
||||
|
||||
XY_SCATTER_LINES = (74, "Scatter with Lines.")
|
||||
"""Scatter with Lines."""
|
||||
|
||||
XY_SCATTER_LINES_NO_MARKERS = (75, "Scatter with Lines and No Data Markers.")
|
||||
"""Scatter with Lines and No Data Markers."""
|
||||
|
||||
XY_SCATTER_SMOOTH = (72, "Scatter with Smoothed Lines.")
|
||||
"""Scatter with Smoothed Lines."""
|
||||
|
||||
XY_SCATTER_SMOOTH_NO_MARKERS = (73, "Scatter with Smoothed Lines and No Data Markers.")
|
||||
"""Scatter with Smoothed Lines and No Data Markers."""
|
||||
|
||||
|
||||
class XL_DATA_LABEL_POSITION(BaseXmlEnum):
|
||||
"""Specifies where the data label is positioned.
|
||||
|
||||
Example::
|
||||
|
||||
from pptx.enum.chart import XL_LABEL_POSITION
|
||||
|
||||
data_labels = chart.plots[0].data_labels
|
||||
data_labels.position = XL_LABEL_POSITION.OUTSIDE_END
|
||||
|
||||
MS API Name: `XlDataLabelPosition`
|
||||
|
||||
http://msdn.microsoft.com/en-us/library/office/ff745082.aspx
|
||||
"""
|
||||
|
||||
ABOVE = (0, "t", "The data label is positioned above the data point.")
|
||||
"""The data label is positioned above the data point."""
|
||||
|
||||
BELOW = (1, "b", "The data label is positioned below the data point.")
|
||||
"""The data label is positioned below the data point."""
|
||||
|
||||
BEST_FIT = (5, "bestFit", "Word sets the position of the data label.")
|
||||
"""Word sets the position of the data label."""
|
||||
|
||||
CENTER = (
|
||||
-4108,
|
||||
"ctr",
|
||||
"The data label is centered on the data point or inside a bar or a pie slice.",
|
||||
)
|
||||
"""The data label is centered on the data point or inside a bar or a pie slice."""
|
||||
|
||||
INSIDE_BASE = (
|
||||
4,
|
||||
"inBase",
|
||||
"The data label is positioned inside the data point at the bottom edge.",
|
||||
)
|
||||
"""The data label is positioned inside the data point at the bottom edge."""
|
||||
|
||||
INSIDE_END = (3, "inEnd", "The data label is positioned inside the data point at the top edge.")
|
||||
"""The data label is positioned inside the data point at the top edge."""
|
||||
|
||||
LEFT = (-4131, "l", "The data label is positioned to the left of the data point.")
|
||||
"""The data label is positioned to the left of the data point."""
|
||||
|
||||
MIXED = (6, "", "Data labels are in multiple positions (read-only).")
|
||||
"""Data labels are in multiple positions (read-only)."""
|
||||
|
||||
OUTSIDE_END = (
|
||||
2,
|
||||
"outEnd",
|
||||
"The data label is positioned outside the data point at the top edge.",
|
||||
)
|
||||
"""The data label is positioned outside the data point at the top edge."""
|
||||
|
||||
RIGHT = (-4152, "r", "The data label is positioned to the right of the data point.")
|
||||
"""The data label is positioned to the right of the data point."""
|
||||
|
||||
|
||||
XL_LABEL_POSITION = XL_DATA_LABEL_POSITION
|
||||
|
||||
|
||||
class XL_LEGEND_POSITION(BaseXmlEnum):
|
||||
"""Specifies the position of the legend on a chart.
|
||||
|
||||
Example::
|
||||
|
||||
from pptx.enum.chart import XL_LEGEND_POSITION
|
||||
|
||||
chart.has_legend = True
|
||||
chart.legend.position = XL_LEGEND_POSITION.BOTTOM
|
||||
|
||||
MS API Name: `XlLegendPosition`
|
||||
|
||||
http://msdn.microsoft.com/en-us/library/office/ff745840.aspx
|
||||
"""
|
||||
|
||||
BOTTOM = (-4107, "b", "Below the chart.")
|
||||
"""Below the chart."""
|
||||
|
||||
CORNER = (2, "tr", "In the upper-right corner of the chart border.")
|
||||
"""In the upper-right corner of the chart border."""
|
||||
|
||||
CUSTOM = (-4161, "", "A custom position (read-only).")
|
||||
"""A custom position (read-only)."""
|
||||
|
||||
LEFT = (-4131, "l", "Left of the chart.")
|
||||
"""Left of the chart."""
|
||||
|
||||
RIGHT = (-4152, "r", "Right of the chart.")
|
||||
"""Right of the chart."""
|
||||
|
||||
TOP = (-4160, "t", "Above the chart.")
|
||||
"""Above the chart."""
|
||||
|
||||
|
||||
class XL_MARKER_STYLE(BaseXmlEnum):
|
||||
"""Specifies the marker style for a point or series in a line, scatter, or radar chart.
|
||||
|
||||
Example::
|
||||
|
||||
from pptx.enum.chart import XL_MARKER_STYLE
|
||||
|
||||
series.marker.style = XL_MARKER_STYLE.CIRCLE
|
||||
|
||||
MS API Name: `XlMarkerStyle`
|
||||
|
||||
http://msdn.microsoft.com/en-us/library/office/ff197219.aspx
|
||||
"""
|
||||
|
||||
AUTOMATIC = (-4105, "auto", "Automatic markers")
|
||||
"""Automatic markers"""
|
||||
|
||||
CIRCLE = (8, "circle", "Circular markers")
|
||||
"""Circular markers"""
|
||||
|
||||
DASH = (-4115, "dash", "Long bar markers")
|
||||
"""Long bar markers"""
|
||||
|
||||
DIAMOND = (2, "diamond", "Diamond-shaped markers")
|
||||
"""Diamond-shaped markers"""
|
||||
|
||||
DOT = (-4118, "dot", "Short bar markers")
|
||||
"""Short bar markers"""
|
||||
|
||||
NONE = (-4142, "none", "No markers")
|
||||
"""No markers"""
|
||||
|
||||
PICTURE = (-4147, "picture", "Picture markers")
|
||||
"""Picture markers"""
|
||||
|
||||
PLUS = (9, "plus", "Square markers with a plus sign")
|
||||
"""Square markers with a plus sign"""
|
||||
|
||||
SQUARE = (1, "square", "Square markers")
|
||||
"""Square markers"""
|
||||
|
||||
STAR = (5, "star", "Square markers with an asterisk")
|
||||
"""Square markers with an asterisk"""
|
||||
|
||||
TRIANGLE = (3, "triangle", "Triangular markers")
|
||||
"""Triangular markers"""
|
||||
|
||||
X = (-4168, "x", "Square markers with an X")
|
||||
"""Square markers with an X"""
|
||||
|
||||
|
||||
class XL_TICK_MARK(BaseXmlEnum):
|
||||
"""Specifies a type of axis tick for a chart.
|
||||
|
||||
Example::
|
||||
|
||||
from pptx.enum.chart import XL_TICK_MARK
|
||||
|
||||
chart.value_axis.minor_tick_mark = XL_TICK_MARK.INSIDE
|
||||
|
||||
MS API Name: `XlTickMark`
|
||||
|
||||
http://msdn.microsoft.com/en-us/library/office/ff193878.aspx
|
||||
"""
|
||||
|
||||
CROSS = (4, "cross", "Tick mark crosses the axis")
|
||||
"""Tick mark crosses the axis"""
|
||||
|
||||
INSIDE = (2, "in", "Tick mark appears inside the axis")
|
||||
"""Tick mark appears inside the axis"""
|
||||
|
||||
NONE = (-4142, "none", "No tick mark")
|
||||
"""No tick mark"""
|
||||
|
||||
OUTSIDE = (3, "out", "Tick mark appears outside the axis")
|
||||
"""Tick mark appears outside the axis"""
|
||||
|
||||
|
||||
class XL_TICK_LABEL_POSITION(BaseXmlEnum):
|
||||
"""Specifies the position of tick-mark labels on a chart axis.
|
||||
|
||||
Example::
|
||||
|
||||
from pptx.enum.chart import XL_TICK_LABEL_POSITION
|
||||
|
||||
category_axis = chart.category_axis
|
||||
category_axis.tick_label_position = XL_TICK_LABEL_POSITION.LOW
|
||||
|
||||
MS API Name: `XlTickLabelPosition`
|
||||
|
||||
http://msdn.microsoft.com/en-us/library/office/ff822561.aspx
|
||||
"""
|
||||
|
||||
HIGH = (-4127, "high", "Top or right side of the chart.")
|
||||
"""Top or right side of the chart."""
|
||||
|
||||
LOW = (-4134, "low", "Bottom or left side of the chart.")
|
||||
"""Bottom or left side of the chart."""
|
||||
|
||||
NEXT_TO_AXIS = (4, "nextTo", "Next to axis (where axis is not at either side of the chart).")
|
||||
"""Next to axis (where axis is not at either side of the chart)."""
|
||||
|
||||
NONE = (-4142, "none", "No tick labels.")
|
||||
"""No tick labels."""
|
||||
@@ -0,0 +1,405 @@
|
||||
"""Enumerations used by DrawingML objects."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from pptx.enum.base import BaseEnum, BaseXmlEnum
|
||||
|
||||
|
||||
class MSO_COLOR_TYPE(BaseEnum):
|
||||
"""
|
||||
Specifies the color specification scheme
|
||||
|
||||
Example::
|
||||
|
||||
from pptx.enum.dml import MSO_COLOR_TYPE
|
||||
|
||||
assert shape.fill.fore_color.type == MSO_COLOR_TYPE.SCHEME
|
||||
|
||||
MS API Name: "MsoColorType"
|
||||
|
||||
http://msdn.microsoft.com/en-us/library/office/ff864912(v=office.15).aspx
|
||||
"""
|
||||
|
||||
RGB = (1, "Color is specified by an |RGBColor| value.")
|
||||
"""Color is specified by an |RGBColor| value."""
|
||||
|
||||
SCHEME = (2, "Color is one of the preset theme colors")
|
||||
"""Color is one of the preset theme colors"""
|
||||
|
||||
HSL = (101, "Color is specified using Hue, Saturation, and Luminosity values")
|
||||
"""Color is specified using Hue, Saturation, and Luminosity values"""
|
||||
|
||||
PRESET = (102, "Color is specified using a named built-in color")
|
||||
"""Color is specified using a named built-in color"""
|
||||
|
||||
SCRGB = (103, "Color is an scRGB color, a wide color gamut RGB color space")
|
||||
"""Color is an scRGB color, a wide color gamut RGB color space"""
|
||||
|
||||
SYSTEM = (
|
||||
104,
|
||||
"Color is one specified by the operating system, such as the window background color.",
|
||||
)
|
||||
"""Color is one specified by the operating system, such as the window background color."""
|
||||
|
||||
|
||||
class MSO_FILL_TYPE(BaseEnum):
|
||||
"""
|
||||
Specifies the type of bitmap used for the fill of a shape.
|
||||
|
||||
Alias: ``MSO_FILL``
|
||||
|
||||
Example::
|
||||
|
||||
from pptx.enum.dml import MSO_FILL
|
||||
|
||||
assert shape.fill.type == MSO_FILL.SOLID
|
||||
|
||||
MS API Name: `MsoFillType`
|
||||
|
||||
http://msdn.microsoft.com/EN-US/library/office/ff861408.aspx
|
||||
"""
|
||||
|
||||
BACKGROUND = (
|
||||
5,
|
||||
"The shape is transparent, such that whatever is behind the shape shows through."
|
||||
" Often this is the slide background, but if a visible shape is behind, that will"
|
||||
" show through.",
|
||||
)
|
||||
"""The shape is transparent, such that whatever is behind the shape shows through.
|
||||
|
||||
Often this is the slide background, but if a visible shape is behind, that will show through.
|
||||
"""
|
||||
|
||||
GRADIENT = (3, "Shape is filled with a gradient")
|
||||
"""Shape is filled with a gradient"""
|
||||
|
||||
GROUP = (101, "Shape is part of a group and should inherit the fill properties of the group.")
|
||||
"""Shape is part of a group and should inherit the fill properties of the group."""
|
||||
|
||||
PATTERNED = (2, "Shape is filled with a pattern")
|
||||
"""Shape is filled with a pattern"""
|
||||
|
||||
PICTURE = (6, "Shape is filled with a bitmapped image")
|
||||
"""Shape is filled with a bitmapped image"""
|
||||
|
||||
SOLID = (1, "Shape is filled with a solid color")
|
||||
"""Shape is filled with a solid color"""
|
||||
|
||||
TEXTURED = (4, "Shape is filled with a texture")
|
||||
"""Shape is filled with a texture"""
|
||||
|
||||
|
||||
MSO_FILL = MSO_FILL_TYPE
|
||||
|
||||
|
||||
class MSO_LINE_DASH_STYLE(BaseXmlEnum):
|
||||
"""Specifies the dash style for a line.
|
||||
|
||||
Alias: ``MSO_LINE``
|
||||
|
||||
Example::
|
||||
|
||||
from pptx.enum.dml import MSO_LINE
|
||||
|
||||
shape.line.dash_style = MSO_LINE.DASH_DOT_DOT
|
||||
|
||||
MS API name: `MsoLineDashStyle`
|
||||
|
||||
https://learn.microsoft.com/en-us/office/vba/api/Office.MsoLineDashStyle
|
||||
"""
|
||||
|
||||
DASH = (4, "dash", "Line consists of dashes only.")
|
||||
"""Line consists of dashes only."""
|
||||
|
||||
DASH_DOT = (5, "dashDot", "Line is a dash-dot pattern.")
|
||||
"""Line is a dash-dot pattern."""
|
||||
|
||||
DASH_DOT_DOT = (6, "lgDashDotDot", "Line is a dash-dot-dot pattern.")
|
||||
"""Line is a dash-dot-dot pattern."""
|
||||
|
||||
LONG_DASH = (7, "lgDash", "Line consists of long dashes.")
|
||||
"""Line consists of long dashes."""
|
||||
|
||||
LONG_DASH_DOT = (8, "lgDashDot", "Line is a long dash-dot pattern.")
|
||||
"""Line is a long dash-dot pattern."""
|
||||
|
||||
ROUND_DOT = (3, "sysDot", "Line is made up of round dots.")
|
||||
"""Line is made up of round dots."""
|
||||
|
||||
SOLID = (1, "solid", "Line is solid.")
|
||||
"""Line is solid."""
|
||||
|
||||
SQUARE_DOT = (2, "sysDash", "Line is made up of square dots.")
|
||||
"""Line is made up of square dots."""
|
||||
|
||||
DASH_STYLE_MIXED = (-2, "", "Not supported.")
|
||||
"""Return value only, indicating more than one dash style applies."""
|
||||
|
||||
|
||||
MSO_LINE = MSO_LINE_DASH_STYLE
|
||||
|
||||
|
||||
class MSO_PATTERN_TYPE(BaseXmlEnum):
|
||||
"""Specifies the fill pattern used in a shape.
|
||||
|
||||
Alias: ``MSO_PATTERN``
|
||||
|
||||
Example::
|
||||
|
||||
from pptx.enum.dml import MSO_PATTERN
|
||||
|
||||
fill = shape.fill
|
||||
fill.patterned()
|
||||
fill.pattern = MSO_PATTERN.WAVE
|
||||
|
||||
MS API Name: `MsoPatternType`
|
||||
|
||||
https://learn.microsoft.com/en-us/office/vba/api/Office.MsoPatternType
|
||||
"""
|
||||
|
||||
CROSS = (51, "cross", "Cross")
|
||||
"""Cross"""
|
||||
|
||||
DARK_DOWNWARD_DIAGONAL = (15, "dkDnDiag", "Dark Downward Diagonal")
|
||||
"""Dark Downward Diagonal"""
|
||||
|
||||
DARK_HORIZONTAL = (13, "dkHorz", "Dark Horizontal")
|
||||
"""Dark Horizontal"""
|
||||
|
||||
DARK_UPWARD_DIAGONAL = (16, "dkUpDiag", "Dark Upward Diagonal")
|
||||
"""Dark Upward Diagonal"""
|
||||
|
||||
DARK_VERTICAL = (14, "dkVert", "Dark Vertical")
|
||||
"""Dark Vertical"""
|
||||
|
||||
DASHED_DOWNWARD_DIAGONAL = (28, "dashDnDiag", "Dashed Downward Diagonal")
|
||||
"""Dashed Downward Diagonal"""
|
||||
|
||||
DASHED_HORIZONTAL = (32, "dashHorz", "Dashed Horizontal")
|
||||
"""Dashed Horizontal"""
|
||||
|
||||
DASHED_UPWARD_DIAGONAL = (27, "dashUpDiag", "Dashed Upward Diagonal")
|
||||
"""Dashed Upward Diagonal"""
|
||||
|
||||
DASHED_VERTICAL = (31, "dashVert", "Dashed Vertical")
|
||||
"""Dashed Vertical"""
|
||||
|
||||
DIAGONAL_BRICK = (40, "diagBrick", "Diagonal Brick")
|
||||
"""Diagonal Brick"""
|
||||
|
||||
DIAGONAL_CROSS = (54, "diagCross", "Diagonal Cross")
|
||||
"""Diagonal Cross"""
|
||||
|
||||
DIVOT = (46, "divot", "Pattern Divot")
|
||||
"""Pattern Divot"""
|
||||
|
||||
DOTTED_DIAMOND = (24, "dotDmnd", "Dotted Diamond")
|
||||
"""Dotted Diamond"""
|
||||
|
||||
DOTTED_GRID = (45, "dotGrid", "Dotted Grid")
|
||||
"""Dotted Grid"""
|
||||
|
||||
DOWNWARD_DIAGONAL = (52, "dnDiag", "Downward Diagonal")
|
||||
"""Downward Diagonal"""
|
||||
|
||||
HORIZONTAL = (49, "horz", "Horizontal")
|
||||
"""Horizontal"""
|
||||
|
||||
HORIZONTAL_BRICK = (35, "horzBrick", "Horizontal Brick")
|
||||
"""Horizontal Brick"""
|
||||
|
||||
LARGE_CHECKER_BOARD = (36, "lgCheck", "Large Checker Board")
|
||||
"""Large Checker Board"""
|
||||
|
||||
LARGE_CONFETTI = (33, "lgConfetti", "Large Confetti")
|
||||
"""Large Confetti"""
|
||||
|
||||
LARGE_GRID = (34, "lgGrid", "Large Grid")
|
||||
"""Large Grid"""
|
||||
|
||||
LIGHT_DOWNWARD_DIAGONAL = (21, "ltDnDiag", "Light Downward Diagonal")
|
||||
"""Light Downward Diagonal"""
|
||||
|
||||
LIGHT_HORIZONTAL = (19, "ltHorz", "Light Horizontal")
|
||||
"""Light Horizontal"""
|
||||
|
||||
LIGHT_UPWARD_DIAGONAL = (22, "ltUpDiag", "Light Upward Diagonal")
|
||||
"""Light Upward Diagonal"""
|
||||
|
||||
LIGHT_VERTICAL = (20, "ltVert", "Light Vertical")
|
||||
"""Light Vertical"""
|
||||
|
||||
NARROW_HORIZONTAL = (30, "narHorz", "Narrow Horizontal")
|
||||
"""Narrow Horizontal"""
|
||||
|
||||
NARROW_VERTICAL = (29, "narVert", "Narrow Vertical")
|
||||
"""Narrow Vertical"""
|
||||
|
||||
OUTLINED_DIAMOND = (41, "openDmnd", "Outlined Diamond")
|
||||
"""Outlined Diamond"""
|
||||
|
||||
PERCENT_10 = (2, "pct10", "10% of the foreground color.")
|
||||
"""10% of the foreground color."""
|
||||
|
||||
PERCENT_20 = (3, "pct20", "20% of the foreground color.")
|
||||
"""20% of the foreground color."""
|
||||
|
||||
PERCENT_25 = (4, "pct25", "25% of the foreground color.")
|
||||
"""25% of the foreground color."""
|
||||
|
||||
PERCENT_30 = (5, "pct30", "30% of the foreground color.")
|
||||
"""30% of the foreground color."""
|
||||
|
||||
ERCENT_40 = (6, "pct40", "40% of the foreground color.")
|
||||
"""40% of the foreground color."""
|
||||
|
||||
PERCENT_5 = (1, "pct5", "5% of the foreground color.")
|
||||
"""5% of the foreground color."""
|
||||
|
||||
PERCENT_50 = (7, "pct50", "50% of the foreground color.")
|
||||
"""50% of the foreground color."""
|
||||
|
||||
PERCENT_60 = (8, "pct60", "60% of the foreground color.")
|
||||
"""60% of the foreground color."""
|
||||
|
||||
PERCENT_70 = (9, "pct70", "70% of the foreground color.")
|
||||
"""70% of the foreground color."""
|
||||
|
||||
PERCENT_75 = (10, "pct75", "75% of the foreground color.")
|
||||
"""75% of the foreground color."""
|
||||
|
||||
PERCENT_80 = (11, "pct80", "80% of the foreground color.")
|
||||
"""80% of the foreground color."""
|
||||
|
||||
PERCENT_90 = (12, "pct90", "90% of the foreground color.")
|
||||
"""90% of the foreground color."""
|
||||
|
||||
PLAID = (42, "plaid", "Plaid")
|
||||
"""Plaid"""
|
||||
|
||||
SHINGLE = (47, "shingle", "Shingle")
|
||||
"""Shingle"""
|
||||
|
||||
SMALL_CHECKER_BOARD = (17, "smCheck", "Small Checker Board")
|
||||
"""Small Checker Board"""
|
||||
|
||||
SMALL_CONFETTI = (37, "smConfetti", "Small Confetti")
|
||||
"""Small Confetti"""
|
||||
|
||||
SMALL_GRID = (23, "smGrid", "Small Grid")
|
||||
"""Small Grid"""
|
||||
|
||||
SOLID_DIAMOND = (39, "solidDmnd", "Solid Diamond")
|
||||
"""Solid Diamond"""
|
||||
|
||||
SPHERE = (43, "sphere", "Sphere")
|
||||
"""Sphere"""
|
||||
|
||||
TRELLIS = (18, "trellis", "Trellis")
|
||||
"""Trellis"""
|
||||
|
||||
UPWARD_DIAGONAL = (53, "upDiag", "Upward Diagonal")
|
||||
"""Upward Diagonal"""
|
||||
|
||||
VERTICAL = (50, "vert", "Vertical")
|
||||
"""Vertical"""
|
||||
|
||||
WAVE = (48, "wave", "Wave")
|
||||
"""Wave"""
|
||||
|
||||
WEAVE = (44, "weave", "Weave")
|
||||
"""Weave"""
|
||||
|
||||
WIDE_DOWNWARD_DIAGONAL = (25, "wdDnDiag", "Wide Downward Diagonal")
|
||||
"""Wide Downward Diagonal"""
|
||||
|
||||
WIDE_UPWARD_DIAGONAL = (26, "wdUpDiag", "Wide Upward Diagonal")
|
||||
"""Wide Upward Diagonal"""
|
||||
|
||||
ZIG_ZAG = (38, "zigZag", "Zig Zag")
|
||||
"""Zig Zag"""
|
||||
|
||||
MIXED = (-2, "", "Mixed pattern (read-only).")
|
||||
"""Mixed pattern (read-only)."""
|
||||
|
||||
|
||||
MSO_PATTERN = MSO_PATTERN_TYPE
|
||||
|
||||
|
||||
class MSO_THEME_COLOR_INDEX(BaseXmlEnum):
|
||||
"""An Office theme color, one of those shown in the color gallery on the formatting ribbon.
|
||||
|
||||
Alias: ``MSO_THEME_COLOR``
|
||||
|
||||
Example::
|
||||
|
||||
from pptx.enum.dml import MSO_THEME_COLOR
|
||||
|
||||
shape.fill.solid()
|
||||
shape.fill.fore_color.theme_color = MSO_THEME_COLOR.ACCENT_1
|
||||
|
||||
MS API Name: `MsoThemeColorIndex`
|
||||
|
||||
http://msdn.microsoft.com/en-us/library/office/ff860782(v=office.15).aspx
|
||||
"""
|
||||
|
||||
NOT_THEME_COLOR = (0, "", "Indicates the color is not a theme color.")
|
||||
"""Indicates the color is not a theme color."""
|
||||
|
||||
ACCENT_1 = (5, "accent1", "Specifies the Accent 1 theme color.")
|
||||
"""Specifies the Accent 1 theme color."""
|
||||
|
||||
ACCENT_2 = (6, "accent2", "Specifies the Accent 2 theme color.")
|
||||
"""Specifies the Accent 2 theme color."""
|
||||
|
||||
ACCENT_3 = (7, "accent3", "Specifies the Accent 3 theme color.")
|
||||
"""Specifies the Accent 3 theme color."""
|
||||
|
||||
ACCENT_4 = (8, "accent4", "Specifies the Accent 4 theme color.")
|
||||
"""Specifies the Accent 4 theme color."""
|
||||
|
||||
ACCENT_5 = (9, "accent5", "Specifies the Accent 5 theme color.")
|
||||
"""Specifies the Accent 5 theme color."""
|
||||
|
||||
ACCENT_6 = (10, "accent6", "Specifies the Accent 6 theme color.")
|
||||
"""Specifies the Accent 6 theme color."""
|
||||
|
||||
BACKGROUND_1 = (14, "bg1", "Specifies the Background 1 theme color.")
|
||||
"""Specifies the Background 1 theme color."""
|
||||
|
||||
BACKGROUND_2 = (16, "bg2", "Specifies the Background 2 theme color.")
|
||||
"""Specifies the Background 2 theme color."""
|
||||
|
||||
DARK_1 = (1, "dk1", "Specifies the Dark 1 theme color.")
|
||||
"""Specifies the Dark 1 theme color."""
|
||||
|
||||
DARK_2 = (3, "dk2", "Specifies the Dark 2 theme color.")
|
||||
"""Specifies the Dark 2 theme color."""
|
||||
|
||||
FOLLOWED_HYPERLINK = (12, "folHlink", "Specifies the theme color for a clicked hyperlink.")
|
||||
"""Specifies the theme color for a clicked hyperlink."""
|
||||
|
||||
HYPERLINK = (11, "hlink", "Specifies the theme color for a hyperlink.")
|
||||
"""Specifies the theme color for a hyperlink."""
|
||||
|
||||
LIGHT_1 = (2, "lt1", "Specifies the Light 1 theme color.")
|
||||
"""Specifies the Light 1 theme color."""
|
||||
|
||||
LIGHT_2 = (4, "lt2", "Specifies the Light 2 theme color.")
|
||||
"""Specifies the Light 2 theme color."""
|
||||
|
||||
TEXT_1 = (13, "tx1", "Specifies the Text 1 theme color.")
|
||||
"""Specifies the Text 1 theme color."""
|
||||
|
||||
TEXT_2 = (15, "tx2", "Specifies the Text 2 theme color.")
|
||||
"""Specifies the Text 2 theme color."""
|
||||
|
||||
MIXED = (
|
||||
-2,
|
||||
"",
|
||||
"Indicates multiple theme colors are used, such as in a group shape (read-only).",
|
||||
)
|
||||
"""Indicates multiple theme colors are used, such as in a group shape (read-only)."""
|
||||
|
||||
|
||||
MSO_THEME_COLOR = MSO_THEME_COLOR_INDEX
|
||||
@@ -0,0 +1,685 @@
|
||||
"""Enumerations used for specifying language."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from pptx.enum.base import BaseXmlEnum
|
||||
|
||||
|
||||
class MSO_LANGUAGE_ID(BaseXmlEnum):
|
||||
"""
|
||||
Specifies the language identifier.
|
||||
|
||||
Example::
|
||||
|
||||
from pptx.enum.lang import MSO_LANGUAGE_ID
|
||||
|
||||
font.language_id = MSO_LANGUAGE_ID.POLISH
|
||||
|
||||
MS API Name: `MsoLanguageId`
|
||||
|
||||
https://msdn.microsoft.com/en-us/library/office/ff862134.aspx
|
||||
"""
|
||||
|
||||
NONE = (0, "", "No language specified.")
|
||||
"""No language specified."""
|
||||
|
||||
AFRIKAANS = (1078, "af-ZA", "The Afrikaans language.")
|
||||
"""The Afrikaans language."""
|
||||
|
||||
ALBANIAN = (1052, "sq-AL", "The Albanian language.")
|
||||
"""The Albanian language."""
|
||||
|
||||
AMHARIC = (1118, "am-ET", "The Amharic language.")
|
||||
"""The Amharic language."""
|
||||
|
||||
ARABIC = (1025, "ar-SA", "The Arabic language.")
|
||||
"""The Arabic language."""
|
||||
|
||||
ARABIC_ALGERIA = (5121, "ar-DZ", "The Arabic Algeria language.")
|
||||
"""The Arabic Algeria language."""
|
||||
|
||||
ARABIC_BAHRAIN = (15361, "ar-BH", "The Arabic Bahrain language.")
|
||||
"""The Arabic Bahrain language."""
|
||||
|
||||
ARABIC_EGYPT = (3073, "ar-EG", "The Arabic Egypt language.")
|
||||
"""The Arabic Egypt language."""
|
||||
|
||||
ARABIC_IRAQ = (2049, "ar-IQ", "The Arabic Iraq language.")
|
||||
"""The Arabic Iraq language."""
|
||||
|
||||
ARABIC_JORDAN = (11265, "ar-JO", "The Arabic Jordan language.")
|
||||
"""The Arabic Jordan language."""
|
||||
|
||||
ARABIC_KUWAIT = (13313, "ar-KW", "The Arabic Kuwait language.")
|
||||
"""The Arabic Kuwait language."""
|
||||
|
||||
ARABIC_LEBANON = (12289, "ar-LB", "The Arabic Lebanon language.")
|
||||
"""The Arabic Lebanon language."""
|
||||
|
||||
ARABIC_LIBYA = (4097, "ar-LY", "The Arabic Libya language.")
|
||||
"""The Arabic Libya language."""
|
||||
|
||||
ARABIC_MOROCCO = (6145, "ar-MA", "The Arabic Morocco language.")
|
||||
"""The Arabic Morocco language."""
|
||||
|
||||
ARABIC_OMAN = (8193, "ar-OM", "The Arabic Oman language.")
|
||||
"""The Arabic Oman language."""
|
||||
|
||||
ARABIC_QATAR = (16385, "ar-QA", "The Arabic Qatar language.")
|
||||
"""The Arabic Qatar language."""
|
||||
|
||||
ARABIC_SYRIA = (10241, "ar-SY", "The Arabic Syria language.")
|
||||
"""The Arabic Syria language."""
|
||||
|
||||
ARABIC_TUNISIA = (7169, "ar-TN", "The Arabic Tunisia language.")
|
||||
"""The Arabic Tunisia language."""
|
||||
|
||||
ARABIC_UAE = (14337, "ar-AE", "The Arabic UAE language.")
|
||||
"""The Arabic UAE language."""
|
||||
|
||||
ARABIC_YEMEN = (9217, "ar-YE", "The Arabic Yemen language.")
|
||||
"""The Arabic Yemen language."""
|
||||
|
||||
ARMENIAN = (1067, "hy-AM", "The Armenian language.")
|
||||
"""The Armenian language."""
|
||||
|
||||
ASSAMESE = (1101, "as-IN", "The Assamese language.")
|
||||
"""The Assamese language."""
|
||||
|
||||
AZERI_CYRILLIC = (2092, "az-AZ", "The Azeri Cyrillic language.")
|
||||
"""The Azeri Cyrillic language."""
|
||||
|
||||
AZERI_LATIN = (1068, "az-Latn-AZ", "The Azeri Latin language.")
|
||||
"""The Azeri Latin language."""
|
||||
|
||||
BASQUE = (1069, "eu-ES", "The Basque language.")
|
||||
"""The Basque language."""
|
||||
|
||||
BELGIAN_DUTCH = (2067, "nl-BE", "The Belgian Dutch language.")
|
||||
"""The Belgian Dutch language."""
|
||||
|
||||
BELGIAN_FRENCH = (2060, "fr-BE", "The Belgian French language.")
|
||||
"""The Belgian French language."""
|
||||
|
||||
BENGALI = (1093, "bn-IN", "The Bengali language.")
|
||||
"""The Bengali language."""
|
||||
|
||||
BOSNIAN = (4122, "hr-BA", "The Bosnian language.")
|
||||
"""The Bosnian language."""
|
||||
|
||||
BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC = (
|
||||
8218,
|
||||
"bs-BA",
|
||||
"The Bosnian Bosnia Herzegovina Cyrillic language.",
|
||||
)
|
||||
"""The Bosnian Bosnia Herzegovina Cyrillic language."""
|
||||
|
||||
BOSNIAN_BOSNIA_HERZEGOVINA_LATIN = (
|
||||
5146,
|
||||
"bs-Latn-BA",
|
||||
"The Bosnian Bosnia Herzegovina Latin language.",
|
||||
)
|
||||
"""The Bosnian Bosnia Herzegovina Latin language."""
|
||||
|
||||
BRAZILIAN_PORTUGUESE = (1046, "pt-BR", "The Brazilian Portuguese language.")
|
||||
"""The Brazilian Portuguese language."""
|
||||
|
||||
BULGARIAN = (1026, "bg-BG", "The Bulgarian language.")
|
||||
"""The Bulgarian language."""
|
||||
|
||||
BURMESE = (1109, "my-MM", "The Burmese language.")
|
||||
"""The Burmese language."""
|
||||
|
||||
BYELORUSSIAN = (1059, "be-BY", "The Byelorussian language.")
|
||||
"""The Byelorussian language."""
|
||||
|
||||
CATALAN = (1027, "ca-ES", "The Catalan language.")
|
||||
"""The Catalan language."""
|
||||
|
||||
CHEROKEE = (1116, "chr-US", "The Cherokee language.")
|
||||
"""The Cherokee language."""
|
||||
|
||||
CHINESE_HONG_KONG_SAR = (3076, "zh-HK", "The Chinese Hong Kong SAR language.")
|
||||
"""The Chinese Hong Kong SAR language."""
|
||||
|
||||
CHINESE_MACAO_SAR = (5124, "zh-MO", "The Chinese Macao SAR language.")
|
||||
"""The Chinese Macao SAR language."""
|
||||
|
||||
CHINESE_SINGAPORE = (4100, "zh-SG", "The Chinese Singapore language.")
|
||||
"""The Chinese Singapore language."""
|
||||
|
||||
CROATIAN = (1050, "hr-HR", "The Croatian language.")
|
||||
"""The Croatian language."""
|
||||
|
||||
CZECH = (1029, "cs-CZ", "The Czech language.")
|
||||
"""The Czech language."""
|
||||
|
||||
DANISH = (1030, "da-DK", "The Danish language.")
|
||||
"""The Danish language."""
|
||||
|
||||
DIVEHI = (1125, "div-MV", "The Divehi language.")
|
||||
"""The Divehi language."""
|
||||
|
||||
DUTCH = (1043, "nl-NL", "The Dutch language.")
|
||||
"""The Dutch language."""
|
||||
|
||||
EDO = (1126, "bin-NG", "The Edo language.")
|
||||
"""The Edo language."""
|
||||
|
||||
ENGLISH_AUS = (3081, "en-AU", "The English AUS language.")
|
||||
"""The English AUS language."""
|
||||
|
||||
ENGLISH_BELIZE = (10249, "en-BZ", "The English Belize language.")
|
||||
"""The English Belize language."""
|
||||
|
||||
ENGLISH_CANADIAN = (4105, "en-CA", "The English Canadian language.")
|
||||
"""The English Canadian language."""
|
||||
|
||||
ENGLISH_CARIBBEAN = (9225, "en-CB", "The English Caribbean language.")
|
||||
"""The English Caribbean language."""
|
||||
|
||||
ENGLISH_INDONESIA = (14345, "en-ID", "The English Indonesia language.")
|
||||
"""The English Indonesia language."""
|
||||
|
||||
ENGLISH_IRELAND = (6153, "en-IE", "The English Ireland language.")
|
||||
"""The English Ireland language."""
|
||||
|
||||
ENGLISH_JAMAICA = (8201, "en-JA", "The English Jamaica language.")
|
||||
"""The English Jamaica language."""
|
||||
|
||||
ENGLISH_NEW_ZEALAND = (5129, "en-NZ", "The English NewZealand language.")
|
||||
"""The English NewZealand language."""
|
||||
|
||||
ENGLISH_PHILIPPINES = (13321, "en-PH", "The English Philippines language.")
|
||||
"""The English Philippines language."""
|
||||
|
||||
ENGLISH_SOUTH_AFRICA = (7177, "en-ZA", "The English South Africa language.")
|
||||
"""The English South Africa language."""
|
||||
|
||||
ENGLISH_TRINIDAD_TOBAGO = (11273, "en-TT", "The English Trinidad Tobago language.")
|
||||
"""The English Trinidad Tobago language."""
|
||||
|
||||
ENGLISH_UK = (2057, "en-GB", "The English UK language.")
|
||||
"""The English UK language."""
|
||||
|
||||
ENGLISH_US = (1033, "en-US", "The English US language.")
|
||||
"""The English US language."""
|
||||
|
||||
ENGLISH_ZIMBABWE = (12297, "en-ZW", "The English Zimbabwe language.")
|
||||
"""The English Zimbabwe language."""
|
||||
|
||||
ESTONIAN = (1061, "et-EE", "The Estonian language.")
|
||||
"""The Estonian language."""
|
||||
|
||||
FAEROESE = (1080, "fo-FO", "The Faeroese language.")
|
||||
"""The Faeroese language."""
|
||||
|
||||
FARSI = (1065, "fa-IR", "The Farsi language.")
|
||||
"""The Farsi language."""
|
||||
|
||||
FILIPINO = (1124, "fil-PH", "The Filipino language.")
|
||||
"""The Filipino language."""
|
||||
|
||||
FINNISH = (1035, "fi-FI", "The Finnish language.")
|
||||
"""The Finnish language."""
|
||||
|
||||
FRANCH_CONGO_DRC = (9228, "fr-CD", "The French Congo DRC language.")
|
||||
"""The French Congo DRC language."""
|
||||
|
||||
FRENCH = (1036, "fr-FR", "The French language.")
|
||||
"""The French language."""
|
||||
|
||||
FRENCH_CAMEROON = (11276, "fr-CM", "The French Cameroon language.")
|
||||
"""The French Cameroon language."""
|
||||
|
||||
FRENCH_CANADIAN = (3084, "fr-CA", "The French Canadian language.")
|
||||
"""The French Canadian language."""
|
||||
|
||||
FRENCH_COTED_IVOIRE = (12300, "fr-CI", "The French Coted Ivoire language.")
|
||||
"""The French Coted Ivoire language."""
|
||||
|
||||
FRENCH_HAITI = (15372, "fr-HT", "The French Haiti language.")
|
||||
"""The French Haiti language."""
|
||||
|
||||
FRENCH_LUXEMBOURG = (5132, "fr-LU", "The French Luxembourg language.")
|
||||
"""The French Luxembourg language."""
|
||||
|
||||
FRENCH_MALI = (13324, "fr-ML", "The French Mali language.")
|
||||
"""The French Mali language."""
|
||||
|
||||
FRENCH_MONACO = (6156, "fr-MC", "The French Monaco language.")
|
||||
"""The French Monaco language."""
|
||||
|
||||
FRENCH_MOROCCO = (14348, "fr-MA", "The French Morocco language.")
|
||||
"""The French Morocco language."""
|
||||
|
||||
FRENCH_REUNION = (8204, "fr-RE", "The French Reunion language.")
|
||||
"""The French Reunion language."""
|
||||
|
||||
FRENCH_SENEGAL = (10252, "fr-SN", "The French Senegal language.")
|
||||
"""The French Senegal language."""
|
||||
|
||||
FRENCH_WEST_INDIES = (7180, "fr-WINDIES", "The French West Indies language.")
|
||||
"""The French West Indies language."""
|
||||
|
||||
FRISIAN_NETHERLANDS = (1122, "fy-NL", "The Frisian Netherlands language.")
|
||||
"""The Frisian Netherlands language."""
|
||||
|
||||
FULFULDE = (1127, "ff-NG", "The Fulfulde language.")
|
||||
"""The Fulfulde language."""
|
||||
|
||||
GAELIC_IRELAND = (2108, "ga-IE", "The Gaelic Ireland language.")
|
||||
"""The Gaelic Ireland language."""
|
||||
|
||||
GAELIC_SCOTLAND = (1084, "en-US", "The Gaelic Scotland language.")
|
||||
"""The Gaelic Scotland language."""
|
||||
|
||||
GALICIAN = (1110, "gl-ES", "The Galician language.")
|
||||
"""The Galician language."""
|
||||
|
||||
GEORGIAN = (1079, "ka-GE", "The Georgian language.")
|
||||
"""The Georgian language."""
|
||||
|
||||
GERMAN = (1031, "de-DE", "The German language.")
|
||||
"""The German language."""
|
||||
|
||||
GERMAN_AUSTRIA = (3079, "de-AT", "The German Austria language.")
|
||||
"""The German Austria language."""
|
||||
|
||||
GERMAN_LIECHTENSTEIN = (5127, "de-LI", "The German Liechtenstein language.")
|
||||
"""The German Liechtenstein language."""
|
||||
|
||||
GERMAN_LUXEMBOURG = (4103, "de-LU", "The German Luxembourg language.")
|
||||
"""The German Luxembourg language."""
|
||||
|
||||
GREEK = (1032, "el-GR", "The Greek language.")
|
||||
"""The Greek language."""
|
||||
|
||||
GUARANI = (1140, "gn-PY", "The Guarani language.")
|
||||
"""The Guarani language."""
|
||||
|
||||
GUJARATI = (1095, "gu-IN", "The Gujarati language.")
|
||||
"""The Gujarati language."""
|
||||
|
||||
HAUSA = (1128, "ha-NG", "The Hausa language.")
|
||||
"""The Hausa language."""
|
||||
|
||||
HAWAIIAN = (1141, "haw-US", "The Hawaiian language.")
|
||||
"""The Hawaiian language."""
|
||||
|
||||
HEBREW = (1037, "he-IL", "The Hebrew language.")
|
||||
"""The Hebrew language."""
|
||||
|
||||
HINDI = (1081, "hi-IN", "The Hindi language.")
|
||||
"""The Hindi language."""
|
||||
|
||||
HUNGARIAN = (1038, "hu-HU", "The Hungarian language.")
|
||||
"""The Hungarian language."""
|
||||
|
||||
IBIBIO = (1129, "ibb-NG", "The Ibibio language.")
|
||||
"""The Ibibio language."""
|
||||
|
||||
ICELANDIC = (1039, "is-IS", "The Icelandic language.")
|
||||
"""The Icelandic language."""
|
||||
|
||||
IGBO = (1136, "ig-NG", "The Igbo language.")
|
||||
"""The Igbo language."""
|
||||
|
||||
INDONESIAN = (1057, "id-ID", "The Indonesian language.")
|
||||
"""The Indonesian language."""
|
||||
|
||||
INUKTITUT = (1117, "iu-Cans-CA", "The Inuktitut language.")
|
||||
"""The Inuktitut language."""
|
||||
|
||||
ITALIAN = (1040, "it-IT", "The Italian language.")
|
||||
"""The Italian language."""
|
||||
|
||||
JAPANESE = (1041, "ja-JP", "The Japanese language.")
|
||||
"""The Japanese language."""
|
||||
|
||||
KANNADA = (1099, "kn-IN", "The Kannada language.")
|
||||
"""The Kannada language."""
|
||||
|
||||
KANURI = (1137, "kr-NG", "The Kanuri language.")
|
||||
"""The Kanuri language."""
|
||||
|
||||
KASHMIRI = (1120, "ks-Arab", "The Kashmiri language.")
|
||||
"""The Kashmiri language."""
|
||||
|
||||
KASHMIRI_DEVANAGARI = (2144, "ks-Deva", "The Kashmiri Devanagari language.")
|
||||
"""The Kashmiri Devanagari language."""
|
||||
|
||||
KAZAKH = (1087, "kk-KZ", "The Kazakh language.")
|
||||
"""The Kazakh language."""
|
||||
|
||||
KHMER = (1107, "kh-KH", "The Khmer language.")
|
||||
"""The Khmer language."""
|
||||
|
||||
KIRGHIZ = (1088, "ky-KG", "The Kirghiz language.")
|
||||
"""The Kirghiz language."""
|
||||
|
||||
KONKANI = (1111, "kok-IN", "The Konkani language.")
|
||||
"""The Konkani language."""
|
||||
|
||||
KOREAN = (1042, "ko-KR", "The Korean language.")
|
||||
"""The Korean language."""
|
||||
|
||||
KYRGYZ = (1088, "ky-KG", "The Kyrgyz language.")
|
||||
"""The Kyrgyz language."""
|
||||
|
||||
LAO = (1108, "lo-LA", "The Lao language.")
|
||||
"""The Lao language."""
|
||||
|
||||
LATIN = (1142, "la-Latn", "The Latin language.")
|
||||
"""The Latin language."""
|
||||
|
||||
LATVIAN = (1062, "lv-LV", "The Latvian language.")
|
||||
"""The Latvian language."""
|
||||
|
||||
LITHUANIAN = (1063, "lt-LT", "The Lithuanian language.")
|
||||
"""The Lithuanian language."""
|
||||
|
||||
MACEDONINAN_FYROM = (1071, "mk-MK", "The Macedonian FYROM language.")
|
||||
"""The Macedonian FYROM language."""
|
||||
|
||||
MALAY_BRUNEI_DARUSSALAM = (2110, "ms-BN", "The Malay Brunei Darussalam language.")
|
||||
"""The Malay Brunei Darussalam language."""
|
||||
|
||||
MALAYALAM = (1100, "ml-IN", "The Malayalam language.")
|
||||
"""The Malayalam language."""
|
||||
|
||||
MALAYSIAN = (1086, "ms-MY", "The Malaysian language.")
|
||||
"""The Malaysian language."""
|
||||
|
||||
MALTESE = (1082, "mt-MT", "The Maltese language.")
|
||||
"""The Maltese language."""
|
||||
|
||||
MANIPURI = (1112, "mni-IN", "The Manipuri language.")
|
||||
"""The Manipuri language."""
|
||||
|
||||
MAORI = (1153, "mi-NZ", "The Maori language.")
|
||||
"""The Maori language."""
|
||||
|
||||
MARATHI = (1102, "mr-IN", "The Marathi language.")
|
||||
"""The Marathi language."""
|
||||
|
||||
MEXICAN_SPANISH = (2058, "es-MX", "The Mexican Spanish language.")
|
||||
"""The Mexican Spanish language."""
|
||||
|
||||
MONGOLIAN = (1104, "mn-MN", "The Mongolian language.")
|
||||
"""The Mongolian language."""
|
||||
|
||||
NEPALI = (1121, "ne-NP", "The Nepali language.")
|
||||
"""The Nepali language."""
|
||||
|
||||
NO_PROOFING = (1024, "en-US", "No proofing.")
|
||||
"""No proofing."""
|
||||
|
||||
NORWEGIAN_BOKMOL = (1044, "nb-NO", "The Norwegian Bokmol language.")
|
||||
"""The Norwegian Bokmol language."""
|
||||
|
||||
NORWEGIAN_NYNORSK = (2068, "nn-NO", "The Norwegian Nynorsk language.")
|
||||
"""The Norwegian Nynorsk language."""
|
||||
|
||||
ORIYA = (1096, "or-IN", "The Oriya language.")
|
||||
"""The Oriya language."""
|
||||
|
||||
OROMO = (1138, "om-Ethi-ET", "The Oromo language.")
|
||||
"""The Oromo language."""
|
||||
|
||||
PASHTO = (1123, "ps-AF", "The Pashto language.")
|
||||
"""The Pashto language."""
|
||||
|
||||
POLISH = (1045, "pl-PL", "The Polish language.")
|
||||
"""The Polish language."""
|
||||
|
||||
PORTUGUESE = (2070, "pt-PT", "The Portuguese language.")
|
||||
"""The Portuguese language."""
|
||||
|
||||
PUNJABI = (1094, "pa-IN", "The Punjabi language.")
|
||||
"""The Punjabi language."""
|
||||
|
||||
QUECHUA_BOLIVIA = (1131, "quz-BO", "The Quechua Bolivia language.")
|
||||
"""The Quechua Bolivia language."""
|
||||
|
||||
QUECHUA_ECUADOR = (2155, "quz-EC", "The Quechua Ecuador language.")
|
||||
"""The Quechua Ecuador language."""
|
||||
|
||||
QUECHUA_PERU = (3179, "quz-PE", "The Quechua Peru language.")
|
||||
"""The Quechua Peru language."""
|
||||
|
||||
RHAETO_ROMANIC = (1047, "rm-CH", "The Rhaeto Romanic language.")
|
||||
"""The Rhaeto Romanic language."""
|
||||
|
||||
ROMANIAN = (1048, "ro-RO", "The Romanian language.")
|
||||
"""The Romanian language."""
|
||||
|
||||
ROMANIAN_MOLDOVA = (2072, "ro-MO", "The Romanian Moldova language.")
|
||||
"""The Romanian Moldova language."""
|
||||
|
||||
RUSSIAN = (1049, "ru-RU", "The Russian language.")
|
||||
"""The Russian language."""
|
||||
|
||||
RUSSIAN_MOLDOVA = (2073, "ru-MO", "The Russian Moldova language.")
|
||||
"""The Russian Moldova language."""
|
||||
|
||||
SAMI_LAPPISH = (1083, "se-NO", "The Sami Lappish language.")
|
||||
"""The Sami Lappish language."""
|
||||
|
||||
SANSKRIT = (1103, "sa-IN", "The Sanskrit language.")
|
||||
"""The Sanskrit language."""
|
||||
|
||||
SEPEDI = (1132, "ns-ZA", "The Sepedi language.")
|
||||
"""The Sepedi language."""
|
||||
|
||||
SERBIAN_BOSNIA_HERZEGOVINA_CYRILLIC = (
|
||||
7194,
|
||||
"sr-BA",
|
||||
"The Serbian Bosnia Herzegovina Cyrillic language.",
|
||||
)
|
||||
"""The Serbian Bosnia Herzegovina Cyrillic language."""
|
||||
|
||||
SERBIAN_BOSNIA_HERZEGOVINA_LATIN = (
|
||||
6170,
|
||||
"sr-Latn-BA",
|
||||
"The Serbian Bosnia Herzegovina Latin language.",
|
||||
)
|
||||
"""The Serbian Bosnia Herzegovina Latin language."""
|
||||
|
||||
SERBIAN_CYRILLIC = (3098, "sr-SP", "The Serbian Cyrillic language.")
|
||||
"""The Serbian Cyrillic language."""
|
||||
|
||||
SERBIAN_LATIN = (2074, "sr-Latn-CS", "The Serbian Latin language.")
|
||||
"""The Serbian Latin language."""
|
||||
|
||||
SESOTHO = (1072, "st-ZA", "The Sesotho language.")
|
||||
"""The Sesotho language."""
|
||||
|
||||
SIMPLIFIED_CHINESE = (2052, "zh-CN", "The Simplified Chinese language.")
|
||||
"""The Simplified Chinese language."""
|
||||
|
||||
SINDHI = (1113, "sd-Deva-IN", "The Sindhi language.")
|
||||
"""The Sindhi language."""
|
||||
|
||||
SINDHI_PAKISTAN = (2137, "sd-Arab-PK", "The Sindhi Pakistan language.")
|
||||
"""The Sindhi Pakistan language."""
|
||||
|
||||
SINHALESE = (1115, "si-LK", "The Sinhalese language.")
|
||||
"""The Sinhalese language."""
|
||||
|
||||
SLOVAK = (1051, "sk-SK", "The Slovak language.")
|
||||
"""The Slovak language."""
|
||||
|
||||
SLOVENIAN = (1060, "sl-SI", "The Slovenian language.")
|
||||
"""The Slovenian language."""
|
||||
|
||||
SOMALI = (1143, "so-SO", "The Somali language.")
|
||||
"""The Somali language."""
|
||||
|
||||
SORBIAN = (1070, "wen-DE", "The Sorbian language.")
|
||||
"""The Sorbian language."""
|
||||
|
||||
SPANISH = (1034, "es-ES_tradnl", "The Spanish language.")
|
||||
"""The Spanish language."""
|
||||
|
||||
SPANISH_ARGENTINA = (11274, "es-AR", "The Spanish Argentina language.")
|
||||
"""The Spanish Argentina language."""
|
||||
|
||||
SPANISH_BOLIVIA = (16394, "es-BO", "The Spanish Bolivia language.")
|
||||
"""The Spanish Bolivia language."""
|
||||
|
||||
SPANISH_CHILE = (13322, "es-CL", "The Spanish Chile language.")
|
||||
"""The Spanish Chile language."""
|
||||
|
||||
SPANISH_COLOMBIA = (9226, "es-CO", "The Spanish Colombia language.")
|
||||
"""The Spanish Colombia language."""
|
||||
|
||||
SPANISH_COSTA_RICA = (5130, "es-CR", "The Spanish Costa Rica language.")
|
||||
"""The Spanish Costa Rica language."""
|
||||
|
||||
SPANISH_DOMINICAN_REPUBLIC = (7178, "es-DO", "The Spanish Dominican Republic language.")
|
||||
"""The Spanish Dominican Republic language."""
|
||||
|
||||
SPANISH_ECUADOR = (12298, "es-EC", "The Spanish Ecuador language.")
|
||||
"""The Spanish Ecuador language."""
|
||||
|
||||
SPANISH_EL_SALVADOR = (17418, "es-SV", "The Spanish El Salvador language.")
|
||||
"""The Spanish El Salvador language."""
|
||||
|
||||
SPANISH_GUATEMALA = (4106, "es-GT", "The Spanish Guatemala language.")
|
||||
"""The Spanish Guatemala language."""
|
||||
|
||||
SPANISH_HONDURAS = (18442, "es-HN", "The Spanish Honduras language.")
|
||||
"""The Spanish Honduras language."""
|
||||
|
||||
SPANISH_MODERN_SORT = (3082, "es-ES", "The Spanish Modern Sort language.")
|
||||
"""The Spanish Modern Sort language."""
|
||||
|
||||
SPANISH_NICARAGUA = (19466, "es-NI", "The Spanish Nicaragua language.")
|
||||
"""The Spanish Nicaragua language."""
|
||||
|
||||
SPANISH_PANAMA = (6154, "es-PA", "The Spanish Panama language.")
|
||||
"""The Spanish Panama language."""
|
||||
|
||||
SPANISH_PARAGUAY = (15370, "es-PY", "The Spanish Paraguay language.")
|
||||
"""The Spanish Paraguay language."""
|
||||
|
||||
SPANISH_PERU = (10250, "es-PE", "The Spanish Peru language.")
|
||||
"""The Spanish Peru language."""
|
||||
|
||||
SPANISH_PUERTO_RICO = (20490, "es-PR", "The Spanish Puerto Rico language.")
|
||||
"""The Spanish Puerto Rico language."""
|
||||
|
||||
SPANISH_URUGUAY = (14346, "es-UR", "The Spanish Uruguay language.")
|
||||
"""The Spanish Uruguay language."""
|
||||
|
||||
SPANISH_VENEZUELA = (8202, "es-VE", "The Spanish Venezuela language.")
|
||||
"""The Spanish Venezuela language."""
|
||||
|
||||
SUTU = (1072, "st-ZA", "The Sutu language.")
|
||||
"""The Sutu language."""
|
||||
|
||||
SWAHILI = (1089, "sw-KE", "The Swahili language.")
|
||||
"""The Swahili language."""
|
||||
|
||||
SWEDISH = (1053, "sv-SE", "The Swedish language.")
|
||||
"""The Swedish language."""
|
||||
|
||||
SWEDISH_FINLAND = (2077, "sv-FI", "The Swedish Finland language.")
|
||||
"""The Swedish Finland language."""
|
||||
|
||||
SWISS_FRENCH = (4108, "fr-CH", "The Swiss French language.")
|
||||
"""The Swiss French language."""
|
||||
|
||||
SWISS_GERMAN = (2055, "de-CH", "The Swiss German language.")
|
||||
"""The Swiss German language."""
|
||||
|
||||
SWISS_ITALIAN = (2064, "it-CH", "The Swiss Italian language.")
|
||||
"""The Swiss Italian language."""
|
||||
|
||||
SYRIAC = (1114, "syr-SY", "The Syriac language.")
|
||||
"""The Syriac language."""
|
||||
|
||||
TAJIK = (1064, "tg-TJ", "The Tajik language.")
|
||||
"""The Tajik language."""
|
||||
|
||||
TAMAZIGHT = (1119, "tzm-Arab-MA", "The Tamazight language.")
|
||||
"""The Tamazight language."""
|
||||
|
||||
TAMAZIGHT_LATIN = (2143, "tmz-DZ", "The Tamazight Latin language.")
|
||||
"""The Tamazight Latin language."""
|
||||
|
||||
TAMIL = (1097, "ta-IN", "The Tamil language.")
|
||||
"""The Tamil language."""
|
||||
|
||||
TATAR = (1092, "tt-RU", "The Tatar language.")
|
||||
"""The Tatar language."""
|
||||
|
||||
TELUGU = (1098, "te-IN", "The Telugu language.")
|
||||
"""The Telugu language."""
|
||||
|
||||
THAI = (1054, "th-TH", "The Thai language.")
|
||||
"""The Thai language."""
|
||||
|
||||
TIBETAN = (1105, "bo-CN", "The Tibetan language.")
|
||||
"""The Tibetan language."""
|
||||
|
||||
TIGRIGNA_ERITREA = (2163, "ti-ER", "The Tigrigna Eritrea language.")
|
||||
"""The Tigrigna Eritrea language."""
|
||||
|
||||
TIGRIGNA_ETHIOPIC = (1139, "ti-ET", "The Tigrigna Ethiopic language.")
|
||||
"""The Tigrigna Ethiopic language."""
|
||||
|
||||
TRADITIONAL_CHINESE = (1028, "zh-TW", "The Traditional Chinese language.")
|
||||
"""The Traditional Chinese language."""
|
||||
|
||||
TSONGA = (1073, "ts-ZA", "The Tsonga language.")
|
||||
"""The Tsonga language."""
|
||||
|
||||
TSWANA = (1074, "tn-ZA", "The Tswana language.")
|
||||
"""The Tswana language."""
|
||||
|
||||
TURKISH = (1055, "tr-TR", "The Turkish language.")
|
||||
"""The Turkish language."""
|
||||
|
||||
TURKMEN = (1090, "tk-TM", "The Turkmen language.")
|
||||
"""The Turkmen language."""
|
||||
|
||||
UKRAINIAN = (1058, "uk-UA", "The Ukrainian language.")
|
||||
"""The Ukrainian language."""
|
||||
|
||||
URDU = (1056, "ur-PK", "The Urdu language.")
|
||||
"""The Urdu language."""
|
||||
|
||||
UZBEK_CYRILLIC = (2115, "uz-UZ", "The Uzbek Cyrillic language.")
|
||||
"""The Uzbek Cyrillic language."""
|
||||
|
||||
UZBEK_LATIN = (1091, "uz-Latn-UZ", "The Uzbek Latin language.")
|
||||
"""The Uzbek Latin language."""
|
||||
|
||||
VENDA = (1075, "ve-ZA", "The Venda language.")
|
||||
"""The Venda language."""
|
||||
|
||||
VIETNAMESE = (1066, "vi-VN", "The Vietnamese language.")
|
||||
"""The Vietnamese language."""
|
||||
|
||||
WELSH = (1106, "cy-GB", "The Welsh language.")
|
||||
"""The Welsh language."""
|
||||
|
||||
XHOSA = (1076, "xh-ZA", "The Xhosa language.")
|
||||
"""The Xhosa language."""
|
||||
|
||||
YI = (1144, "ii-CN", "The Yi language.")
|
||||
"""The Yi language."""
|
||||
|
||||
YIDDISH = (1085, "yi-Hebr", "The Yiddish language.")
|
||||
"""The Yiddish language."""
|
||||
|
||||
YORUBA = (1130, "yo-NG", "The Yoruba language.")
|
||||
"""The Yoruba language."""
|
||||
|
||||
ZULU = (1077, "zu-ZA", "The Zulu language.")
|
||||
"""The Zulu language."""
|
||||
|
||||
MIXED = (-2, "", "More than one language in specified range (read-only).")
|
||||
"""More than one language in specified range (read-only)."""
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,230 @@
|
||||
"""Enumerations used by text and related objects."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from pptx.enum.base import BaseEnum, BaseXmlEnum
|
||||
|
||||
|
||||
class MSO_AUTO_SIZE(BaseEnum):
|
||||
"""Determines the type of automatic sizing allowed.
|
||||
|
||||
The following names can be used to specify the automatic sizing behavior used to fit a shape's
|
||||
text within the shape bounding box, for example::
|
||||
|
||||
from pptx.enum.text import MSO_AUTO_SIZE
|
||||
|
||||
shape.text_frame.auto_size = MSO_AUTO_SIZE.TEXT_TO_FIT_SHAPE
|
||||
|
||||
The word-wrap setting of the text frame interacts with the auto-size setting to determine the
|
||||
specific auto-sizing behavior.
|
||||
|
||||
Note that `TextFrame.auto_size` can also be set to |None|, which removes the auto size setting
|
||||
altogether. This causes the setting to be inherited, either from the layout placeholder, in the
|
||||
case of a placeholder shape, or from the theme.
|
||||
|
||||
MS API Name: `MsoAutoSize`
|
||||
|
||||
http://msdn.microsoft.com/en-us/library/office/ff865367(v=office.15).aspx
|
||||
"""
|
||||
|
||||
NONE = (
|
||||
0,
|
||||
"No automatic sizing of the shape or text will be done.\n\nText can freely extend beyond"
|
||||
" the horizontal and vertical edges of the shape bounding box.",
|
||||
)
|
||||
"""No automatic sizing of the shape or text will be done.
|
||||
|
||||
Text can freely extend beyond the horizontal and vertical edges of the shape bounding box.
|
||||
"""
|
||||
|
||||
SHAPE_TO_FIT_TEXT = (
|
||||
1,
|
||||
"The shape height and possibly width are adjusted to fit the text.\n\nNote this setting"
|
||||
" interacts with the TextFrame.word_wrap property setting. If word wrap is turned on,"
|
||||
" only the height of the shape will be adjusted; soft line breaks will be used to fit the"
|
||||
" text horizontally.",
|
||||
)
|
||||
"""The shape height and possibly width are adjusted to fit the text.
|
||||
|
||||
Note this setting interacts with the TextFrame.word_wrap property setting. If word wrap is
|
||||
turned on, only the height of the shape will be adjusted; soft line breaks will be used to fit
|
||||
the text horizontally.
|
||||
"""
|
||||
|
||||
TEXT_TO_FIT_SHAPE = (
|
||||
2,
|
||||
"The font size is reduced as necessary to fit the text within the shape.",
|
||||
)
|
||||
"""The font size is reduced as necessary to fit the text within the shape."""
|
||||
|
||||
MIXED = (-2, "Return value only; indicates a combination of automatic sizing schemes are used.")
|
||||
"""Return value only; indicates a combination of automatic sizing schemes are used."""
|
||||
|
||||
|
||||
class MSO_TEXT_UNDERLINE_TYPE(BaseXmlEnum):
|
||||
"""
|
||||
Indicates the type of underline for text. Used with
|
||||
:attr:`.Font.underline` to specify the style of text underlining.
|
||||
|
||||
Alias: ``MSO_UNDERLINE``
|
||||
|
||||
Example::
|
||||
|
||||
from pptx.enum.text import MSO_UNDERLINE
|
||||
|
||||
run.font.underline = MSO_UNDERLINE.DOUBLE_LINE
|
||||
|
||||
MS API Name: `MsoTextUnderlineType`
|
||||
|
||||
http://msdn.microsoft.com/en-us/library/aa432699.aspx
|
||||
"""
|
||||
|
||||
NONE = (0, "none", "Specifies no underline.")
|
||||
"""Specifies no underline."""
|
||||
|
||||
DASH_HEAVY_LINE = (8, "dashHeavy", "Specifies a dash underline.")
|
||||
"""Specifies a dash underline."""
|
||||
|
||||
DASH_LINE = (7, "dash", "Specifies a dash line underline.")
|
||||
"""Specifies a dash line underline."""
|
||||
|
||||
DASH_LONG_HEAVY_LINE = (10, "dashLongHeavy", "Specifies a long heavy line underline.")
|
||||
"""Specifies a long heavy line underline."""
|
||||
|
||||
DASH_LONG_LINE = (9, "dashLong", "Specifies a dashed long line underline.")
|
||||
"""Specifies a dashed long line underline."""
|
||||
|
||||
DOT_DASH_HEAVY_LINE = (12, "dotDashHeavy", "Specifies a dot dash heavy line underline.")
|
||||
"""Specifies a dot dash heavy line underline."""
|
||||
|
||||
DOT_DASH_LINE = (11, "dotDash", "Specifies a dot dash line underline.")
|
||||
"""Specifies a dot dash line underline."""
|
||||
|
||||
DOT_DOT_DASH_HEAVY_LINE = (
|
||||
14,
|
||||
"dotDotDashHeavy",
|
||||
"Specifies a dot dot dash heavy line underline.",
|
||||
)
|
||||
"""Specifies a dot dot dash heavy line underline."""
|
||||
|
||||
DOT_DOT_DASH_LINE = (13, "dotDotDash", "Specifies a dot dot dash line underline.")
|
||||
"""Specifies a dot dot dash line underline."""
|
||||
|
||||
DOTTED_HEAVY_LINE = (6, "dottedHeavy", "Specifies a dotted heavy line underline.")
|
||||
"""Specifies a dotted heavy line underline."""
|
||||
|
||||
DOTTED_LINE = (5, "dotted", "Specifies a dotted line underline.")
|
||||
"""Specifies a dotted line underline."""
|
||||
|
||||
DOUBLE_LINE = (3, "dbl", "Specifies a double line underline.")
|
||||
"""Specifies a double line underline."""
|
||||
|
||||
HEAVY_LINE = (4, "heavy", "Specifies a heavy line underline.")
|
||||
"""Specifies a heavy line underline."""
|
||||
|
||||
SINGLE_LINE = (2, "sng", "Specifies a single line underline.")
|
||||
"""Specifies a single line underline."""
|
||||
|
||||
WAVY_DOUBLE_LINE = (17, "wavyDbl", "Specifies a wavy double line underline.")
|
||||
"""Specifies a wavy double line underline."""
|
||||
|
||||
WAVY_HEAVY_LINE = (16, "wavyHeavy", "Specifies a wavy heavy line underline.")
|
||||
"""Specifies a wavy heavy line underline."""
|
||||
|
||||
WAVY_LINE = (15, "wavy", "Specifies a wavy line underline.")
|
||||
"""Specifies a wavy line underline."""
|
||||
|
||||
WORDS = (1, "words", "Specifies underlining words.")
|
||||
"""Specifies underlining words."""
|
||||
|
||||
MIXED = (-2, "", "Specifies a mix of underline types (read-only).")
|
||||
"""Specifies a mix of underline types (read-only)."""
|
||||
|
||||
|
||||
MSO_UNDERLINE = MSO_TEXT_UNDERLINE_TYPE
|
||||
|
||||
|
||||
class MSO_VERTICAL_ANCHOR(BaseXmlEnum):
|
||||
"""Specifies the vertical alignment of text in a text frame.
|
||||
|
||||
Used with the `.vertical_anchor` property of the |TextFrame| object. Note that the
|
||||
`vertical_anchor` property can also have the value None, indicating there is no directly
|
||||
specified vertical anchor setting and its effective value is inherited from its placeholder if
|
||||
it has one or from the theme. |None| may also be assigned to remove an explicitly specified
|
||||
vertical anchor setting.
|
||||
|
||||
MS API Name: `MsoVerticalAnchor`
|
||||
|
||||
http://msdn.microsoft.com/en-us/library/office/ff865255.aspx
|
||||
"""
|
||||
|
||||
TOP = (1, "t", "Aligns text to top of text frame")
|
||||
"""Aligns text to top of text frame"""
|
||||
|
||||
MIDDLE = (3, "ctr", "Centers text vertically")
|
||||
"""Centers text vertically"""
|
||||
|
||||
BOTTOM = (4, "b", "Aligns text to bottom of text frame")
|
||||
"""Aligns text to bottom of text frame"""
|
||||
|
||||
MIXED = (-2, "", "Return value only; indicates a combination of the other states.")
|
||||
"""Return value only; indicates a combination of the other states."""
|
||||
|
||||
|
||||
MSO_ANCHOR = MSO_VERTICAL_ANCHOR
|
||||
|
||||
|
||||
class PP_PARAGRAPH_ALIGNMENT(BaseXmlEnum):
|
||||
"""Specifies the horizontal alignment for one or more paragraphs.
|
||||
|
||||
Alias: `PP_ALIGN`
|
||||
|
||||
Example::
|
||||
|
||||
from pptx.enum.text import PP_ALIGN
|
||||
|
||||
shape.paragraphs[0].alignment = PP_ALIGN.CENTER
|
||||
|
||||
MS API Name: `PpParagraphAlignment`
|
||||
|
||||
http://msdn.microsoft.com/en-us/library/office/ff745375(v=office.15).aspx
|
||||
"""
|
||||
|
||||
CENTER = (2, "ctr", "Center align")
|
||||
"""Center align"""
|
||||
|
||||
DISTRIBUTE = (
|
||||
5,
|
||||
"dist",
|
||||
"Evenly distributes e.g. Japanese characters from left to right within a line",
|
||||
)
|
||||
"""Evenly distributes e.g. Japanese characters from left to right within a line"""
|
||||
|
||||
JUSTIFY = (
|
||||
4,
|
||||
"just",
|
||||
"Justified, i.e. each line both begins and ends at the margin.\n\nSpacing between words"
|
||||
" is adjusted such that the line exactly fills the width of the paragraph.",
|
||||
)
|
||||
"""Justified, i.e. each line both begins and ends at the margin.
|
||||
|
||||
Spacing between words is adjusted such that the line exactly fills the width of the paragraph.
|
||||
"""
|
||||
|
||||
JUSTIFY_LOW = (7, "justLow", "Justify using a small amount of space between words.")
|
||||
"""Justify using a small amount of space between words."""
|
||||
|
||||
LEFT = (1, "l", "Left aligned")
|
||||
"""Left aligned"""
|
||||
|
||||
RIGHT = (3, "r", "Right aligned")
|
||||
"""Right aligned"""
|
||||
|
||||
THAI_DISTRIBUTE = (6, "thaiDist", "Thai distributed")
|
||||
"""Thai distributed"""
|
||||
|
||||
MIXED = (-2, "", "Multiple alignments are present in a set of paragraphs (read-only).")
|
||||
"""Multiple alignments are present in a set of paragraphs (read-only)."""
|
||||
|
||||
|
||||
PP_ALIGN = PP_PARAGRAPH_ALIGNMENT
|
||||
Reference in New Issue
Block a user