diff --git a/src/pptx/enum/action.py b/src/pptx/enum/action.py index 8bbf9189a..bc447226f 100644 --- a/src/pptx/enum/action.py +++ b/src/pptx/enum/action.py @@ -1,16 +1,11 @@ -# encoding: utf-8 +"""Enumerations that describe click-action settings.""" -""" -Enumerations that describe click action settings -""" +from __future__ import annotations -from __future__ import absolute_import +from pptx.enum.base import BaseEnum -from .base import alias, Enumeration, EnumMember - -@alias("PP_ACTION") -class PP_ACTION_TYPE(Enumeration): +class PP_ACTION_TYPE(BaseEnum): """ Specifies the type of a mouse action (click or hover action). @@ -21,26 +16,56 @@ class PP_ACTION_TYPE(Enumeration): 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 """ - __ms_name__ = "PpActionType" - - __url__ = "https://msdn.microsoft.com/EN-US/library/office/ff744895.aspx" - - __members__ = ( - EnumMember("END_SHOW", 6, "Slide show ends."), - EnumMember("FIRST_SLIDE", 3, "Returns to the first slide."), - EnumMember("HYPERLINK", 7, "Hyperlink."), - EnumMember("LAST_SLIDE", 4, "Moves to the last slide."), - EnumMember("LAST_SLIDE_VIEWED", 5, "Moves to the last slide viewed."), - EnumMember("NAMED_SLIDE", 101, "Moves to slide specified by slide number."), - EnumMember("NAMED_SLIDE_SHOW", 10, "Runs the slideshow."), - EnumMember("NEXT_SLIDE", 1, "Moves to the next slide."), - EnumMember("NONE", 0, "No action is performed."), - EnumMember("OPEN_FILE", 102, "Opens the specified file."), - EnumMember("OLE_VERB", 11, "OLE Verb."), - EnumMember("PLAY", 12, "Begins the slideshow."), - EnumMember("PREVIOUS_SLIDE", 2, "Moves to the previous slide."), - EnumMember("RUN_MACRO", 8, "Runs a macro."), - EnumMember("RUN_PROGRAM", 9, "Runs a program."), - ) + 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 diff --git a/src/pptx/enum/base.py b/src/pptx/enum/base.py index c57e15b33..1d49b9c19 100644 --- a/src/pptx/enum/base.py +++ b/src/pptx/enum/base.py @@ -1,40 +1,105 @@ -# encoding: utf-8 +"""Base classes and other objects used by enumerations.""" -""" -Base classes and other objects used by enumerations -""" +from __future__ import annotations -from __future__ import absolute_import, print_function - -import sys +import enum import textwrap +from typing import TYPE_CHECKING, Any, Type, TypeVar +if TYPE_CHECKING: + from typing_extensions import Self -def alias(*aliases): - """ - Decorating a class with @alias('FOO', 'BAR', ..) allows the class to - be referenced by each of the names provided as arguments. +_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 decorator(cls): - # alias must be set in globals from caller's frame - caller = sys._getframe(1) - globals_dict = caller.f_globals - for alias in aliases: - globals_dict[alias] = cls - return cls + 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 - return decorator + def __str__(self): + """The symbolic name and string value of this member, e.g. 'MIDDLE (3)'.""" + return f"{self.name} ({self.value})" -class _DocsPageFormatter(object): - """ - Formats a RestructuredText documention page (string) for the enumeration - class parts passed to the constructor. An immutable one-shot service - object. +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. """ - def __init__(self, clsname, clsdict): + 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 @@ -69,12 +134,12 @@ def _intro_text(self): return textwrap.dedent(cls_docstring).strip() - def _member_def(self, member): - """ - Return an individual member definition formatted as an RST glossary - entry, wrapped to fit within 78 columns. + 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.docstring).strip() + member_docstring = textwrap.dedent(member.__doc__ or "").strip() member_docstring = textwrap.fill( member_docstring, width=78, @@ -90,9 +155,7 @@ def _member_defs(self): of the documentation page """ members = self._clsdict["__members__"] - member_defs = [ - self._member_def(member) for member in members if member.name is not None - ] + member_defs = [self._member_def(member) for member in members if member.name is not None] return "\n".join(member_defs) @property @@ -110,255 +173,3 @@ def _page_title(self): """ title_underscore = "=" * (len(self._clsname) + 4) return "``%s``\n%s" % (self._clsname, title_underscore) - - -class MetaEnumeration(type): - """ - The metaclass for Enumeration and its subclasses. Adds a name for each - named member and compiles state needed by the enumeration class to - respond to other attribute gets - """ - - def __new__(meta, clsname, bases, clsdict): - meta._add_enum_members(clsdict) - meta._collect_valid_settings(clsdict) - meta._generate_docs_page(clsname, clsdict) - return type.__new__(meta, clsname, bases, clsdict) - - @classmethod - def _add_enum_members(meta, clsdict): - """ - Dispatch ``.add_to_enum()`` call to each member so it can do its - thing to properly add itself to the enumeration class. This - delegation allows member sub-classes to add specialized behaviors. - """ - enum_members = clsdict["__members__"] - for member in enum_members: - member.add_to_enum(clsdict) - - @classmethod - def _collect_valid_settings(meta, clsdict): - """ - Return a sequence containing the enumeration values that are valid - assignment values. Return-only values are excluded. - """ - enum_members = clsdict["__members__"] - valid_settings = [] - for member in enum_members: - valid_settings.extend(member.valid_settings) - clsdict["_valid_settings"] = valid_settings - - @classmethod - def _generate_docs_page(meta, clsname, clsdict): - """ - Return the RST documentation page for the enumeration. - """ - clsdict["__docs_rst__"] = _DocsPageFormatter(clsname, clsdict).page_str - - -class EnumerationBase(object): - """ - Base class for all enumerations, used directly for enumerations requiring - only basic behavior. It's __dict__ is used below in the Python 2+3 - compatible metaclass definition. - """ - - __members__ = () - __ms_name__ = "" - - @classmethod - def validate(cls, value): - """ - Raise |ValueError| if *value* is not an assignable value. - """ - if value not in cls._valid_settings: - raise ValueError( - "%s not a member of %s enumeration" % (value, cls.__name__) - ) - - -Enumeration = MetaEnumeration("Enumeration", (object,), dict(EnumerationBase.__dict__)) - - -class XmlEnumeration(Enumeration): - """ - Provides ``to_xml()`` and ``from_xml()`` methods in addition to base - enumeration features - """ - - __members__ = () - __ms_name__ = "" - - @classmethod - def from_xml(cls, xml_val): - """ - Return the enumeration member corresponding to the XML value - *xml_val*. - """ - return cls._xml_to_member[xml_val] - - @classmethod - def to_xml(cls, enum_val): - """ - Return the XML value of the enumeration value *enum_val*. - """ - cls.validate(enum_val) - return cls._member_to_xml[enum_val] - - -class EnumMember(object): - """ - Used in the enumeration class definition to define a member value and its - mappings - """ - - def __init__(self, name, value, docstring): - self._name = name - if isinstance(value, int): - value = EnumValue(name, value, docstring) - self._value = value - self._docstring = docstring - - def add_to_enum(self, clsdict): - """ - Add a name to *clsdict* for this member. - """ - self.register_name(clsdict) - - @property - def docstring(self): - """ - The description of this member - """ - return self._docstring - - @property - def name(self): - """ - The distinguishing name of this member within the enumeration class, - e.g. 'MIDDLE' for MSO_VERTICAL_ANCHOR.MIDDLE, if this is a named - member. Otherwise the primitive value such as |None|, |True| or - |False|. - """ - return self._name - - def register_name(self, clsdict): - """ - Add a member name to the class dict *clsdict* containing the value of - this member object. Where the name of this object is None, do - nothing; this allows out-of-band values to be defined without adding - a name to the class dict. - """ - if self.name is None: - return - clsdict[self.name] = self.value - - @property - def valid_settings(self): - """ - A sequence containing the values valid for assignment for this - member. May be zero, one, or more in number. - """ - return (self._value,) - - @property - def value(self): - """ - The enumeration value for this member, often an instance of - EnumValue, but may be a primitive value such as |None|. - """ - return self._value - - -class EnumValue(int): - """ - A named enumeration value, providing __str__ and __doc__ string values - for its symbolic name and description, respectively. Subclasses int, so - behaves as a regular int unless the strings are asked for. - """ - - def __new__(cls, member_name, int_value, docstring): - return super(EnumValue, cls).__new__(cls, int_value) - - def __init__(self, member_name, int_value, docstring): - super(EnumValue, self).__init__() - self._member_name = member_name - self._docstring = docstring - - @property - def __doc__(self): - """ - The description of this enumeration member - """ - return self._docstring.strip() - - def __str__(self): - """ - The symbolic name and string value of this member, e.g. 'MIDDLE (3)' - """ - return "{0:s} ({1:d})".format(self._member_name, self) - - -class ReturnValueOnlyEnumMember(EnumMember): - """ - Used to define a member of an enumeration that is only valid as a query - result and is not valid as a setting, e.g. MSO_VERTICAL_ANCHOR.MIXED (-2) - """ - - @property - def valid_settings(self): - """ - No settings are valid for a return-only value. - """ - return () - - -class XmlMappedEnumMember(EnumMember): - """ - Used to define a member whose value maps to an XML attribute value. - """ - - def __init__(self, name, value, xml_value, docstring): - super(XmlMappedEnumMember, self).__init__(name, value, docstring) - self._xml_value = xml_value - - def add_to_enum(self, clsdict): - """ - Compile XML mappings in addition to base add behavior. - """ - super(XmlMappedEnumMember, self).add_to_enum(clsdict) - self.register_xml_mapping(clsdict) - - def register_xml_mapping(self, clsdict): - """ - Add XML mappings to the enumeration class state for this member. - """ - member_to_xml = self._get_or_add_member_to_xml(clsdict) - member_to_xml[self.value] = self.xml_value - xml_to_member = self._get_or_add_xml_to_member(clsdict) - xml_to_member[self.xml_value] = self.value - - @property - def xml_value(self): - """ - The XML attribute value that corresponds to this enumeration value - """ - return self._xml_value - - @staticmethod - def _get_or_add_member_to_xml(clsdict): - """ - Add the enum -> xml value mapping to the enumeration class state - """ - if "_member_to_xml" not in clsdict: - clsdict["_member_to_xml"] = dict() - return clsdict["_member_to_xml"] - - @staticmethod - def _get_or_add_xml_to_member(clsdict): - """ - Add the xml -> enum value mapping to the enumeration class state - """ - if "_xml_to_member" not in clsdict: - clsdict["_xml_to_member"] = dict() - return clsdict["_xml_to_member"] diff --git a/src/pptx/enum/chart.py b/src/pptx/enum/chart.py index 26cd3e5fc..5e609ebd3 100644 --- a/src/pptx/enum/chart.py +++ b/src/pptx/enum/chart.py @@ -1,60 +1,39 @@ -# encoding: utf-8 +"""Enumerations used by charts and related objects.""" -""" -Enumerations used by charts and related objects -""" +from __future__ import annotations -from __future__ import absolute_import +from pptx.enum.base import BaseEnum, BaseXmlEnum -from .base import ( - alias, - Enumeration, - EnumMember, - ReturnValueOnlyEnumMember, - XmlEnumeration, - XmlMappedEnumMember, -) - -class XL_AXIS_CROSSES(XmlEnumeration): - """ - Specifies the point on the specified axis where the other axis crosses. +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 """ - __ms_name__ = "XlAxisCrosses" - - __url__ = "https://msdn.microsoft.com/en-us/library/office/ff745402.aspx" - - __members__ = ( - XmlMappedEnumMember( - "AUTOMATIC", - -4105, - "autoZero", - "The axis crossing point is set " "automatically, often at zero.", - ), - ReturnValueOnlyEnumMember( - "CUSTOM", - -4114, - "The .crosses_at property specifies the axis cr" "ossing point.", - ), - XmlMappedEnumMember( - "MAXIMUM", 2, "max", "The axis crosses at the maximum value." - ), - XmlMappedEnumMember( - "MINIMUM", 4, "min", "The axis crosses at the minimum value." - ), - ) + 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.""" -class XL_CATEGORY_TYPE(Enumeration): - """ - Specifies the type of the category axis. + 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:: @@ -62,131 +41,258 @@ class XL_CATEGORY_TYPE(Enumeration): 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 """ - __ms_name__ = "XlCategoryType" - - __url__ = "https://msdn.microsoft.com/EN-US/library/office/ff746136.aspx" - - __members__ = ( - EnumMember( - "AUTOMATIC_SCALE", -4105, "The application controls the axis " "type." - ), - EnumMember( - "CATEGORY_SCALE", 2, "Axis groups data by an arbitrary set of " "categories" - ), - EnumMember( - "TIME_SCALE", - 3, - "Axis groups data on a time scale of days, " "months, or years.", - ), - ) + 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(Enumeration): - """ - Specifies the type of a chart. + +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 """ - __ms_name__ = "XlChartType" - - __url__ = "http://msdn.microsoft.com/en-us/library/office/ff838409.aspx" - - __members__ = ( - EnumMember("THREE_D_AREA", -4098, "3D Area."), - EnumMember("THREE_D_AREA_STACKED", 78, "3D Stacked Area."), - EnumMember("THREE_D_AREA_STACKED_100", 79, "100% Stacked Area."), - EnumMember("THREE_D_BAR_CLUSTERED", 60, "3D Clustered Bar."), - EnumMember("THREE_D_BAR_STACKED", 61, "3D Stacked Bar."), - EnumMember("THREE_D_BAR_STACKED_100", 62, "3D 100% Stacked Bar."), - EnumMember("THREE_D_COLUMN", -4100, "3D Column."), - EnumMember("THREE_D_COLUMN_CLUSTERED", 54, "3D Clustered Column."), - EnumMember("THREE_D_COLUMN_STACKED", 55, "3D Stacked Column."), - EnumMember("THREE_D_COLUMN_STACKED_100", 56, "3D 100% Stacked Column."), - EnumMember("THREE_D_LINE", -4101, "3D Line."), - EnumMember("THREE_D_PIE", -4102, "3D Pie."), - EnumMember("THREE_D_PIE_EXPLODED", 70, "Exploded 3D Pie."), - EnumMember("AREA", 1, "Area"), - EnumMember("AREA_STACKED", 76, "Stacked Area."), - EnumMember("AREA_STACKED_100", 77, "100% Stacked Area."), - EnumMember("BAR_CLUSTERED", 57, "Clustered Bar."), - EnumMember("BAR_OF_PIE", 71, "Bar of Pie."), - EnumMember("BAR_STACKED", 58, "Stacked Bar."), - EnumMember("BAR_STACKED_100", 59, "100% Stacked Bar."), - EnumMember("BUBBLE", 15, "Bubble."), - EnumMember("BUBBLE_THREE_D_EFFECT", 87, "Bubble with 3D effects."), - EnumMember("COLUMN_CLUSTERED", 51, "Clustered Column."), - EnumMember("COLUMN_STACKED", 52, "Stacked Column."), - EnumMember("COLUMN_STACKED_100", 53, "100% Stacked Column."), - EnumMember("CONE_BAR_CLUSTERED", 102, "Clustered Cone Bar."), - EnumMember("CONE_BAR_STACKED", 103, "Stacked Cone Bar."), - EnumMember("CONE_BAR_STACKED_100", 104, "100% Stacked Cone Bar."), - EnumMember("CONE_COL", 105, "3D Cone Column."), - EnumMember("CONE_COL_CLUSTERED", 99, "Clustered Cone Column."), - EnumMember("CONE_COL_STACKED", 100, "Stacked Cone Column."), - EnumMember("CONE_COL_STACKED_100", 101, "100% Stacked Cone Column."), - EnumMember("CYLINDER_BAR_CLUSTERED", 95, "Clustered Cylinder Bar."), - EnumMember("CYLINDER_BAR_STACKED", 96, "Stacked Cylinder Bar."), - EnumMember("CYLINDER_BAR_STACKED_100", 97, "100% Stacked Cylinder Bar."), - EnumMember("CYLINDER_COL", 98, "3D Cylinder Column."), - EnumMember("CYLINDER_COL_CLUSTERED", 92, "Clustered Cone Column."), - EnumMember("CYLINDER_COL_STACKED", 93, "Stacked Cone Column."), - EnumMember("CYLINDER_COL_STACKED_100", 94, "100% Stacked Cylinder Column."), - EnumMember("DOUGHNUT", -4120, "Doughnut."), - EnumMember("DOUGHNUT_EXPLODED", 80, "Exploded Doughnut."), - EnumMember("LINE", 4, "Line."), - EnumMember("LINE_MARKERS", 65, "Line with Markers."), - EnumMember("LINE_MARKERS_STACKED", 66, "Stacked Line with Markers."), - EnumMember("LINE_MARKERS_STACKED_100", 67, "100% Stacked Line with Markers."), - EnumMember("LINE_STACKED", 63, "Stacked Line."), - EnumMember("LINE_STACKED_100", 64, "100% Stacked Line."), - EnumMember("PIE", 5, "Pie."), - EnumMember("PIE_EXPLODED", 69, "Exploded Pie."), - EnumMember("PIE_OF_PIE", 68, "Pie of Pie."), - EnumMember("PYRAMID_BAR_CLUSTERED", 109, "Clustered Pyramid Bar."), - EnumMember("PYRAMID_BAR_STACKED", 110, "Stacked Pyramid Bar."), - EnumMember("PYRAMID_BAR_STACKED_100", 111, "100% Stacked Pyramid Bar."), - EnumMember("PYRAMID_COL", 112, "3D Pyramid Column."), - EnumMember("PYRAMID_COL_CLUSTERED", 106, "Clustered Pyramid Column."), - EnumMember("PYRAMID_COL_STACKED", 107, "Stacked Pyramid Column."), - EnumMember("PYRAMID_COL_STACKED_100", 108, "100% Stacked Pyramid Column."), - EnumMember("RADAR", -4151, "Radar."), - EnumMember("RADAR_FILLED", 82, "Filled Radar."), - EnumMember("RADAR_MARKERS", 81, "Radar with Data Markers."), - EnumMember("STOCK_HLC", 88, "High-Low-Close."), - EnumMember("STOCK_OHLC", 89, "Open-High-Low-Close."), - EnumMember("STOCK_VHLC", 90, "Volume-High-Low-Close."), - EnumMember("STOCK_VOHLC", 91, "Volume-Open-High-Low-Close."), - EnumMember("SURFACE", 83, "3D Surface."), - EnumMember("SURFACE_TOP_VIEW", 85, "Surface (Top View)."), - EnumMember("SURFACE_TOP_VIEW_WIREFRAME", 86, "Surface (Top View wireframe)."), - EnumMember("SURFACE_WIREFRAME", 84, "3D Surface (wireframe)."), - EnumMember("XY_SCATTER", -4169, "Scatter."), - EnumMember("XY_SCATTER_LINES", 74, "Scatter with Lines."), - EnumMember( - "XY_SCATTER_LINES_NO_MARKERS", - 75, - "Scatter with Lines and No Da" "ta Markers.", - ), - EnumMember("XY_SCATTER_SMOOTH", 72, "Scatter with Smoothed Lines."), - EnumMember( - "XY_SCATTER_SMOOTH_NO_MARKERS", - 73, - "Scatter with Smoothed Lines" " and No Data Markers.", - ), - ) + THREE_D_AREA = (-4098, "3D Area.") + """3D Area.""" + THREE_D_AREA_STACKED = (78, "3D Stacked Area.") + """3D Stacked Area.""" -@alias("XL_LABEL_POSITION") -class XL_DATA_LABEL_POSITION(XmlEnumeration): - """ - Specifies where the data label is positioned. + 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:: @@ -194,66 +300,57 @@ class XL_DATA_LABEL_POSITION(XmlEnumeration): 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 """ - __ms_name__ = "XlDataLabelPosition" - - __url__ = "http://msdn.microsoft.com/en-us/library/office/ff745082.aspx" - - __members__ = ( - XmlMappedEnumMember( - "ABOVE", 0, "t", "The data label is positioned above the data point." - ), - XmlMappedEnumMember( - "BELOW", 1, "b", "The data label is positioned below the data point." - ), - XmlMappedEnumMember( - "BEST_FIT", 5, "bestFit", "Word sets the position of the data label." - ), - XmlMappedEnumMember( - "CENTER", - -4108, - "ctr", - "The data label is centered on the data point or inside a bar or a pie " - "slice.", - ), - XmlMappedEnumMember( - "INSIDE_BASE", - 4, - "inBase", - "The data label is positioned inside the data point at the bottom edge.", - ), - XmlMappedEnumMember( - "INSIDE_END", - 3, - "inEnd", - "The data label is positioned inside the data point at the top edge.", - ), - XmlMappedEnumMember( - "LEFT", - -4131, - "l", - "The data label is positioned to the left of the data point.", - ), - ReturnValueOnlyEnumMember("MIXED", 6, "Data labels are in multiple positions."), - XmlMappedEnumMember( - "OUTSIDE_END", - 2, - "outEnd", - "The data label is positioned outside the data point at the top edge.", - ), - XmlMappedEnumMember( - "RIGHT", - -4152, - "r", - "The data label is positioned to the right of the data point.", - ), + 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.""" + + 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.""" -class XL_LEGEND_POSITION(XmlEnumeration): - """ - Specifies the position of the legend on a chart. + +XL_LABEL_POSITION = XL_DATA_LABEL_POSITION + + +class XL_LEGEND_POSITION(BaseXmlEnum): + """Specifies the position of the legend on a chart. Example:: @@ -261,82 +358,111 @@ class XL_LEGEND_POSITION(XmlEnumeration): 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 """ - __ms_name__ = "XlLegendPosition" + BOTTOM = (-4107, "b", "Below the chart.") + """Below the chart.""" - __url__ = "http://msdn.microsoft.com/en-us/library/office/ff745840.aspx" + CORNER = (2, "tr", "In the upper-right corner of the chart border.") + """In the upper-right corner of the chart border.""" - __members__ = ( - XmlMappedEnumMember("BOTTOM", -4107, "b", "Below the chart."), - XmlMappedEnumMember( - "CORNER", 2, "tr", "In the upper-right corner of the chart borde" "r." - ), - ReturnValueOnlyEnumMember("CUSTOM", -4161, "A custom position."), - XmlMappedEnumMember("LEFT", -4131, "l", "Left of the chart."), - XmlMappedEnumMember("RIGHT", -4152, "r", "Right of the chart."), - XmlMappedEnumMember("TOP", -4160, "t", "Above the chart."), - ) + CUSTOM = (-4161, "", "A custom position.") + """A custom position.""" + 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(XmlEnumeration): - """ - Specifies the marker style for a point or series in a line chart, scatter - chart, or radar 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 """ - __ms_name__ = "XlMarkerStyle" - - __url__ = "http://msdn.microsoft.com/en-us/library/office/ff197219.aspx" - - __members__ = ( - XmlMappedEnumMember("AUTOMATIC", -4105, "auto", "Automatic markers"), - XmlMappedEnumMember("CIRCLE", 8, "circle", "Circular markers"), - XmlMappedEnumMember("DASH", -4115, "dash", "Long bar markers"), - XmlMappedEnumMember("DIAMOND", 2, "diamond", "Diamond-shaped markers"), - XmlMappedEnumMember("DOT", -4118, "dot", "Short bar markers"), - XmlMappedEnumMember("NONE", -4142, "none", "No markers"), - XmlMappedEnumMember("PICTURE", -4147, "picture", "Picture markers"), - XmlMappedEnumMember("PLUS", 9, "plus", "Square markers with a plus sign"), - XmlMappedEnumMember("SQUARE", 1, "square", "Square markers"), - XmlMappedEnumMember("STAR", 5, "star", "Square markers with an asterisk"), - XmlMappedEnumMember("TRIANGLE", 3, "triangle", "Triangular markers"), - XmlMappedEnumMember("X", -4168, "x", "Square markers with an X"), - ) + AUTOMATIC = (-4105, "auto", "Automatic markers") + """Automatic markers""" + CIRCLE = (8, "circle", "Circular markers") + """Circular markers""" -class XL_TICK_MARK(XmlEnumeration): - """ - Specifies a type of axis tick for a chart. + 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 """ - __ms_name__ = "XlTickMark" + CROSS = (4, "cross", "Tick mark crosses the axis") + """Tick mark crosses the axis""" - __url__ = "http://msdn.microsoft.com/en-us/library/office/ff193878.aspx" + INSIDE = (2, "in", "Tick mark appears inside the axis") + """Tick mark appears inside the axis""" - __members__ = ( - XmlMappedEnumMember("CROSS", 4, "cross", "Tick mark crosses the axis"), - XmlMappedEnumMember("INSIDE", 2, "in", "Tick mark appears inside the axis"), - XmlMappedEnumMember("NONE", -4142, "none", "No tick mark"), - XmlMappedEnumMember("OUTSIDE", 3, "out", "Tick mark appears outside 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(XmlEnumeration): - """ - Specifies the position of tick-mark labels on a chart axis. + +class XL_TICK_LABEL_POSITION(BaseXmlEnum): + """Specifies the position of tick-mark labels on a chart axis. Example:: @@ -344,20 +470,20 @@ class XL_TICK_LABEL_POSITION(XmlEnumeration): 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 """ - __ms_name__ = "XlTickLabelPosition" + HIGH = (-4127, "high", "Top or right side of the chart.") + """Top or right side of the chart.""" - __url__ = "http://msdn.microsoft.com/en-us/library/office/ff822561.aspx" + LOW = (-4134, "low", "Bottom or left side of the chart.") + """Bottom or left side of the chart.""" - __members__ = ( - XmlMappedEnumMember("HIGH", -4127, "high", "Top or right side of the chart."), - XmlMappedEnumMember("LOW", -4134, "low", "Bottom or left side of the chart."), - XmlMappedEnumMember( - "NEXT_TO_AXIS", - 4, - "nextTo", - "Next to axis (where axis is not at" " either side of the chart).", - ), - XmlMappedEnumMember("NONE", -4142, "none", "No tick labels."), - ) + 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.""" diff --git a/src/pptx/enum/dml.py b/src/pptx/enum/dml.py index 765fe2dea..e9a14b13f 100644 --- a/src/pptx/enum/dml.py +++ b/src/pptx/enum/dml.py @@ -1,20 +1,11 @@ -# encoding: utf-8 - """Enumerations used by DrawingML objects.""" -from __future__ import absolute_import, division, print_function, unicode_literals +from __future__ import annotations -from .base import ( - alias, - Enumeration, - EnumMember, - ReturnValueOnlyEnumMember, - XmlEnumeration, - XmlMappedEnumMember, -) +from pptx.enum.base import BaseEnum, BaseXmlEnum -class MSO_COLOR_TYPE(Enumeration): +class MSO_COLOR_TYPE(BaseEnum): """ Specifies the color specification scheme @@ -23,51 +14,35 @@ class MSO_COLOR_TYPE(Enumeration): 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 """ - __ms_name__ = "MsoColorType" + RGB = (1, "Color is specified by an |RGBColor| value.") + """Color is specified by an |RGBColor| value.""" - __url__ = ( - "http://msdn.microsoft.com/en-us/library/office/ff864912(v=office.15" ").aspx" - ) + 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""" - __members__ = ( - EnumMember("RGB", 1, "Color is specified by an |RGBColor| value"), - EnumMember("SCHEME", 2, "Color is one of the preset theme colors"), - EnumMember( - "HSL", - 101, - """ - Color is specified using Hue, Saturation, and Luminosity values - """, - ), - EnumMember( - "PRESET", - 102, - """ - Color is specified using a named built-in color - """, - ), - EnumMember( - "SCRGB", - 103, - """ - Color is an scRGB color, a wide color gamut RGB color space - """, - ), - EnumMember( - "SYSTEM", - 104, - """ - Color is one specified by the operating system, such as the - window background color. - """, - ), + 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.""" -@alias("MSO_FILL") -class MSO_FILL_TYPE(Enumeration): +class MSO_FILL_TYPE(BaseEnum): """ Specifies the type of bitmap used for the fill of a shape. @@ -78,38 +53,46 @@ class MSO_FILL_TYPE(Enumeration): 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 """ - __ms_name__ = "MsoFillType" - - __url__ = "http://msdn.microsoft.com/EN-US/library/office/ff861408.aspx" - - __members__ = ( - EnumMember( - "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. - """, - ), - EnumMember("GRADIENT", 3, "Shape is filled with a gradient"), - EnumMember( - "GROUP", - 101, - "Shape is part of a group and should inherit the " - "fill properties of the group.", - ), - EnumMember("PATTERNED", 2, "Shape is filled with a pattern"), - EnumMember("PICTURE", 6, "Shape is filled with a bitmapped image"), - EnumMember("SOLID", 1, "Shape is filled with a solid color"), - EnumMember("TEXTURED", 4, "Shape is filled with a texture"), + 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""" -@alias("MSO_LINE") -class MSO_LINE_DASH_STYLE(XmlEnumeration): + 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`` @@ -119,36 +102,44 @@ class MSO_LINE_DASH_STYLE(XmlEnumeration): 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 """ - __ms_name__ = "MsoLineDashStyle" + DASH = (4, "dash", "Line consists of dashes only.") + """Line consists of dashes only.""" - __url__ = ( - "https://msdn.microsoft.com/en-us/vba/office-shared-vba/articles/mso" - "linedashstyle-enumeration-office" - ) + DASH_DOT = (5, "dashDot", "Line is a dash-dot pattern.") + """Line is a dash-dot pattern.""" - __members__ = ( - XmlMappedEnumMember("DASH", 4, "dash", "Line consists of dashes only."), - XmlMappedEnumMember("DASH_DOT", 5, "dashDot", "Line is a dash-dot pattern."), - XmlMappedEnumMember( - "DASH_DOT_DOT", 6, "lgDashDotDot", "Line is a dash-dot-dot patte" "rn." - ), - XmlMappedEnumMember("LONG_DASH", 7, "lgDash", "Line consists of long dashes."), - XmlMappedEnumMember( - "LONG_DASH_DOT", 8, "lgDashDot", "Line is a long dash-dot patter" "n." - ), - XmlMappedEnumMember("ROUND_DOT", 3, "dot", "Line is made up of round dots."), - XmlMappedEnumMember("SOLID", 1, "solid", "Line is solid."), - XmlMappedEnumMember( - "SQUARE_DOT", 2, "sysDash", "Line is made up of square dots." - ), - ReturnValueOnlyEnumMember("DASH_STYLE_MIXED", -2, "Not supported."), - ) + 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.""" -@alias("MSO_PATTERN") -class MSO_PATTERN_TYPE(XmlEnumeration): + +MSO_LINE = MSO_LINE_DASH_STYLE + + +class MSO_PATTERN_TYPE(BaseXmlEnum): """Specifies the fill pattern used in a shape. Alias: ``MSO_PATTERN`` @@ -160,99 +151,183 @@ class MSO_PATTERN_TYPE(XmlEnumeration): 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 """ - __ms_name__ = "MsoPatternType" + CROSS = (51, "cross", "Cross") + """Cross""" - __url__ = ( - "https://msdn.microsoft.com/VBA/Office-Shared-VBA/articles/msopatter" - "ntype-enumeration-office" - ) + DARK_DOWNWARD_DIAGONAL = (15, "dkDnDiag", "Dark Downward Diagonal") + """Dark Downward Diagonal""" - __members__ = ( - XmlMappedEnumMember("CROSS", 51, "cross", "Cross"), - XmlMappedEnumMember( - "DARK_DOWNWARD_DIAGONAL", 15, "dkDnDiag", "Dark Downward Diagona" "l" - ), - XmlMappedEnumMember("DARK_HORIZONTAL", 13, "dkHorz", "Dark Horizontal"), - XmlMappedEnumMember( - "DARK_UPWARD_DIAGONAL", 16, "dkUpDiag", "Dark Upward Diagonal" - ), - XmlMappedEnumMember("DARK_VERTICAL", 14, "dkVert", "Dark Vertical"), - XmlMappedEnumMember( - "DASHED_DOWNWARD_DIAGONAL", 28, "dashDnDiag", "Dashed Downward D" "iagonal" - ), - XmlMappedEnumMember("DASHED_HORIZONTAL", 32, "dashHorz", "Dashed Horizontal"), - XmlMappedEnumMember( - "DASHED_UPWARD_DIAGONAL", 27, "dashUpDiag", "Dashed Upward Diago" "nal" - ), - XmlMappedEnumMember("DASHED_VERTICAL", 31, "dashVert", "Dashed Vertical"), - XmlMappedEnumMember("DIAGONAL_BRICK", 40, "diagBrick", "Diagonal Brick"), - XmlMappedEnumMember("DIAGONAL_CROSS", 54, "diagCross", "Diagonal Cross"), - XmlMappedEnumMember("DIVOT", 46, "divot", "Pattern Divot"), - XmlMappedEnumMember("DOTTED_DIAMOND", 24, "dotDmnd", "Dotted Diamond"), - XmlMappedEnumMember("DOTTED_GRID", 45, "dotGrid", "Dotted Grid"), - XmlMappedEnumMember("DOWNWARD_DIAGONAL", 52, "dnDiag", "Downward Diagonal"), - XmlMappedEnumMember("HORIZONTAL", 49, "horz", "Horizontal"), - XmlMappedEnumMember("HORIZONTAL_BRICK", 35, "horzBrick", "Horizontal Brick"), - XmlMappedEnumMember( - "LARGE_CHECKER_BOARD", 36, "lgCheck", "Large Checker Board" - ), - XmlMappedEnumMember("LARGE_CONFETTI", 33, "lgConfetti", "Large Confetti"), - XmlMappedEnumMember("LARGE_GRID", 34, "lgGrid", "Large Grid"), - XmlMappedEnumMember( - "LIGHT_DOWNWARD_DIAGONAL", 21, "ltDnDiag", "Light Downward Diago" "nal" - ), - XmlMappedEnumMember("LIGHT_HORIZONTAL", 19, "ltHorz", "Light Horizontal"), - XmlMappedEnumMember( - "LIGHT_UPWARD_DIAGONAL", 22, "ltUpDiag", "Light Upward Diagonal" - ), - XmlMappedEnumMember("LIGHT_VERTICAL", 20, "ltVert", "Light Vertical"), - XmlMappedEnumMember("NARROW_HORIZONTAL", 30, "narHorz", "Narrow Horizontal"), - XmlMappedEnumMember("NARROW_VERTICAL", 29, "narVert", "Narrow Vertical"), - XmlMappedEnumMember("OUTLINED_DIAMOND", 41, "openDmnd", "Outlined Diamond"), - XmlMappedEnumMember("PERCENT_10", 2, "pct10", "10% of the foreground color."), - XmlMappedEnumMember("PERCENT_20", 3, "pct20", "20% of the foreground color."), - XmlMappedEnumMember("PERCENT_25", 4, "pct25", "25% of the foreground color."), - XmlMappedEnumMember("PERCENT_30", 5, "pct30", "30% of the foreground color."), - XmlMappedEnumMember("PERCENT_40", 6, "pct40", "40% of the foreground color."), - XmlMappedEnumMember("PERCENT_5", 1, "pct5", "5% of the foreground color."), - XmlMappedEnumMember("PERCENT_50", 7, "pct50", "50% of the foreground color."), - XmlMappedEnumMember("PERCENT_60", 8, "pct60", "60% of the foreground color."), - XmlMappedEnumMember("PERCENT_70", 9, "pct70", "70% of the foreground color."), - XmlMappedEnumMember("PERCENT_75", 10, "pct75", "75% of the foreground color."), - XmlMappedEnumMember("PERCENT_80", 11, "pct80", "80% of the foreground color."), - XmlMappedEnumMember("PERCENT_90", 12, "pct90", "90% of the foreground color."), - XmlMappedEnumMember("PLAID", 42, "plaid", "Plaid"), - XmlMappedEnumMember("SHINGLE", 47, "shingle", "Shingle"), - XmlMappedEnumMember( - "SMALL_CHECKER_BOARD", 17, "smCheck", "Small Checker Board" - ), - XmlMappedEnumMember("SMALL_CONFETTI", 37, "smConfetti", "Small Confetti"), - XmlMappedEnumMember("SMALL_GRID", 23, "smGrid", "Small Grid"), - XmlMappedEnumMember("SOLID_DIAMOND", 39, "solidDmnd", "Solid Diamond"), - XmlMappedEnumMember("SPHERE", 43, "sphere", "Sphere"), - XmlMappedEnumMember("TRELLIS", 18, "trellis", "Trellis"), - XmlMappedEnumMember("UPWARD_DIAGONAL", 53, "upDiag", "Upward Diagonal"), - XmlMappedEnumMember("VERTICAL", 50, "vert", "Vertical"), - XmlMappedEnumMember("WAVE", 48, "wave", "Wave"), - XmlMappedEnumMember("WEAVE", 44, "weave", "Weave"), - XmlMappedEnumMember( - "WIDE_DOWNWARD_DIAGONAL", 25, "wdDnDiag", "Wide Downward Diagona" "l" - ), - XmlMappedEnumMember( - "WIDE_UPWARD_DIAGONAL", 26, "wdUpDiag", "Wide Upward Diagonal" - ), - XmlMappedEnumMember("ZIG_ZAG", 38, "zigZag", "Zig Zag"), - ReturnValueOnlyEnumMember("MIXED", -2, "Mixed pattern."), - ) + DARK_HORIZONTAL = (13, "dkHorz", "Dark Horizontal") + """Dark Horizontal""" + DARK_UPWARD_DIAGONAL = (16, "dkUpDiag", "Dark Upward Diagonal") + """Dark Upward Diagonal""" -@alias("MSO_THEME_COLOR") -class MSO_THEME_COLOR_INDEX(XmlEnumeration): - """ - Indicates the Office theme color, one of those shown in the color gallery - on the formatting ribbon. + 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") + """Mixed pattern""" + + +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`` @@ -262,58 +337,65 @@ class MSO_THEME_COLOR_INDEX(XmlEnumeration): 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 """ - __ms_name__ = "MsoThemeColorIndex" + NOT_THEME_COLOR = (0, "", "Indicates the color is not a theme color.") + """Indicates the color is not a theme color.""" - __url__ = ( - "http://msdn.microsoft.com/en-us/library/office/ff860782(v=office.15" ").aspx" - ) + ACCENT_1 = (5, "accent1", "Specifies the Accent 1 theme color.") + """Specifies the Accent 1 theme color.""" - __members__ = ( - EnumMember("NOT_THEME_COLOR", 0, "Indicates the color is not a theme color."), - XmlMappedEnumMember( - "ACCENT_1", 5, "accent1", "Specifies the Accent 1 theme color." - ), - XmlMappedEnumMember( - "ACCENT_2", 6, "accent2", "Specifies the Accent 2 theme color." - ), - XmlMappedEnumMember( - "ACCENT_3", 7, "accent3", "Specifies the Accent 3 theme color." - ), - XmlMappedEnumMember( - "ACCENT_4", 8, "accent4", "Specifies the Accent 4 theme color." - ), - XmlMappedEnumMember( - "ACCENT_5", 9, "accent5", "Specifies the Accent 5 theme color." - ), - XmlMappedEnumMember( - "ACCENT_6", 10, "accent6", "Specifies the Accent 6 theme color." - ), - XmlMappedEnumMember( - "BACKGROUND_1", 14, "bg1", "Specifies the Background 1 theme " "color." - ), - XmlMappedEnumMember( - "BACKGROUND_2", 16, "bg2", "Specifies the Background 2 theme " "color." - ), - XmlMappedEnumMember("DARK_1", 1, "dk1", "Specifies the Dark 1 theme color."), - XmlMappedEnumMember("DARK_2", 3, "dk2", "Specifies the Dark 2 theme color."), - XmlMappedEnumMember( - "FOLLOWED_HYPERLINK", - 12, - "folHlink", - "Specifies the theme color" " for a clicked hyperlink.", - ), - XmlMappedEnumMember( - "HYPERLINK", 11, "hlink", "Specifies the theme color for a hyper" "link." - ), - XmlMappedEnumMember("LIGHT_1", 2, "lt1", "Specifies the Light 1 theme color."), - XmlMappedEnumMember("LIGHT_2", 4, "lt2", "Specifies the Light 2 theme color."), - XmlMappedEnumMember("TEXT_1", 13, "tx1", "Specifies the Text 1 theme color."), - XmlMappedEnumMember("TEXT_2", 15, "tx2", "Specifies the Text 2 theme color."), - ReturnValueOnlyEnumMember( - "MIXED", - -2, - "Indicates multiple theme colors are used, such as " "in a group shape.", - ), - ) + 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.") + """Indicates multiple theme colors are used, such as in a group shape.""" + + +MSO_THEME_COLOR = MSO_THEME_COLOR_INDEX diff --git a/src/pptx/enum/lang.py b/src/pptx/enum/lang.py index f466218ec..d2da5b6a5 100644 --- a/src/pptx/enum/lang.py +++ b/src/pptx/enum/lang.py @@ -1,20 +1,11 @@ -# encoding: utf-8 +"""Enumerations used for specifying language.""" -""" -Enumerations used for specifying language. -""" +from __future__ import annotations -from __future__ import absolute_import, division, print_function, unicode_literals +from pptx.enum.base import BaseXmlEnum -from .base import ( - EnumMember, - ReturnValueOnlyEnumMember, - XmlEnumeration, - XmlMappedEnumMember, -) - -class MSO_LANGUAGE_ID(XmlEnumeration): +class MSO_LANGUAGE_ID(BaseXmlEnum): """ Specifies the language identifier. @@ -23,478 +14,669 @@ class MSO_LANGUAGE_ID(XmlEnumeration): 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 """ - __ms_name__ = "MsoLanguageId" - - __url__ = "https://msdn.microsoft.com/en-us/library/office/ff862134.aspx" - - __members__ = ( - ReturnValueOnlyEnumMember( - "MIXED", -2, "More than one language in specified range." - ), - EnumMember("NONE", 0, "No language specified."), - XmlMappedEnumMember("AFRIKAANS", 1078, "af-ZA", "The Afrikaans language."), - XmlMappedEnumMember("ALBANIAN", 1052, "sq-AL", "The Albanian language."), - XmlMappedEnumMember("AMHARIC", 1118, "am-ET", "The Amharic language."), - XmlMappedEnumMember("ARABIC", 1025, "ar-SA", "The Arabic language."), - XmlMappedEnumMember( - "ARABIC_ALGERIA", 5121, "ar-DZ", "The Arabic Algeria language." - ), - XmlMappedEnumMember( - "ARABIC_BAHRAIN", 15361, "ar-BH", "The Arabic Bahrain language." - ), - XmlMappedEnumMember( - "ARABIC_EGYPT", 3073, "ar-EG", "The Arabic Egypt language." - ), - XmlMappedEnumMember("ARABIC_IRAQ", 2049, "ar-IQ", "The Arabic Iraq language."), - XmlMappedEnumMember( - "ARABIC_JORDAN", 11265, "ar-JO", "The Arabic Jordan language." - ), - XmlMappedEnumMember( - "ARABIC_KUWAIT", 13313, "ar-KW", "The Arabic Kuwait language." - ), - XmlMappedEnumMember( - "ARABIC_LEBANON", 12289, "ar-LB", "The Arabic Lebanon language." - ), - XmlMappedEnumMember( - "ARABIC_LIBYA", 4097, "ar-LY", "The Arabic Libya language." - ), - XmlMappedEnumMember( - "ARABIC_MOROCCO", 6145, "ar-MA", "The Arabic Morocco language." - ), - XmlMappedEnumMember("ARABIC_OMAN", 8193, "ar-OM", "The Arabic Oman language."), - XmlMappedEnumMember( - "ARABIC_QATAR", 16385, "ar-QA", "The Arabic Qatar language." - ), - XmlMappedEnumMember( - "ARABIC_SYRIA", 10241, "ar-SY", "The Arabic Syria language." - ), - XmlMappedEnumMember( - "ARABIC_TUNISIA", 7169, "ar-TN", "The Arabic Tunisia language." - ), - XmlMappedEnumMember("ARABIC_UAE", 14337, "ar-AE", "The Arabic UAE language."), - XmlMappedEnumMember( - "ARABIC_YEMEN", 9217, "ar-YE", "The Arabic Yemen language." - ), - XmlMappedEnumMember("ARMENIAN", 1067, "hy-AM", "The Armenian language."), - XmlMappedEnumMember("ASSAMESE", 1101, "as-IN", "The Assamese language."), - XmlMappedEnumMember( - "AZERI_CYRILLIC", 2092, "az-AZ", "The Azeri Cyrillic language." - ), - XmlMappedEnumMember( - "AZERI_LATIN", 1068, "az-Latn-AZ", "The Azeri Latin language." - ), - XmlMappedEnumMember("BASQUE", 1069, "eu-ES", "The Basque language."), - XmlMappedEnumMember( - "BELGIAN_DUTCH", 2067, "nl-BE", "The Belgian Dutch language." - ), - XmlMappedEnumMember( - "BELGIAN_FRENCH", 2060, "fr-BE", "The Belgian French language." - ), - XmlMappedEnumMember("BENGALI", 1093, "bn-IN", "The Bengali language."), - XmlMappedEnumMember("BOSNIAN", 4122, "hr-BA", "The Bosnian language."), - XmlMappedEnumMember( - "BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC", - 8218, - "bs-BA", - "The Bosni" "an Bosnia Herzegovina Cyrillic language.", - ), - XmlMappedEnumMember( - "BOSNIAN_BOSNIA_HERZEGOVINA_LATIN", - 5146, - "bs-Latn-BA", - "The Bos" "nian Bosnia Herzegovina Latin language.", - ), - XmlMappedEnumMember( - "BRAZILIAN_PORTUGUESE", - 1046, - "pt-BR", - "The Brazilian Portuguese" " language.", - ), - XmlMappedEnumMember("BULGARIAN", 1026, "bg-BG", "The Bulgarian language."), - XmlMappedEnumMember("BURMESE", 1109, "my-MM", "The Burmese language."), - XmlMappedEnumMember( - "BYELORUSSIAN", 1059, "be-BY", "The Byelorussian language." - ), - XmlMappedEnumMember("CATALAN", 1027, "ca-ES", "The Catalan language."), - XmlMappedEnumMember("CHEROKEE", 1116, "chr-US", "The Cherokee language."), - XmlMappedEnumMember( - "CHINESE_HONG_KONG_SAR", - 3076, - "zh-HK", - "The Chinese Hong Kong S" "AR language.", - ), - XmlMappedEnumMember( - "CHINESE_MACAO_SAR", 5124, "zh-MO", "The Chinese Macao SAR langu" "age." - ), - XmlMappedEnumMember( - "CHINESE_SINGAPORE", 4100, "zh-SG", "The Chinese Singapore langu" "age." - ), - XmlMappedEnumMember("CROATIAN", 1050, "hr-HR", "The Croatian language."), - XmlMappedEnumMember("CZECH", 1029, "cs-CZ", "The Czech language."), - XmlMappedEnumMember("DANISH", 1030, "da-DK", "The Danish language."), - XmlMappedEnumMember("DIVEHI", 1125, "div-MV", "The Divehi language."), - XmlMappedEnumMember("DUTCH", 1043, "nl-NL", "The Dutch language."), - XmlMappedEnumMember("EDO", 1126, "bin-NG", "The Edo language."), - XmlMappedEnumMember("ENGLISH_AUS", 3081, "en-AU", "The English AUS language."), - XmlMappedEnumMember( - "ENGLISH_BELIZE", 10249, "en-BZ", "The English Belize language." - ), - XmlMappedEnumMember( - "ENGLISH_CANADIAN", 4105, "en-CA", "The English Canadian languag" "e." - ), - XmlMappedEnumMember( - "ENGLISH_CARIBBEAN", 9225, "en-CB", "The English Caribbean langu" "age." - ), - XmlMappedEnumMember( - "ENGLISH_INDONESIA", 14345, "en-ID", "The English Indonesia lang" "uage." - ), - XmlMappedEnumMember( - "ENGLISH_IRELAND", 6153, "en-IE", "The English Ireland language." - ), - XmlMappedEnumMember( - "ENGLISH_JAMAICA", 8201, "en-JA", "The English Jamaica language." - ), - XmlMappedEnumMember( - "ENGLISH_NEW_ZEALAND", 5129, "en-NZ", "The English NewZealand la" "nguage." - ), - XmlMappedEnumMember( - "ENGLISH_PHILIPPINES", - 13321, - "en-PH", - "The English Philippines " "language.", - ), - XmlMappedEnumMember( - "ENGLISH_SOUTH_AFRICA", - 7177, - "en-ZA", - "The English South Africa" " language.", - ), - XmlMappedEnumMember( - "ENGLISH_TRINIDAD_TOBAGO", - 11273, - "en-TT", - "The English Trinidad" " Tobago language.", - ), - XmlMappedEnumMember("ENGLISH_UK", 2057, "en-GB", "The English UK language."), - XmlMappedEnumMember("ENGLISH_US", 1033, "en-US", "The English US language."), - XmlMappedEnumMember( - "ENGLISH_ZIMBABWE", 12297, "en-ZW", "The English Zimbabwe langua" "ge." - ), - XmlMappedEnumMember("ESTONIAN", 1061, "et-EE", "The Estonian language."), - XmlMappedEnumMember("FAEROESE", 1080, "fo-FO", "The Faeroese language."), - XmlMappedEnumMember("FARSI", 1065, "fa-IR", "The Farsi language."), - XmlMappedEnumMember("FILIPINO", 1124, "fil-PH", "The Filipino language."), - XmlMappedEnumMember("FINNISH", 1035, "fi-FI", "The Finnish language."), - XmlMappedEnumMember( - "FRANCH_CONGO_DRC", 9228, "fr-CD", "The French Congo DRC languag" "e." - ), - XmlMappedEnumMember("FRENCH", 1036, "fr-FR", "The French language."), - XmlMappedEnumMember( - "FRENCH_CAMEROON", 11276, "fr-CM", "The French Cameroon language" "." - ), - XmlMappedEnumMember( - "FRENCH_CANADIAN", 3084, "fr-CA", "The French Canadian language." - ), - XmlMappedEnumMember( - "FRENCH_COTED_IVOIRE", - 12300, - "fr-CI", - "The French Coted Ivoire " "language.", - ), - XmlMappedEnumMember( - "FRENCH_HAITI", 15372, "fr-HT", "The French Haiti language." - ), - XmlMappedEnumMember( - "FRENCH_LUXEMBOURG", 5132, "fr-LU", "The French Luxembourg langu" "age." - ), - XmlMappedEnumMember("FRENCH_MALI", 13324, "fr-ML", "The French Mali language."), - XmlMappedEnumMember( - "FRENCH_MONACO", 6156, "fr-MC", "The French Monaco language." - ), - XmlMappedEnumMember( - "FRENCH_MOROCCO", 14348, "fr-MA", "The French Morocco language." - ), - XmlMappedEnumMember( - "FRENCH_REUNION", 8204, "fr-RE", "The French Reunion language." - ), - XmlMappedEnumMember( - "FRENCH_SENEGAL", 10252, "fr-SN", "The French Senegal language." - ), - XmlMappedEnumMember( - "FRENCH_WEST_INDIES", - 7180, - "fr-WINDIES", - "The French West Indie" "s language.", - ), - XmlMappedEnumMember( - "FRISIAN_NETHERLANDS", 1122, "fy-NL", "The Frisian Netherlands l" "anguage." - ), - XmlMappedEnumMember("FULFULDE", 1127, "ff-NG", "The Fulfulde language."), - XmlMappedEnumMember( - "GAELIC_IRELAND", 2108, "ga-IE", "The Gaelic Ireland language." - ), - XmlMappedEnumMember( - "GAELIC_SCOTLAND", 1084, "en-US", "The Gaelic Scotland language." - ), - XmlMappedEnumMember("GALICIAN", 1110, "gl-ES", "The Galician language."), - XmlMappedEnumMember("GEORGIAN", 1079, "ka-GE", "The Georgian language."), - XmlMappedEnumMember("GERMAN", 1031, "de-DE", "The German language."), - XmlMappedEnumMember( - "GERMAN_AUSTRIA", 3079, "de-AT", "The German Austria language." - ), - XmlMappedEnumMember( - "GERMAN_LIECHTENSTEIN", - 5127, - "de-LI", - "The German Liechtenstein" " language.", - ), - XmlMappedEnumMember( - "GERMAN_LUXEMBOURG", 4103, "de-LU", "The German Luxembourg langu" "age." - ), - XmlMappedEnumMember("GREEK", 1032, "el-GR", "The Greek language."), - XmlMappedEnumMember("GUARANI", 1140, "gn-PY", "The Guarani language."), - XmlMappedEnumMember("GUJARATI", 1095, "gu-IN", "The Gujarati language."), - XmlMappedEnumMember("HAUSA", 1128, "ha-NG", "The Hausa language."), - XmlMappedEnumMember("HAWAIIAN", 1141, "haw-US", "The Hawaiian language."), - XmlMappedEnumMember("HEBREW", 1037, "he-IL", "The Hebrew language."), - XmlMappedEnumMember("HINDI", 1081, "hi-IN", "The Hindi language."), - XmlMappedEnumMember("HUNGARIAN", 1038, "hu-HU", "The Hungarian language."), - XmlMappedEnumMember("IBIBIO", 1129, "ibb-NG", "The Ibibio language."), - XmlMappedEnumMember("ICELANDIC", 1039, "is-IS", "The Icelandic language."), - XmlMappedEnumMember("IGBO", 1136, "ig-NG", "The Igbo language."), - XmlMappedEnumMember("INDONESIAN", 1057, "id-ID", "The Indonesian language."), - XmlMappedEnumMember("INUKTITUT", 1117, "iu-Cans-CA", "The Inuktitut language."), - XmlMappedEnumMember("ITALIAN", 1040, "it-IT", "The Italian language."), - XmlMappedEnumMember("JAPANESE", 1041, "ja-JP", "The Japanese language."), - XmlMappedEnumMember("KANNADA", 1099, "kn-IN", "The Kannada language."), - XmlMappedEnumMember("KANURI", 1137, "kr-NG", "The Kanuri language."), - XmlMappedEnumMember("KASHMIRI", 1120, "ks-Arab", "The Kashmiri language."), - XmlMappedEnumMember( - "KASHMIRI_DEVANAGARI", - 2144, - "ks-Deva", - "The Kashmiri Devanagari" " language.", - ), - XmlMappedEnumMember("KAZAKH", 1087, "kk-KZ", "The Kazakh language."), - XmlMappedEnumMember("KHMER", 1107, "kh-KH", "The Khmer language."), - XmlMappedEnumMember("KIRGHIZ", 1088, "ky-KG", "The Kirghiz language."), - XmlMappedEnumMember("KONKANI", 1111, "kok-IN", "The Konkani language."), - XmlMappedEnumMember("KOREAN", 1042, "ko-KR", "The Korean language."), - XmlMappedEnumMember("KYRGYZ", 1088, "ky-KG", "The Kyrgyz language."), - XmlMappedEnumMember("LAO", 1108, "lo-LA", "The Lao language."), - XmlMappedEnumMember("LATIN", 1142, "la-Latn", "The Latin language."), - XmlMappedEnumMember("LATVIAN", 1062, "lv-LV", "The Latvian language."), - XmlMappedEnumMember("LITHUANIAN", 1063, "lt-LT", "The Lithuanian language."), - XmlMappedEnumMember( - "MACEDONINAN_FYROM", 1071, "mk-MK", "The Macedonian FYROM langua" "ge." - ), - XmlMappedEnumMember( - "MALAY_BRUNEI_DARUSSALAM", - 2110, - "ms-BN", - "The Malay Brunei Daru" "ssalam language.", - ), - XmlMappedEnumMember("MALAYALAM", 1100, "ml-IN", "The Malayalam language."), - XmlMappedEnumMember("MALAYSIAN", 1086, "ms-MY", "The Malaysian language."), - XmlMappedEnumMember("MALTESE", 1082, "mt-MT", "The Maltese language."), - XmlMappedEnumMember("MANIPURI", 1112, "mni-IN", "The Manipuri language."), - XmlMappedEnumMember("MAORI", 1153, "mi-NZ", "The Maori language."), - XmlMappedEnumMember("MARATHI", 1102, "mr-IN", "The Marathi language."), - XmlMappedEnumMember( - "MEXICAN_SPANISH", 2058, "es-MX", "The Mexican Spanish language." - ), - XmlMappedEnumMember("MONGOLIAN", 1104, "mn-MN", "The Mongolian language."), - XmlMappedEnumMember("NEPALI", 1121, "ne-NP", "The Nepali language."), - XmlMappedEnumMember("NO_PROOFING", 1024, "en-US", "No proofing."), - XmlMappedEnumMember( - "NORWEGIAN_BOKMOL", 1044, "nb-NO", "The Norwegian Bokmol languag" "e." - ), - XmlMappedEnumMember( - "NORWEGIAN_NYNORSK", 2068, "nn-NO", "The Norwegian Nynorsk langu" "age." - ), - XmlMappedEnumMember("ORIYA", 1096, "or-IN", "The Oriya language."), - XmlMappedEnumMember("OROMO", 1138, "om-Ethi-ET", "The Oromo language."), - XmlMappedEnumMember("PASHTO", 1123, "ps-AF", "The Pashto language."), - XmlMappedEnumMember("POLISH", 1045, "pl-PL", "The Polish language."), - XmlMappedEnumMember("PORTUGUESE", 2070, "pt-PT", "The Portuguese language."), - XmlMappedEnumMember("PUNJABI", 1094, "pa-IN", "The Punjabi language."), - XmlMappedEnumMember( - "QUECHUA_BOLIVIA", 1131, "quz-BO", "The Quechua Bolivia language" "." - ), - XmlMappedEnumMember( - "QUECHUA_ECUADOR", 2155, "quz-EC", "The Quechua Ecuador language" "." - ), - XmlMappedEnumMember( - "QUECHUA_PERU", 3179, "quz-PE", "The Quechua Peru language." - ), - XmlMappedEnumMember( - "RHAETO_ROMANIC", 1047, "rm-CH", "The Rhaeto Romanic language." - ), - XmlMappedEnumMember("ROMANIAN", 1048, "ro-RO", "The Romanian language."), - XmlMappedEnumMember( - "ROMANIAN_MOLDOVA", 2072, "ro-MO", "The Romanian Moldova languag" "e." - ), - XmlMappedEnumMember("RUSSIAN", 1049, "ru-RU", "The Russian language."), - XmlMappedEnumMember( - "RUSSIAN_MOLDOVA", 2073, "ru-MO", "The Russian Moldova language." - ), - XmlMappedEnumMember( - "SAMI_LAPPISH", 1083, "se-NO", "The Sami Lappish language." - ), - XmlMappedEnumMember("SANSKRIT", 1103, "sa-IN", "The Sanskrit language."), - XmlMappedEnumMember("SEPEDI", 1132, "ns-ZA", "The Sepedi language."), - XmlMappedEnumMember( - "SERBIAN_BOSNIA_HERZEGOVINA_CYRILLIC", - 7194, - "sr-BA", - "The Serbi" "an Bosnia Herzegovina Cyrillic language.", - ), - XmlMappedEnumMember( - "SERBIAN_BOSNIA_HERZEGOVINA_LATIN", - 6170, - "sr-Latn-BA", - "The Ser" "bian Bosnia Herzegovina Latin language.", - ), - XmlMappedEnumMember( - "SERBIAN_CYRILLIC", 3098, "sr-SP", "The Serbian Cyrillic languag" "e." - ), - XmlMappedEnumMember( - "SERBIAN_LATIN", 2074, "sr-Latn-CS", "The Serbian Latin language" "." - ), - XmlMappedEnumMember("SESOTHO", 1072, "st-ZA", "The Sesotho language."), - XmlMappedEnumMember( - "SIMPLIFIED_CHINESE", 2052, "zh-CN", "The Simplified Chinese lan" "guage." - ), - XmlMappedEnumMember("SINDHI", 1113, "sd-Deva-IN", "The Sindhi language."), - XmlMappedEnumMember( - "SINDHI_PAKISTAN", 2137, "sd-Arab-PK", "The Sindhi Pakistan lang" "uage." - ), - XmlMappedEnumMember("SINHALESE", 1115, "si-LK", "The Sinhalese language."), - XmlMappedEnumMember("SLOVAK", 1051, "sk-SK", "The Slovak language."), - XmlMappedEnumMember("SLOVENIAN", 1060, "sl-SI", "The Slovenian language."), - XmlMappedEnumMember("SOMALI", 1143, "so-SO", "The Somali language."), - XmlMappedEnumMember("SORBIAN", 1070, "wen-DE", "The Sorbian language."), - XmlMappedEnumMember("SPANISH", 1034, "es-ES_tradnl", "The Spanish language."), - XmlMappedEnumMember( - "SPANISH_ARGENTINA", 11274, "es-AR", "The Spanish Argentina lang" "uage." - ), - XmlMappedEnumMember( - "SPANISH_BOLIVIA", 16394, "es-BO", "The Spanish Bolivia language" "." - ), - XmlMappedEnumMember( - "SPANISH_CHILE", 13322, "es-CL", "The Spanish Chile language." - ), - XmlMappedEnumMember( - "SPANISH_COLOMBIA", 9226, "es-CO", "The Spanish Colombia languag" "e." - ), - XmlMappedEnumMember( - "SPANISH_COSTA_RICA", 5130, "es-CR", "The Spanish Costa Rica lan" "guage." - ), - XmlMappedEnumMember( - "SPANISH_DOMINICAN_REPUBLIC", - 7178, - "es-DO", - "The Spanish Domini" "can Republic language.", - ), - XmlMappedEnumMember( - "SPANISH_ECUADOR", 12298, "es-EC", "The Spanish Ecuador language" "." - ), - XmlMappedEnumMember( - "SPANISH_EL_SALVADOR", - 17418, - "es-SV", - "The Spanish El Salvador " "language.", - ), - XmlMappedEnumMember( - "SPANISH_GUATEMALA", 4106, "es-GT", "The Spanish Guatemala langu" "age." - ), - XmlMappedEnumMember( - "SPANISH_HONDURAS", 18442, "es-HN", "The Spanish Honduras langua" "ge." - ), - XmlMappedEnumMember( - "SPANISH_MODERN_SORT", 3082, "es-ES", "The Spanish Modern Sort l" "anguage." - ), - XmlMappedEnumMember( - "SPANISH_NICARAGUA", 19466, "es-NI", "The Spanish Nicaragua lang" "uage." - ), - XmlMappedEnumMember( - "SPANISH_PANAMA", 6154, "es-PA", "The Spanish Panama language." - ), - XmlMappedEnumMember( - "SPANISH_PARAGUAY", 15370, "es-PY", "The Spanish Paraguay langua" "ge." - ), - XmlMappedEnumMember( - "SPANISH_PERU", 10250, "es-PE", "The Spanish Peru language." - ), - XmlMappedEnumMember( - "SPANISH_PUERTO_RICO", - 20490, - "es-PR", - "The Spanish Puerto Rico " "language.", - ), - XmlMappedEnumMember( - "SPANISH_URUGUAY", 14346, "es-UR", "The Spanish Uruguay language" "." - ), - XmlMappedEnumMember( - "SPANISH_VENEZUELA", 8202, "es-VE", "The Spanish Venezuela langu" "age." - ), - XmlMappedEnumMember("SUTU", 1072, "st-ZA", "The Sutu language."), - XmlMappedEnumMember("SWAHILI", 1089, "sw-KE", "The Swahili language."), - XmlMappedEnumMember("SWEDISH", 1053, "sv-SE", "The Swedish language."), - XmlMappedEnumMember( - "SWEDISH_FINLAND", 2077, "sv-FI", "The Swedish Finland language." - ), - XmlMappedEnumMember( - "SWISS_FRENCH", 4108, "fr-CH", "The Swiss French language." - ), - XmlMappedEnumMember( - "SWISS_GERMAN", 2055, "de-CH", "The Swiss German language." - ), - XmlMappedEnumMember( - "SWISS_ITALIAN", 2064, "it-CH", "The Swiss Italian language." - ), - XmlMappedEnumMember("SYRIAC", 1114, "syr-SY", "The Syriac language."), - XmlMappedEnumMember("TAJIK", 1064, "tg-TJ", "The Tajik language."), - XmlMappedEnumMember( - "TAMAZIGHT", 1119, "tzm-Arab-MA", "The Tamazight language." - ), - XmlMappedEnumMember( - "TAMAZIGHT_LATIN", 2143, "tmz-DZ", "The Tamazight Latin language" "." - ), - XmlMappedEnumMember("TAMIL", 1097, "ta-IN", "The Tamil language."), - XmlMappedEnumMember("TATAR", 1092, "tt-RU", "The Tatar language."), - XmlMappedEnumMember("TELUGU", 1098, "te-IN", "The Telugu language."), - XmlMappedEnumMember("THAI", 1054, "th-TH", "The Thai language."), - XmlMappedEnumMember("TIBETAN", 1105, "bo-CN", "The Tibetan language."), - XmlMappedEnumMember( - "TIGRIGNA_ERITREA", 2163, "ti-ER", "The Tigrigna Eritrea languag" "e." - ), - XmlMappedEnumMember( - "TIGRIGNA_ETHIOPIC", 1139, "ti-ET", "The Tigrigna Ethiopic langu" "age." - ), - XmlMappedEnumMember( - "TRADITIONAL_CHINESE", 1028, "zh-TW", "The Traditional Chinese l" "anguage." - ), - XmlMappedEnumMember("TSONGA", 1073, "ts-ZA", "The Tsonga language."), - XmlMappedEnumMember("TSWANA", 1074, "tn-ZA", "The Tswana language."), - XmlMappedEnumMember("TURKISH", 1055, "tr-TR", "The Turkish language."), - XmlMappedEnumMember("TURKMEN", 1090, "tk-TM", "The Turkmen language."), - XmlMappedEnumMember("UKRAINIAN", 1058, "uk-UA", "The Ukrainian language."), - XmlMappedEnumMember("URDU", 1056, "ur-PK", "The Urdu language."), - XmlMappedEnumMember( - "UZBEK_CYRILLIC", 2115, "uz-UZ", "The Uzbek Cyrillic language." - ), - XmlMappedEnumMember( - "UZBEK_LATIN", 1091, "uz-Latn-UZ", "The Uzbek Latin language." - ), - XmlMappedEnumMember("VENDA", 1075, "ve-ZA", "The Venda language."), - XmlMappedEnumMember("VIETNAMESE", 1066, "vi-VN", "The Vietnamese language."), - XmlMappedEnumMember("WELSH", 1106, "cy-GB", "The Welsh language."), - XmlMappedEnumMember("XHOSA", 1076, "xh-ZA", "The Xhosa language."), - XmlMappedEnumMember("YI", 1144, "ii-CN", "The Yi language."), - XmlMappedEnumMember("YIDDISH", 1085, "yi-Hebr", "The Yiddish language."), - XmlMappedEnumMember("YORUBA", 1130, "yo-NG", "The Yoruba language."), - XmlMappedEnumMember("ZULU", 1077, "zu-ZA", "The Zulu language."), + 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.""" diff --git a/src/pptx/enum/shapes.py b/src/pptx/enum/shapes.py index e4758cf02..b1dec8adc 100644 --- a/src/pptx/enum/shapes.py +++ b/src/pptx/enum/shapes.py @@ -1,22 +1,14 @@ -# encoding: utf-8 - """Enumerations used by shapes and related objects.""" -from pptx.enum.base import ( - alias, - Enumeration, - EnumMember, - ReturnValueOnlyEnumMember, - XmlEnumeration, - XmlMappedEnumMember, -) -from pptx.util import lazyproperty +from __future__ import annotations +import enum + +from pptx.enum.base import BaseEnum, BaseXmlEnum -@alias("MSO_SHAPE") -class MSO_AUTO_SHAPE_TYPE(XmlEnumeration): - """ - Specifies a type of AutoShape, e.g. DOWN_ARROW + +class MSO_AUTO_SHAPE_TYPE(BaseXmlEnum): + """Specifies a type of AutoShape, e.g. DOWN_ARROW. Alias: ``MSO_SHAPE`` @@ -29,618 +21,703 @@ class MSO_AUTO_SHAPE_TYPE(XmlEnumeration): slide.shapes.add_shape( MSO_SHAPE.ROUNDED_RECTANGLE, left, top, width, height ) + + MS API Name: `MsoAutoShapeType` + + https://learn.microsoft.com/en-us/office/vba/api/Office.MsoAutoShapeType """ - __ms_name__ = "MsoAutoShapeType" - - __url__ = ( - "http://msdn.microsoft.com/en-us/library/office/ff862770(v=office.15" ").aspx" - ) - - __members__ = ( - XmlMappedEnumMember( - "ACTION_BUTTON_BACK_OR_PREVIOUS", - 129, - "actionButtonBackPrevious", - "Back or Previous button. Supports " "mouse-click and mouse-over actions", - ), - XmlMappedEnumMember( - "ACTION_BUTTON_BEGINNING", - 131, - "actionButtonBeginning", - "Beginning button. Supports mouse-click and mouse-over actions", - ), - XmlMappedEnumMember( - "ACTION_BUTTON_CUSTOM", - 125, - "actionButtonBlank", - "Button with no default picture or text. Supports mouse-click an" - "d mouse-over actions", - ), - XmlMappedEnumMember( - "ACTION_BUTTON_DOCUMENT", - 134, - "actionButtonDocument", - "Document button. Supports mouse-click and mouse-over actions", - ), - XmlMappedEnumMember( - "ACTION_BUTTON_END", - 132, - "actionButtonEnd", - "End button. Supports mouse-click and mouse-over actions", - ), - XmlMappedEnumMember( - "ACTION_BUTTON_FORWARD_OR_NEXT", - 130, - "actionButtonForwardNext", - "Forward or Next button. Supports mouse-click and mouse-over act" "ions", - ), - XmlMappedEnumMember( - "ACTION_BUTTON_HELP", - 127, - "actionButtonHelp", - "Help button. Supports mouse-click and mouse-over actions", - ), - XmlMappedEnumMember( - "ACTION_BUTTON_HOME", - 126, - "actionButtonHome", - "Home button. Supports mouse-click and mouse-over actions", - ), - XmlMappedEnumMember( - "ACTION_BUTTON_INFORMATION", - 128, - "actionButtonInformation", - "Information button. Supports mouse-click and mouse-over actions", - ), - XmlMappedEnumMember( - "ACTION_BUTTON_MOVIE", - 136, - "actionButtonMovie", - "Movie button. Supports mouse-click and mouse-over actions", - ), - XmlMappedEnumMember( - "ACTION_BUTTON_RETURN", - 133, - "actionButtonReturn", - "Return button. Supports mouse-click and mouse-over actions", - ), - XmlMappedEnumMember( - "ACTION_BUTTON_SOUND", - 135, - "actionButtonSound", - "Sound button. Supports mouse-click and mouse-over actions", - ), - XmlMappedEnumMember("ARC", 25, "arc", "Arc"), - XmlMappedEnumMember( - "BALLOON", 137, "wedgeRoundRectCallout", "Rounded Rectangular Callout" - ), - XmlMappedEnumMember( - "BENT_ARROW", - 41, - "bentArrow", - "Block arrow that follows a curved 90-degree angle", - ), - XmlMappedEnumMember( - "BENT_UP_ARROW", - 44, - "bentUpArrow", - "Block arrow that follows a sharp 90-degree angle. Points up by " "default", - ), - XmlMappedEnumMember("BEVEL", 15, "bevel", "Bevel"), - XmlMappedEnumMember("BLOCK_ARC", 20, "blockArc", "Block arc"), - XmlMappedEnumMember("CAN", 13, "can", "Can"), - XmlMappedEnumMember("CHART_PLUS", 182, "chartPlus", "Chart Plus"), - XmlMappedEnumMember("CHART_STAR", 181, "chartStar", "Chart Star"), - XmlMappedEnumMember("CHART_X", 180, "chartX", "Chart X"), - XmlMappedEnumMember("CHEVRON", 52, "chevron", "Chevron"), - XmlMappedEnumMember("CHORD", 161, "chord", "Geometric chord shape"), - XmlMappedEnumMember( - "CIRCULAR_ARROW", - 60, - "circularArrow", - "Block arrow that follows a curved 180-degree angle", - ), - XmlMappedEnumMember("CLOUD", 179, "cloud", "Cloud"), - XmlMappedEnumMember("CLOUD_CALLOUT", 108, "cloudCallout", "Cloud callout"), - XmlMappedEnumMember("CORNER", 162, "corner", "Corner"), - XmlMappedEnumMember("CORNER_TABS", 169, "cornerTabs", "Corner Tabs"), - XmlMappedEnumMember("CROSS", 11, "plus", "Cross"), - XmlMappedEnumMember("CUBE", 14, "cube", "Cube"), - XmlMappedEnumMember( - "CURVED_DOWN_ARROW", 48, "curvedDownArrow", "Block arrow that curves down" - ), - XmlMappedEnumMember( - "CURVED_DOWN_RIBBON", 100, "ellipseRibbon", "Ribbon banner that curves down" - ), - XmlMappedEnumMember( - "CURVED_LEFT_ARROW", 46, "curvedLeftArrow", "Block arrow that curves left" - ), - XmlMappedEnumMember( - "CURVED_RIGHT_ARROW", - 45, - "curvedRightArrow", - "Block arrow that curves right", - ), - XmlMappedEnumMember( - "CURVED_UP_ARROW", 47, "curvedUpArrow", "Block arrow that curves up" - ), - XmlMappedEnumMember( - "CURVED_UP_RIBBON", 99, "ellipseRibbon2", "Ribbon banner that curves up" - ), - XmlMappedEnumMember("DECAGON", 144, "decagon", "Decagon"), - XmlMappedEnumMember("DIAGONAL_STRIPE", 141, "diagStripe", "Diagonal Stripe"), - XmlMappedEnumMember("DIAMOND", 4, "diamond", "Diamond"), - XmlMappedEnumMember("DODECAGON", 146, "dodecagon", "Dodecagon"), - XmlMappedEnumMember("DONUT", 18, "donut", "Donut"), - XmlMappedEnumMember("DOUBLE_BRACE", 27, "bracePair", "Double brace"), - XmlMappedEnumMember("DOUBLE_BRACKET", 26, "bracketPair", "Double bracket"), - XmlMappedEnumMember("DOUBLE_WAVE", 104, "doubleWave", "Double wave"), - XmlMappedEnumMember( - "DOWN_ARROW", 36, "downArrow", "Block arrow that points down" - ), - XmlMappedEnumMember( - "DOWN_ARROW_CALLOUT", - 56, - "downArrowCallout", - "Callout with arrow that points down", - ), - XmlMappedEnumMember( - "DOWN_RIBBON", - 98, - "ribbon", - "Ribbon banner with center area below ribbon ends", - ), - XmlMappedEnumMember("EXPLOSION1", 89, "irregularSeal1", "Explosion"), - XmlMappedEnumMember("EXPLOSION2", 90, "irregularSeal2", "Explosion"), - XmlMappedEnumMember( - "FLOWCHART_ALTERNATE_PROCESS", - 62, - "flowChartAlternateProcess", - "Alternate process flowchart symbol", - ), - XmlMappedEnumMember( - "FLOWCHART_CARD", 75, "flowChartPunchedCard", "Card flowchart symbol" - ), - XmlMappedEnumMember( - "FLOWCHART_COLLATE", 79, "flowChartCollate", "Collate flowchart symbol" - ), - XmlMappedEnumMember( - "FLOWCHART_CONNECTOR", - 73, - "flowChartConnector", - "Connector flowchart symbol", - ), - XmlMappedEnumMember( - "FLOWCHART_DATA", 64, "flowChartInputOutput", "Data flowchart symbol" - ), - XmlMappedEnumMember( - "FLOWCHART_DECISION", 63, "flowChartDecision", "Decision flowchart symbol" - ), - XmlMappedEnumMember( - "FLOWCHART_DELAY", 84, "flowChartDelay", "Delay flowchart symbol" - ), - XmlMappedEnumMember( - "FLOWCHART_DIRECT_ACCESS_STORAGE", - 87, - "flowChartMagneticDrum", - "Direct access storage flowchart symbol", - ), - XmlMappedEnumMember( - "FLOWCHART_DISPLAY", 88, "flowChartDisplay", "Display flowchart symbol" - ), - XmlMappedEnumMember( - "FLOWCHART_DOCUMENT", 67, "flowChartDocument", "Document flowchart symbol" - ), - XmlMappedEnumMember( - "FLOWCHART_EXTRACT", 81, "flowChartExtract", "Extract flowchart symbol" - ), - XmlMappedEnumMember( - "FLOWCHART_INTERNAL_STORAGE", - 66, - "flowChartInternalStorage", - "Internal storage flowchart symbol", - ), - XmlMappedEnumMember( - "FLOWCHART_MAGNETIC_DISK", - 86, - "flowChartMagneticDisk", - "Magnetic disk flowchart symbol", - ), - XmlMappedEnumMember( - "FLOWCHART_MANUAL_INPUT", - 71, - "flowChartManualInput", - "Manual input flowchart symbol", - ), - XmlMappedEnumMember( - "FLOWCHART_MANUAL_OPERATION", - 72, - "flowChartManualOperation", - "Manual operation flowchart symbol", - ), - XmlMappedEnumMember( - "FLOWCHART_MERGE", 82, "flowChartMerge", "Merge flowchart symbol" - ), - XmlMappedEnumMember( - "FLOWCHART_MULTIDOCUMENT", - 68, - "flowChartMultidocument", - "Multi-document flowchart symbol", - ), - XmlMappedEnumMember( - "FLOWCHART_OFFLINE_STORAGE", - 139, - "flowChartOfflineStorage", - "Offline Storage", - ), - XmlMappedEnumMember( - "FLOWCHART_OFFPAGE_CONNECTOR", - 74, - "flowChartOffpageConnector", - "Off-page connector flowchart symbol", - ), - XmlMappedEnumMember("FLOWCHART_OR", 78, "flowChartOr", '"Or" flowchart symbol'), - XmlMappedEnumMember( - "FLOWCHART_PREDEFINED_PROCESS", - 65, - "flowChartPredefinedProcess", - "Predefined process flowchart symbol", - ), - XmlMappedEnumMember( - "FLOWCHART_PREPARATION", - 70, - "flowChartPreparation", - "Preparation flowchart symbol", - ), - XmlMappedEnumMember( - "FLOWCHART_PROCESS", 61, "flowChartProcess", "Process flowchart symbol" - ), - XmlMappedEnumMember( - "FLOWCHART_PUNCHED_TAPE", - 76, - "flowChartPunchedTape", - "Punched tape flowchart symbol", - ), - XmlMappedEnumMember( - "FLOWCHART_SEQUENTIAL_ACCESS_STORAGE", - 85, - "flowChartMagneticTape", - "Sequential access storage flowchart symbol", - ), - XmlMappedEnumMember( - "FLOWCHART_SORT", 80, "flowChartSort", "Sort flowchart symbol" - ), - XmlMappedEnumMember( - "FLOWCHART_STORED_DATA", - 83, - "flowChartOnlineStorage", - "Stored data flowchart symbol", - ), - XmlMappedEnumMember( - "FLOWCHART_SUMMING_JUNCTION", - 77, - "flowChartSummingJunction", - "Summing junction flowchart symbol", - ), - XmlMappedEnumMember( - "FLOWCHART_TERMINATOR", - 69, - "flowChartTerminator", - "Terminator flowchart symbol", - ), - XmlMappedEnumMember("FOLDED_CORNER", 16, "foldedCorner", "Folded corner"), - XmlMappedEnumMember("FRAME", 158, "frame", "Frame"), - XmlMappedEnumMember("FUNNEL", 174, "funnel", "Funnel"), - XmlMappedEnumMember("GEAR_6", 172, "gear6", "Gear 6"), - XmlMappedEnumMember("GEAR_9", 173, "gear9", "Gear 9"), - XmlMappedEnumMember("HALF_FRAME", 159, "halfFrame", "Half Frame"), - XmlMappedEnumMember("HEART", 21, "heart", "Heart"), - XmlMappedEnumMember("HEPTAGON", 145, "heptagon", "Heptagon"), - XmlMappedEnumMember("HEXAGON", 10, "hexagon", "Hexagon"), - XmlMappedEnumMember( - "HORIZONTAL_SCROLL", 102, "horizontalScroll", "Horizontal scroll" - ), - XmlMappedEnumMember("ISOSCELES_TRIANGLE", 7, "triangle", "Isosceles triangle"), - XmlMappedEnumMember( - "LEFT_ARROW", 34, "leftArrow", "Block arrow that points left" - ), - XmlMappedEnumMember( - "LEFT_ARROW_CALLOUT", - 54, - "leftArrowCallout", - "Callout with arrow that points left", - ), - XmlMappedEnumMember("LEFT_BRACE", 31, "leftBrace", "Left brace"), - XmlMappedEnumMember("LEFT_BRACKET", 29, "leftBracket", "Left bracket"), - XmlMappedEnumMember( - "LEFT_CIRCULAR_ARROW", 176, "leftCircularArrow", "Left Circular Arrow" - ), - XmlMappedEnumMember( - "LEFT_RIGHT_ARROW", - 37, - "leftRightArrow", - "Block arrow with arrowheads that point both left and right", - ), - XmlMappedEnumMember( - "LEFT_RIGHT_ARROW_CALLOUT", - 57, - "leftRightArrowCallout", - "Callout with arrowheads that point both left and right", - ), - XmlMappedEnumMember( - "LEFT_RIGHT_CIRCULAR_ARROW", - 177, - "leftRightCircularArrow", - "Left Right Circular Arrow", - ), - XmlMappedEnumMember( - "LEFT_RIGHT_RIBBON", 140, "leftRightRibbon", "Left Right Ribbon" - ), - XmlMappedEnumMember( - "LEFT_RIGHT_UP_ARROW", - 40, - "leftRightUpArrow", - "Block arrow with arrowheads that point left, right, and up", - ), - XmlMappedEnumMember( - "LEFT_UP_ARROW", - 43, - "leftUpArrow", - "Block arrow with arrowheads that point left and up", - ), - XmlMappedEnumMember("LIGHTNING_BOLT", 22, "lightningBolt", "Lightning bolt"), - XmlMappedEnumMember( - "LINE_CALLOUT_1", - 109, - "borderCallout1", - "Callout with border and horizontal callout line", - ), - XmlMappedEnumMember( - "LINE_CALLOUT_1_ACCENT_BAR", - 113, - "accentCallout1", - "Callout with vertical accent bar", - ), - XmlMappedEnumMember( - "LINE_CALLOUT_1_BORDER_AND_ACCENT_BAR", - 121, - "accentBorderCallout1", - "Callout with border and vertical accent bar", - ), - XmlMappedEnumMember( - "LINE_CALLOUT_1_NO_BORDER", 117, "callout1", "Callout with horizontal line" - ), - XmlMappedEnumMember( - "LINE_CALLOUT_2", - 110, - "borderCallout2", - "Callout with diagonal straight line", - ), - XmlMappedEnumMember( - "LINE_CALLOUT_2_ACCENT_BAR", - 114, - "accentCallout2", - "Callout with diagonal callout line and accent bar", - ), - XmlMappedEnumMember( - "LINE_CALLOUT_2_BORDER_AND_ACCENT_BAR", - 122, - "accentBorderCallout2", - "Callout with border, diagonal straight line, and accent bar", - ), - XmlMappedEnumMember( - "LINE_CALLOUT_2_NO_BORDER", - 118, - "callout2", - "Callout with no border and diagonal callout line", - ), - XmlMappedEnumMember( - "LINE_CALLOUT_3", 111, "borderCallout3", "Callout with angled line" - ), - XmlMappedEnumMember( - "LINE_CALLOUT_3_ACCENT_BAR", - 115, - "accentCallout3", - "Callout with angled callout line and accent bar", - ), - XmlMappedEnumMember( - "LINE_CALLOUT_3_BORDER_AND_ACCENT_BAR", - 123, - "accentBorderCallout3", - "Callout with border, angled callout line, and accent bar", - ), - XmlMappedEnumMember( - "LINE_CALLOUT_3_NO_BORDER", - 119, - "callout3", - "Callout with no border and angled callout line", - ), - XmlMappedEnumMember( - "LINE_CALLOUT_4", - 112, - "borderCallout3", - "Callout with callout line segments forming a U-shape.", - ), - XmlMappedEnumMember( - "LINE_CALLOUT_4_ACCENT_BAR", - 116, - "accentCallout3", - "Callout with accent bar and callout line segments forming a U-s" "hape.", - ), - XmlMappedEnumMember( - "LINE_CALLOUT_4_BORDER_AND_ACCENT_BAR", - 124, - "accentBorderCallout3", - "Callout with border, accent bar, and callout line segments form" - "ing a U-shape.", - ), - XmlMappedEnumMember( - "LINE_CALLOUT_4_NO_BORDER", - 120, - "callout3", - "Callout with no border and callout line segments forming a U-sh" "ape.", - ), - XmlMappedEnumMember("LINE_INVERSE", 183, "lineInv", "Straight Connector"), - XmlMappedEnumMember("MATH_DIVIDE", 166, "mathDivide", "Division"), - XmlMappedEnumMember("MATH_EQUAL", 167, "mathEqual", "Equal"), - XmlMappedEnumMember("MATH_MINUS", 164, "mathMinus", "Minus"), - XmlMappedEnumMember("MATH_MULTIPLY", 165, "mathMultiply", "Multiply"), - XmlMappedEnumMember("MATH_NOT_EQUAL", 168, "mathNotEqual", "Not Equal"), - XmlMappedEnumMember("MATH_PLUS", 163, "mathPlus", "Plus"), - XmlMappedEnumMember("MOON", 24, "moon", "Moon"), - XmlMappedEnumMember( - "NON_ISOSCELES_TRAPEZOID", - 143, - "nonIsoscelesTrapezoid", - "Non-isosceles Trapezoid", - ), - XmlMappedEnumMember( - "NOTCHED_RIGHT_ARROW", - 50, - "notchedRightArrow", - "Notched block arrow that points right", - ), - XmlMappedEnumMember("NO_SYMBOL", 19, "noSmoking", '"No" Symbol'), - XmlMappedEnumMember("OCTAGON", 6, "octagon", "Octagon"), - XmlMappedEnumMember("OVAL", 9, "ellipse", "Oval"), - XmlMappedEnumMember( - "OVAL_CALLOUT", 107, "wedgeEllipseCallout", "Oval-shaped callout" - ), - XmlMappedEnumMember("PARALLELOGRAM", 2, "parallelogram", "Parallelogram"), - XmlMappedEnumMember("PENTAGON", 51, "homePlate", "Pentagon"), - XmlMappedEnumMember("PIE", 142, "pie", "Pie"), - XmlMappedEnumMember("PIE_WEDGE", 175, "pieWedge", "Pie"), - XmlMappedEnumMember("PLAQUE", 28, "plaque", "Plaque"), - XmlMappedEnumMember("PLAQUE_TABS", 171, "plaqueTabs", "Plaque Tabs"), - XmlMappedEnumMember( - "QUAD_ARROW", - 39, - "quadArrow", - "Block arrows that point up, down, left, and right", - ), - XmlMappedEnumMember( - "QUAD_ARROW_CALLOUT", - 59, - "quadArrowCallout", - "Callout with arrows that point up, down, left, and right", - ), - XmlMappedEnumMember("RECTANGLE", 1, "rect", "Rectangle"), - XmlMappedEnumMember( - "RECTANGULAR_CALLOUT", 105, "wedgeRectCallout", "Rectangular callout" - ), - XmlMappedEnumMember("REGULAR_PENTAGON", 12, "pentagon", "Pentagon"), - XmlMappedEnumMember( - "RIGHT_ARROW", 33, "rightArrow", "Block arrow that points right" - ), - XmlMappedEnumMember( - "RIGHT_ARROW_CALLOUT", - 53, - "rightArrowCallout", - "Callout with arrow that points right", - ), - XmlMappedEnumMember("RIGHT_BRACE", 32, "rightBrace", "Right brace"), - XmlMappedEnumMember("RIGHT_BRACKET", 30, "rightBracket", "Right bracket"), - XmlMappedEnumMember("RIGHT_TRIANGLE", 8, "rtTriangle", "Right triangle"), - XmlMappedEnumMember("ROUNDED_RECTANGLE", 5, "roundRect", "Rounded rectangle"), - XmlMappedEnumMember( - "ROUNDED_RECTANGULAR_CALLOUT", - 106, - "wedgeRoundRectCallout", - "Rounded rectangle-shaped callout", - ), - XmlMappedEnumMember( - "ROUND_1_RECTANGLE", 151, "round1Rect", "Round Single Corner Rectangle" - ), - XmlMappedEnumMember( - "ROUND_2_DIAG_RECTANGLE", - 153, - "round2DiagRect", - "Round Diagonal Corner Rectangle", - ), - XmlMappedEnumMember( - "ROUND_2_SAME_RECTANGLE", - 152, - "round2SameRect", - "Round Same Side Corner Rectangle", - ), - XmlMappedEnumMember("SMILEY_FACE", 17, "smileyFace", "Smiley face"), - XmlMappedEnumMember( - "SNIP_1_RECTANGLE", 155, "snip1Rect", "Snip Single Corner Rectangle" - ), - XmlMappedEnumMember( - "SNIP_2_DIAG_RECTANGLE", - 157, - "snip2DiagRect", - "Snip Diagonal Corner Rectangle", - ), - XmlMappedEnumMember( - "SNIP_2_SAME_RECTANGLE", - 156, - "snip2SameRect", - "Snip Same Side Corner Rectangle", - ), - XmlMappedEnumMember( - "SNIP_ROUND_RECTANGLE", - 154, - "snipRoundRect", - "Snip and Round Single Corner Rectangle", - ), - XmlMappedEnumMember("SQUARE_TABS", 170, "squareTabs", "Square Tabs"), - XmlMappedEnumMember("STAR_10_POINT", 149, "star10", "10-Point Star"), - XmlMappedEnumMember("STAR_12_POINT", 150, "star12", "12-Point Star"), - XmlMappedEnumMember("STAR_16_POINT", 94, "star16", "16-point star"), - XmlMappedEnumMember("STAR_24_POINT", 95, "star24", "24-point star"), - XmlMappedEnumMember("STAR_32_POINT", 96, "star32", "32-point star"), - XmlMappedEnumMember("STAR_4_POINT", 91, "star4", "4-point star"), - XmlMappedEnumMember("STAR_5_POINT", 92, "star5", "5-point star"), - XmlMappedEnumMember("STAR_6_POINT", 147, "star6", "6-Point Star"), - XmlMappedEnumMember("STAR_7_POINT", 148, "star7", "7-Point Star"), - XmlMappedEnumMember("STAR_8_POINT", 93, "star8", "8-point star"), - XmlMappedEnumMember( - "STRIPED_RIGHT_ARROW", - 49, - "stripedRightArrow", - "Block arrow that points right with stripes at the tail", - ), - XmlMappedEnumMember("SUN", 23, "sun", "Sun"), - XmlMappedEnumMember("SWOOSH_ARROW", 178, "swooshArrow", "Swoosh Arrow"), - XmlMappedEnumMember("TEAR", 160, "teardrop", "Teardrop"), - XmlMappedEnumMember("TRAPEZOID", 3, "trapezoid", "Trapezoid"), - XmlMappedEnumMember("UP_ARROW", 35, "upArrow", "Block arrow that points up"), - XmlMappedEnumMember( - "UP_ARROW_CALLOUT", - 55, - "upArrowCallout", - "Callout with arrow that points up", - ), - XmlMappedEnumMember( - "UP_DOWN_ARROW", 38, "upDownArrow", "Block arrow that points up and down" - ), - XmlMappedEnumMember( - "UP_DOWN_ARROW_CALLOUT", - 58, - "upDownArrowCallout", - "Callout with arrows that point up and down", - ), - XmlMappedEnumMember( - "UP_RIBBON", - 97, - "ribbon2", - "Ribbon banner with center area above ribbon ends", - ), - XmlMappedEnumMember( - "U_TURN_ARROW", 42, "uturnArrow", "Block arrow forming a U shape" - ), - XmlMappedEnumMember( - "VERTICAL_SCROLL", 101, "verticalScroll", "Vertical scroll" - ), - XmlMappedEnumMember("WAVE", 103, "wave", "Wave"), - ) - - -@alias("MSO_CONNECTOR") -class MSO_CONNECTOR_TYPE(XmlEnumeration): + ACTION_BUTTON_BACK_OR_PREVIOUS = ( + 129, + "actionButtonBackPrevious", + "Back or Previous button. Supports mouse-click and mouse-over actions", + ) + """Back or Previous button. Supports mouse-click and mouse-over actions""" + + ACTION_BUTTON_BEGINNING = ( + 131, + "actionButtonBeginning", + "Beginning button. Supports mouse-click and mouse-over actions", + ) + """Beginning button. Supports mouse-click and mouse-over actions""" + + ACTION_BUTTON_CUSTOM = ( + 125, + "actionButtonBlank", + "Button with no default picture or text. Supports mouse-click and mouse-over actions", + ) + """Button with no default picture or text. Supports mouse-click and mouse-over actions""" + + ACTION_BUTTON_DOCUMENT = ( + 134, + "actionButtonDocument", + "Document button. Supports mouse-click and mouse-over actions", + ) + """Document button. Supports mouse-click and mouse-over actions""" + + ACTION_BUTTON_END = ( + 132, + "actionButtonEnd", + "End button. Supports mouse-click and mouse-over actions", + ) + """End button. Supports mouse-click and mouse-over actions""" + + ACTION_BUTTON_FORWARD_OR_NEXT = ( + 130, + "actionButtonForwardNext", + "Forward or Next button. Supports mouse-click and mouse-over actions", + ) + """Forward or Next button. Supports mouse-click and mouse-over actions""" + + ACTION_BUTTON_HELP = ( + 127, + "actionButtonHelp", + "Help button. Supports mouse-click and mouse-over actions", + ) + """Help button. Supports mouse-click and mouse-over actions""" + + ACTION_BUTTON_HOME = ( + 126, + "actionButtonHome", + "Home button. Supports mouse-click and mouse-over actions", + ) + """Home button. Supports mouse-click and mouse-over actions""" + + ACTION_BUTTON_INFORMATION = ( + 128, + "actionButtonInformation", + "Information button. Supports mouse-click and mouse-over actions", + ) + """Information button. Supports mouse-click and mouse-over actions""" + + ACTION_BUTTON_MOVIE = ( + 136, + "actionButtonMovie", + "Movie button. Supports mouse-click and mouse-over actions", + ) + """Movie button. Supports mouse-click and mouse-over actions""" + + ACTION_BUTTON_RETURN = ( + 133, + "actionButtonReturn", + "Return button. Supports mouse-click and mouse-over actions", + ) + """Return button. Supports mouse-click and mouse-over actions""" + + ACTION_BUTTON_SOUND = ( + 135, + "actionButtonSound", + "Sound button. Supports mouse-click and mouse-over actions", + ) + """Sound button. Supports mouse-click and mouse-over actions""" + + ARC = (25, "arc", "Arc") + """Arc""" + + BALLOON = (137, "wedgeRoundRectCallout", "Rounded Rectangular Callout") + """Rounded Rectangular Callout""" + + BENT_ARROW = (41, "bentArrow", "Block arrow that follows a curved 90-degree angle") + """Block arrow that follows a curved 90-degree angle""" + + BENT_UP_ARROW = ( + 44, + "bentUpArrow", + "Block arrow that follows a sharp 90-degree angle. Points up by default", + ) + """Block arrow that follows a sharp 90-degree angle. Points up by default""" + + BEVEL = (15, "bevel", "Bevel") + """Bevel""" + + BLOCK_ARC = (20, "blockArc", "Block arc") + """Block arc""" + + CAN = (13, "can", "Can") + """Can""" + + CHART_PLUS = (182, "chartPlus", "Chart Plus") + """Chart Plus""" + + CHART_STAR = (181, "chartStar", "Chart Star") + """Chart Star""" + + CHART_X = (180, "chartX", "Chart X") + """Chart X""" + + CHEVRON = (52, "chevron", "Chevron") + """Chevron""" + + CHORD = (161, "chord", "Geometric chord shape") + """Geometric chord shape""" + + CIRCULAR_ARROW = (60, "circularArrow", "Block arrow that follows a curved 180-degree angle") + """Block arrow that follows a curved 180-degree angle""" + + CLOUD = (179, "cloud", "Cloud") + """Cloud""" + + CLOUD_CALLOUT = (108, "cloudCallout", "Cloud callout") + """Cloud callout""" + + CORNER = (162, "corner", "Corner") + """Corner""" + + CORNER_TABS = (169, "cornerTabs", "Corner Tabs") + """Corner Tabs""" + + CROSS = (11, "plus", "Cross") + """Cross""" + + CUBE = (14, "cube", "Cube") + """Cube""" + + CURVED_DOWN_ARROW = (48, "curvedDownArrow", "Block arrow that curves down") + """Block arrow that curves down""" + + CURVED_DOWN_RIBBON = (100, "ellipseRibbon", "Ribbon banner that curves down") + """Ribbon banner that curves down""" + + CURVED_LEFT_ARROW = (46, "curvedLeftArrow", "Block arrow that curves left") + """Block arrow that curves left""" + + CURVED_RIGHT_ARROW = (45, "curvedRightArrow", "Block arrow that curves right") + """Block arrow that curves right""" + + CURVED_UP_ARROW = (47, "curvedUpArrow", "Block arrow that curves up") + """Block arrow that curves up""" + + CURVED_UP_RIBBON = (99, "ellipseRibbon2", "Ribbon banner that curves up") + """Ribbon banner that curves up""" + + DECAGON = (144, "decagon", "Decagon") + """Decagon""" + + DIAGONAL_STRIPE = (141, "diagStripe", "Diagonal Stripe") + """Diagonal Stripe""" + + DIAMOND = (4, "diamond", "Diamond") + """Diamond""" + + DODECAGON = (146, "dodecagon", "Dodecagon") + """Dodecagon""" + + DONUT = (18, "donut", "Donut") + """Donut""" + + DOUBLE_BRACE = (27, "bracePair", "Double brace") + """Double brace""" + + DOUBLE_BRACKET = (26, "bracketPair", "Double bracket") + """Double bracket""" + + DOUBLE_WAVE = (104, "doubleWave", "Double wave") + """Double wave""" + + DOWN_ARROW = (36, "downArrow", "Block arrow that points down") + """Block arrow that points down""" + + DOWN_ARROW_CALLOUT = (56, "downArrowCallout", "Callout with arrow that points down") + """Callout with arrow that points down""" + + DOWN_RIBBON = (98, "ribbon", "Ribbon banner with center area below ribbon ends") + """Ribbon banner with center area below ribbon ends""" + + EXPLOSION1 = (89, "irregularSeal1", "Explosion") + """Explosion""" + + EXPLOSION2 = (90, "irregularSeal2", "Explosion") + """Explosion""" + + FLOWCHART_ALTERNATE_PROCESS = ( + 62, + "flowChartAlternateProcess", + "Alternate process flowchart symbol", + ) + """Alternate process flowchart symbol""" + + FLOWCHART_CARD = (75, "flowChartPunchedCard", "Card flowchart symbol") + """Card flowchart symbol""" + + FLOWCHART_COLLATE = (79, "flowChartCollate", "Collate flowchart symbol") + """Collate flowchart symbol""" + + FLOWCHART_CONNECTOR = (73, "flowChartConnector", "Connector flowchart symbol") + """Connector flowchart symbol""" + + FLOWCHART_DATA = (64, "flowChartInputOutput", "Data flowchart symbol") + """Data flowchart symbol""" + + FLOWCHART_DECISION = (63, "flowChartDecision", "Decision flowchart symbol") + """Decision flowchart symbol""" + + FLOWCHART_DELAY = (84, "flowChartDelay", "Delay flowchart symbol") + """Delay flowchart symbol""" + + FLOWCHART_DIRECT_ACCESS_STORAGE = ( + 87, + "flowChartMagneticDrum", + "Direct access storage flowchart symbol", + ) + """Direct access storage flowchart symbol""" + + FLOWCHART_DISPLAY = (88, "flowChartDisplay", "Display flowchart symbol") + """Display flowchart symbol""" + + FLOWCHART_DOCUMENT = (67, "flowChartDocument", "Document flowchart symbol") + """Document flowchart symbol""" + + FLOWCHART_EXTRACT = (81, "flowChartExtract", "Extract flowchart symbol") + """Extract flowchart symbol""" + + FLOWCHART_INTERNAL_STORAGE = ( + 66, + "flowChartInternalStorage", + "Internal storage flowchart symbol", + ) + """Internal storage flowchart symbol""" + + FLOWCHART_MAGNETIC_DISK = (86, "flowChartMagneticDisk", "Magnetic disk flowchart symbol") + """Magnetic disk flowchart symbol""" + + FLOWCHART_MANUAL_INPUT = (71, "flowChartManualInput", "Manual input flowchart symbol") + """Manual input flowchart symbol""" + + FLOWCHART_MANUAL_OPERATION = ( + 72, + "flowChartManualOperation", + "Manual operation flowchart symbol", + ) + """Manual operation flowchart symbol""" + + FLOWCHART_MERGE = (82, "flowChartMerge", "Merge flowchart symbol") + """Merge flowchart symbol""" + + FLOWCHART_MULTIDOCUMENT = (68, "flowChartMultidocument", "Multi-document flowchart symbol") + """Multi-document flowchart symbol""" + + FLOWCHART_OFFLINE_STORAGE = (139, "flowChartOfflineStorage", "Offline Storage") + """Offline Storage""" + + FLOWCHART_OFFPAGE_CONNECTOR = ( + 74, + "flowChartOffpageConnector", + "Off-page connector flowchart symbol", + ) + """Off-page connector flowchart symbol""" + + FLOWCHART_OR = (78, "flowChartOr", '"Or" flowchart symbol') + """\"Or\" flowchart symbol""" + + FLOWCHART_PREDEFINED_PROCESS = ( + 65, + "flowChartPredefinedProcess", + "Predefined process flowchart symbol", + ) + """Predefined process flowchart symbol""" + + FLOWCHART_PREPARATION = (70, "flowChartPreparation", "Preparation flowchart symbol") + """Preparation flowchart symbol""" + + FLOWCHART_PROCESS = (61, "flowChartProcess", "Process flowchart symbol") + """Process flowchart symbol""" + + FLOWCHART_PUNCHED_TAPE = (76, "flowChartPunchedTape", "Punched tape flowchart symbol") + """Punched tape flowchart symbol""" + + FLOWCHART_SEQUENTIAL_ACCESS_STORAGE = ( + 85, + "flowChartMagneticTape", + "Sequential access storage flowchart symbol", + ) + """Sequential access storage flowchart symbol""" + + FLOWCHART_SORT = (80, "flowChartSort", "Sort flowchart symbol") + """Sort flowchart symbol""" + + FLOWCHART_STORED_DATA = (83, "flowChartOnlineStorage", "Stored data flowchart symbol") + """Stored data flowchart symbol""" + + FLOWCHART_SUMMING_JUNCTION = ( + 77, + "flowChartSummingJunction", + "Summing junction flowchart symbol", + ) + """Summing junction flowchart symbol""" + + FLOWCHART_TERMINATOR = (69, "flowChartTerminator", "Terminator flowchart symbol") + """Terminator flowchart symbol""" + + FOLDED_CORNER = (16, "foldedCorner", "Folded corner") + """Folded corner""" + + FRAME = (158, "frame", "Frame") + """Frame""" + + FUNNEL = (174, "funnel", "Funnel") + """Funnel""" + + GEAR_6 = (172, "gear6", "Gear 6") + """Gear 6""" + + GEAR_9 = (173, "gear9", "Gear 9") + """Gear 9""" + + HALF_FRAME = (159, "halfFrame", "Half Frame") + """Half Frame""" + + HEART = (21, "heart", "Heart") + """Heart""" + + HEPTAGON = (145, "heptagon", "Heptagon") + """Heptagon""" + + HEXAGON = (10, "hexagon", "Hexagon") + """Hexagon""" + + HORIZONTAL_SCROLL = (102, "horizontalScroll", "Horizontal scroll") + """Horizontal scroll""" + + ISOSCELES_TRIANGLE = (7, "triangle", "Isosceles triangle") + """Isosceles triangle""" + + LEFT_ARROW = (34, "leftArrow", "Block arrow that points left") + """Block arrow that points left""" + + LEFT_ARROW_CALLOUT = (54, "leftArrowCallout", "Callout with arrow that points left") + """Callout with arrow that points left""" + + LEFT_BRACE = (31, "leftBrace", "Left brace") + """Left brace""" + + LEFT_BRACKET = (29, "leftBracket", "Left bracket") + """Left bracket""" + + LEFT_CIRCULAR_ARROW = (176, "leftCircularArrow", "Left Circular Arrow") + """Left Circular Arrow""" + + LEFT_RIGHT_ARROW = ( + 37, + "leftRightArrow", + "Block arrow with arrowheads that point both left and right", + ) + """Block arrow with arrowheads that point both left and right""" + + LEFT_RIGHT_ARROW_CALLOUT = ( + 57, + "leftRightArrowCallout", + "Callout with arrowheads that point both left and right", + ) + """Callout with arrowheads that point both left and right""" + + LEFT_RIGHT_CIRCULAR_ARROW = (177, "leftRightCircularArrow", "Left Right Circular Arrow") + """Left Right Circular Arrow""" + + LEFT_RIGHT_RIBBON = (140, "leftRightRibbon", "Left Right Ribbon") + """Left Right Ribbon""" + + LEFT_RIGHT_UP_ARROW = ( + 40, + "leftRightUpArrow", + "Block arrow with arrowheads that point left, right, and up", + ) + """Block arrow with arrowheads that point left, right, and up""" + + LEFT_UP_ARROW = (43, "leftUpArrow", "Block arrow with arrowheads that point left and up") + """Block arrow with arrowheads that point left and up""" + + LIGHTNING_BOLT = (22, "lightningBolt", "Lightning bolt") + """Lightning bolt""" + + LINE_CALLOUT_1 = (109, "borderCallout1", "Callout with border and horizontal callout line") + """Callout with border and horizontal callout line""" + + LINE_CALLOUT_1_ACCENT_BAR = (113, "accentCallout1", "Callout with vertical accent bar") + """Callout with vertical accent bar""" + + LINE_CALLOUT_1_BORDER_AND_ACCENT_BAR = ( + 121, + "accentBorderCallout1", + "Callout with border and vertical accent bar", + ) + """Callout with border and vertical accent bar""" + + LINE_CALLOUT_1_NO_BORDER = (117, "callout1", "Callout with horizontal line") + """Callout with horizontal line""" + + LINE_CALLOUT_2 = (110, "borderCallout2", "Callout with diagonal straight line") + """Callout with diagonal straight line""" + + LINE_CALLOUT_2_ACCENT_BAR = ( + 114, + "accentCallout2", + "Callout with diagonal callout line and accent bar", + ) + """Callout with diagonal callout line and accent bar""" + + LINE_CALLOUT_2_BORDER_AND_ACCENT_BAR = ( + 122, + "accentBorderCallout2", + "Callout with border, diagonal straight line, and accent bar", + ) + """Callout with border, diagonal straight line, and accent bar""" + + LINE_CALLOUT_2_NO_BORDER = (118, "callout2", "Callout with no border and diagonal callout line") + """Callout with no border and diagonal callout line""" + + LINE_CALLOUT_3 = (111, "borderCallout3", "Callout with angled line") + """Callout with angled line""" + + LINE_CALLOUT_3_ACCENT_BAR = ( + 115, + "accentCallout3", + "Callout with angled callout line and accent bar", + ) + """Callout with angled callout line and accent bar""" + + LINE_CALLOUT_3_BORDER_AND_ACCENT_BAR = ( + 123, + "accentBorderCallout3", + "Callout with border, angled callout line, and accent bar", + ) + """Callout with border, angled callout line, and accent bar""" + + LINE_CALLOUT_3_NO_BORDER = (119, "callout3", "Callout with no border and angled callout line") + """Callout with no border and angled callout line""" + + LINE_CALLOUT_4 = ( + 112, + "borderCallout3", + "Callout with callout line segments forming a U-shape.", + ) + """Callout with callout line segments forming a U-shape.""" + + LINE_CALLOUT_4_ACCENT_BAR = ( + 116, + "accentCallout3", + "Callout with accent bar and callout line segments forming a U-shape.", + ) + """Callout with accent bar and callout line segments forming a U-shape.""" + + LINE_CALLOUT_4_BORDER_AND_ACCENT_BAR = ( + 124, + "accentBorderCallout3", + "Callout with border, accent bar, and callout line segments forming a U-shape.", + ) + """Callout with border, accent bar, and callout line segments forming a U-shape.""" + + LINE_CALLOUT_4_NO_BORDER = ( + 120, + "callout3", + "Callout with no border and callout line segments forming a U-shape.", + ) + """Callout with no border and callout line segments forming a U-shape.""" + + LINE_INVERSE = (183, "lineInv", "Straight Connector") + """Straight Connector""" + + MATH_DIVIDE = (166, "mathDivide", "Division") + """Division""" + + MATH_EQUAL = (167, "mathEqual", "Equal") + """Equal""" + + MATH_MINUS = (164, "mathMinus", "Minus") + """Minus""" + + MATH_MULTIPLY = (165, "mathMultiply", "Multiply") + """Multiply""" + + MATH_NOT_EQUAL = (168, "mathNotEqual", "Not Equal") + """Not Equal""" + + MATH_PLUS = (163, "mathPlus", "Plus") + """Plus""" + + MOON = (24, "moon", "Moon") + """Moon""" + + NON_ISOSCELES_TRAPEZOID = (143, "nonIsoscelesTrapezoid", "Non-isosceles Trapezoid") + """Non-isosceles Trapezoid""" + + NOTCHED_RIGHT_ARROW = (50, "notchedRightArrow", "Notched block arrow that points right") + """Notched block arrow that points right""" + + NO_SYMBOL = (19, "noSmoking", "'No' Symbol") + """'No' Symbol""" + + OCTAGON = (6, "octagon", "Octagon") + """Octagon""" + + OVAL = (9, "ellipse", "Oval") + """Oval""" + + OVAL_CALLOUT = (107, "wedgeEllipseCallout", "Oval-shaped callout") + """Oval-shaped callout""" + + PARALLELOGRAM = (2, "parallelogram", "Parallelogram") + """Parallelogram""" + + PENTAGON = (51, "homePlate", "Pentagon") + """Pentagon""" + + PIE = (142, "pie", "Pie") + """Pie""" + + PIE_WEDGE = (175, "pieWedge", "Pie") + """Pie""" + + PLAQUE = (28, "plaque", "Plaque") + """Plaque""" + + PLAQUE_TABS = (171, "plaqueTabs", "Plaque Tabs") + """Plaque Tabs""" + + QUAD_ARROW = (39, "quadArrow", "Block arrows that point up, down, left, and right") + """Block arrows that point up, down, left, and right""" + + QUAD_ARROW_CALLOUT = ( + 59, + "quadArrowCallout", + "Callout with arrows that point up, down, left, and right", + ) + """Callout with arrows that point up, down, left, and right""" + + RECTANGLE = (1, "rect", "Rectangle") + """Rectangle""" + + RECTANGULAR_CALLOUT = (105, "wedgeRectCallout", "Rectangular callout") + """Rectangular callout""" + + REGULAR_PENTAGON = (12, "pentagon", "Pentagon") + """Pentagon""" + + RIGHT_ARROW = (33, "rightArrow", "Block arrow that points right") + """Block arrow that points right""" + + RIGHT_ARROW_CALLOUT = (53, "rightArrowCallout", "Callout with arrow that points right") + """Callout with arrow that points right""" + + RIGHT_BRACE = (32, "rightBrace", "Right brace") + """Right brace""" + + RIGHT_BRACKET = (30, "rightBracket", "Right bracket") + """Right bracket""" + + RIGHT_TRIANGLE = (8, "rtTriangle", "Right triangle") + """Right triangle""" + + ROUNDED_RECTANGLE = (5, "roundRect", "Rounded rectangle") + """Rounded rectangle""" + + ROUNDED_RECTANGULAR_CALLOUT = (106, "wedgeRoundRectCallout", "Rounded rectangle-shaped callout") + """Rounded rectangle-shaped callout""" + + ROUND_1_RECTANGLE = (151, "round1Rect", "Round Single Corner Rectangle") + """Round Single Corner Rectangle""" + + ROUND_2_DIAG_RECTANGLE = (153, "round2DiagRect", "Round Diagonal Corner Rectangle") + """Round Diagonal Corner Rectangle""" + + ROUND_2_SAME_RECTANGLE = (152, "round2SameRect", "Round Same Side Corner Rectangle") + """Round Same Side Corner Rectangle""" + + SMILEY_FACE = (17, "smileyFace", "Smiley face") + """Smiley face""" + + SNIP_1_RECTANGLE = (155, "snip1Rect", "Snip Single Corner Rectangle") + """Snip Single Corner Rectangle""" + + SNIP_2_DIAG_RECTANGLE = (157, "snip2DiagRect", "Snip Diagonal Corner Rectangle") + """Snip Diagonal Corner Rectangle""" + + SNIP_2_SAME_RECTANGLE = (156, "snip2SameRect", "Snip Same Side Corner Rectangle") + """Snip Same Side Corner Rectangle""" + + SNIP_ROUND_RECTANGLE = (154, "snipRoundRect", "Snip and Round Single Corner Rectangle") + """Snip and Round Single Corner Rectangle""" + + SQUARE_TABS = (170, "squareTabs", "Square Tabs") + """Square Tabs""" + + STAR_10_POINT = (149, "star10", "10-Point Star") + """10-Point Star""" + + STAR_12_POINT = (150, "star12", "12-Point Star") + """12-Point Star""" + + STAR_16_POINT = (94, "star16", "16-point star") + """16-point star""" + + STAR_24_POINT = (95, "star24", "24-point star") + """24-point star""" + + STAR_32_POINT = (96, "star32", "32-point star") + """32-point star""" + + STAR_4_POINT = (91, "star4", "4-point star") + """4-point star""" + + STAR_5_POINT = (92, "star5", "5-point star") + """5-point star""" + + STAR_6_POINT = (147, "star6", "6-Point Star") + """6-Point Star""" + + STAR_7_POINT = (148, "star7", "7-Point Star") + """7-Point Star""" + + STAR_8_POINT = (93, "star8", "8-point star") + """8-point star""" + + STRIPED_RIGHT_ARROW = ( + 49, + "stripedRightArrow", + "Block arrow that points right with stripes at the tail", + ) + """Block arrow that points right with stripes at the tail""" + + SUN = (23, "sun", "Sun") + """Sun""" + + SWOOSH_ARROW = (178, "swooshArrow", "Swoosh Arrow") + """Swoosh Arrow""" + + TEAR = (160, "teardrop", "Teardrop") + """Teardrop""" + + TRAPEZOID = (3, "trapezoid", "Trapezoid") + """Trapezoid""" + + UP_ARROW = (35, "upArrow", "Block arrow that points up") + """Block arrow that points up""" + + UP_ARROW_CALLOUT = (55, "upArrowCallout", "Callout with arrow that points up") + """Callout with arrow that points up""" + + UP_DOWN_ARROW = (38, "upDownArrow", "Block arrow that points up and down") + """Block arrow that points up and down""" + + UP_DOWN_ARROW_CALLOUT = (58, "upDownArrowCallout", "Callout with arrows that point up and down") + """Callout with arrows that point up and down""" + + UP_RIBBON = (97, "ribbon2", "Ribbon banner with center area above ribbon ends") + """Ribbon banner with center area above ribbon ends""" + + U_TURN_ARROW = (42, "uturnArrow", "Block arrow forming a U shape") + """Block arrow forming a U shape""" + + VERTICAL_SCROLL = (101, "verticalScroll", "Vertical scroll") + """Vertical scroll""" + + WAVE = (103, "wave", "Wave") + """Wave""" + + +MSO_SHAPE = MSO_AUTO_SHAPE_TYPE + + +class MSO_CONNECTOR_TYPE(BaseXmlEnum): """ Specifies a type of connector. @@ -656,28 +733,27 @@ class MSO_CONNECTOR_TYPE(XmlEnumeration): MSO_CONNECTOR.STRAIGHT, Cm(2), Cm(2), Cm(10), Cm(10) ) assert connector.left.cm == 2 + + MS API Name: `MsoConnectorType` + + http://msdn.microsoft.com/en-us/library/office/ff860918.aspx """ - __ms_name__ = "MsoConnectorType" + CURVE = (3, "curvedConnector3", "Curved connector.") + """Curved connector.""" - __url__ = "http://msdn.microsoft.com/en-us/library/office/ff860918.aspx" + ELBOW = (2, "bentConnector3", "Elbow connector.") + """Elbow connector.""" - __members__ = ( - XmlMappedEnumMember("CURVE", 3, "curvedConnector3", "Curved connector."), - XmlMappedEnumMember("ELBOW", 2, "bentConnector3", "Elbow connector."), - XmlMappedEnumMember("STRAIGHT", 1, "line", "Straight line connector."), - ReturnValueOnlyEnumMember( - "MIXED", - -2, - "Return value only; indicates a combination of othe" "r states.", - ), - ) + STRAIGHT = (1, "line", "Straight line connector.") + """Straight line connector.""" -@alias("MSO") -class MSO_SHAPE_TYPE(Enumeration): - """ - Specifies the type of a shape +MSO_CONNECTOR = MSO_CONNECTOR_TYPE + + +class MSO_SHAPE_TYPE(BaseEnum): + """Specifies the type of a shape, more specifically than the five base types. Alias: ``MSO`` @@ -686,47 +762,93 @@ class MSO_SHAPE_TYPE(Enumeration): from pptx.enum.shapes import MSO_SHAPE_TYPE assert shape.type == MSO_SHAPE_TYPE.PICTURE - """ - __ms_name__ = "MsoShapeType" - - __url__ = ( - "http://msdn.microsoft.com/en-us/library/office/ff860759(v=office.15" ").aspx" - ) - - __members__ = ( - EnumMember("AUTO_SHAPE", 1, "AutoShape"), - EnumMember("CALLOUT", 2, "Callout shape"), - EnumMember("CANVAS", 20, "Drawing canvas"), - EnumMember("CHART", 3, "Chart, e.g. pie chart, bar chart"), - EnumMember("COMMENT", 4, "Comment"), - EnumMember("DIAGRAM", 21, "Diagram"), - EnumMember("EMBEDDED_OLE_OBJECT", 7, "Embedded OLE object"), - EnumMember("FORM_CONTROL", 8, "Form control"), - EnumMember("FREEFORM", 5, "Freeform"), - EnumMember("GROUP", 6, "Group shape"), - EnumMember("IGX_GRAPHIC", 24, "SmartArt graphic"), - EnumMember("INK", 22, "Ink"), - EnumMember("INK_COMMENT", 23, "Ink Comment"), - EnumMember("LINE", 9, "Line"), - EnumMember("LINKED_OLE_OBJECT", 10, "Linked OLE object"), - EnumMember("LINKED_PICTURE", 11, "Linked picture"), - EnumMember("MEDIA", 16, "Media"), - EnumMember("OLE_CONTROL_OBJECT", 12, "OLE control object"), - EnumMember("PICTURE", 13, "Picture"), - EnumMember("PLACEHOLDER", 14, "Placeholder"), - EnumMember("SCRIPT_ANCHOR", 18, "Script anchor"), - EnumMember("TABLE", 19, "Table"), - EnumMember("TEXT_BOX", 17, "Text box"), - EnumMember("TEXT_EFFECT", 15, "Text effect"), - EnumMember("WEB_VIDEO", 26, "Web video"), - ReturnValueOnlyEnumMember("MIXED", -2, "Mixed shape types"), - ) - - -class PP_MEDIA_TYPE(Enumeration): + MS API Name: `MsoShapeType` + + http://msdn.microsoft.com/en-us/library/office/ff860759(v=office.15).aspx """ - Indicates the OLE media type. + + AUTO_SHAPE = (1, "AutoShape") + """AutoShape""" + + CALLOUT = (2, "Callout shape") + """Callout shape""" + + CANVAS = (20, "Drawing canvas") + """Drawing canvas""" + + CHART = (3, "Chart, e.g. pie chart, bar chart") + """Chart, e.g. pie chart, bar chart""" + + COMMENT = (4, "Comment") + """Comment""" + + DIAGRAM = (21, "Diagram") + """Diagram""" + + EMBEDDED_OLE_OBJECT = (7, "Embedded OLE object") + """Embedded OLE object""" + + FORM_CONTROL = (8, "Form control") + """Form control""" + + FREEFORM = (5, "Freeform") + """Freeform""" + + GROUP = (6, "Group shape") + """Group shape""" + + IGX_GRAPHIC = (24, "SmartArt graphic") + """SmartArt graphic""" + + INK = (22, "Ink") + """Ink""" + + INK_COMMENT = (23, "Ink Comment") + """Ink Comment""" + + LINE = (9, "Line") + """Line""" + + LINKED_OLE_OBJECT = (10, "Linked OLE object") + """Linked OLE object""" + + LINKED_PICTURE = (11, "Linked picture") + """Linked picture""" + + MEDIA = (16, "Media") + """Media""" + + OLE_CONTROL_OBJECT = (12, "OLE control object") + """OLE control object""" + + PICTURE = (13, "Picture") + """Picture""" + + PLACEHOLDER = (14, "Placeholder") + """Placeholder""" + + SCRIPT_ANCHOR = (18, "Script anchor") + """Script anchor""" + + TABLE = (19, "Table") + """Table""" + + TEXT_BOX = (17, "Text box") + """Text box""" + + TEXT_EFFECT = (15, "Text effect") + """Text effect""" + + WEB_VIDEO = (26, "Web video") + """Web video""" + + +MSO = MSO_SHAPE_TYPE + + +class PP_MEDIA_TYPE(BaseEnum): + """Indicates the OLE media type. Example:: @@ -734,30 +856,24 @@ class PP_MEDIA_TYPE(Enumeration): movie = slide.shapes[0] assert movie.media_type == PP_MEDIA_TYPE.MOVIE + + MS API Name: `PpMediaType` + + https://msdn.microsoft.com/en-us/library/office/ff746008.aspx """ - __ms_name__ = "PpMediaType" + MOVIE = (3, "Video media such as MP4.") + """Video media such as MP4.""" - __url__ = "https://msdn.microsoft.com/en-us/library/office/ff746008.aspx" + OTHER = (1, "Other media types") + """Other media types""" - __members__ = ( - EnumMember("MOVIE", 3, "Video media such as MP4."), - EnumMember("OTHER", 1, "Other media types"), - EnumMember("SOUND", 1, "Audio media such as MP3."), - ReturnValueOnlyEnumMember( - "MIXED", - -2, - "Return value only; indicates multiple media types," - " typically for a collection of shapes. May not be applicable in" - " python-pptx.", - ), - ) + SOUND = (1, "Audio media such as MP3.") + """Audio media such as MP3.""" -@alias("PP_PLACEHOLDER") -class PP_PLACEHOLDER_TYPE(XmlEnumeration): - """ - Specifies one of the 18 distinct types of placeholder. +class PP_PLACEHOLDER_TYPE(BaseXmlEnum): + """Specifies one of the 18 distinct types of placeholder. Alias: ``PP_PLACEHOLDER`` @@ -767,48 +883,77 @@ class PP_PLACEHOLDER_TYPE(XmlEnumeration): placeholder = slide.placeholders[0] assert placeholder.type == PP_PLACEHOLDER.TITLE + + MS API name: `PpPlaceholderType` + + http://msdn.microsoft.com/en-us/library/office/ff860759(v=office.15 ").aspx" """ - __ms_name__ = "PpPlaceholderType" - - __url__ = ( - "http://msdn.microsoft.com/en-us/library/office/ff860759(v=office.15" ").aspx" - ) - - __members__ = ( - XmlMappedEnumMember("BITMAP", 9, "clipArt", "Clip art placeholder"), - XmlMappedEnumMember("BODY", 2, "body", "Body"), - XmlMappedEnumMember("CENTER_TITLE", 3, "ctrTitle", "Center Title"), - XmlMappedEnumMember("CHART", 8, "chart", "Chart"), - XmlMappedEnumMember("DATE", 16, "dt", "Date"), - XmlMappedEnumMember("FOOTER", 15, "ftr", "Footer"), - XmlMappedEnumMember("HEADER", 14, "hdr", "Header"), - XmlMappedEnumMember("MEDIA_CLIP", 10, "media", "Media Clip"), - XmlMappedEnumMember("OBJECT", 7, "obj", "Object"), - XmlMappedEnumMember( - "ORG_CHART", - 11, - "dgm", - "SmartArt placeholder. Organization char" "t is a legacy name.", - ), - XmlMappedEnumMember("PICTURE", 18, "pic", "Picture"), - XmlMappedEnumMember("SLIDE_IMAGE", 101, "sldImg", "Slide Image"), - XmlMappedEnumMember("SLIDE_NUMBER", 13, "sldNum", "Slide Number"), - XmlMappedEnumMember("SUBTITLE", 4, "subTitle", "Subtitle"), - XmlMappedEnumMember("TABLE", 12, "tbl", "Table"), - XmlMappedEnumMember("TITLE", 1, "title", "Title"), - ReturnValueOnlyEnumMember("VERTICAL_BODY", 6, "Vertical Body"), - ReturnValueOnlyEnumMember("VERTICAL_OBJECT", 17, "Vertical Object"), - ReturnValueOnlyEnumMember("VERTICAL_TITLE", 5, "Vertical Title"), - ReturnValueOnlyEnumMember( - "MIXED", - -2, - "Return value only; multiple placeholders of differ" "ing types.", - ), - ) - - -class _ProgIdEnum(object): + BITMAP = (9, "clipArt", "Clip art placeholder") + """Clip art placeholder""" + + BODY = (2, "body", "Body") + """Body""" + + CENTER_TITLE = (3, "ctrTitle", "Center Title") + """Center Title""" + + CHART = (8, "chart", "Chart") + """Chart""" + + DATE = (16, "dt", "Date") + """Date""" + + FOOTER = (15, "ftr", "Footer") + """Footer""" + + HEADER = (14, "hdr", "Header") + """Header""" + + MEDIA_CLIP = (10, "media", "Media Clip") + """Media Clip""" + + OBJECT = (7, "obj", "Object") + """Object""" + + ORG_CHART = (11, "dgm", "SmartArt placeholder. Organization chart is a legacy name.") + """SmartArt placeholder. Organization chart is a legacy name.""" + + PICTURE = (18, "pic", "Picture") + """Picture""" + + SLIDE_IMAGE = (101, "sldImg", "Slide Image") + """Slide Image""" + + SLIDE_NUMBER = (13, "sldNum", "Slide Number") + """Slide Number""" + + SUBTITLE = (4, "subTitle", "Subtitle") + """Subtitle""" + + TABLE = (12, "tbl", "Table") + """Table""" + + TITLE = (1, "title", "Title") + """Title""" + + VERTICAL_BODY = (6, "", "Vertical Body") + """Vertical Body""" + + VERTICAL_OBJECT = (17, "", "Vertical Object") + """Vertical Object""" + + VERTICAL_TITLE = (5, "", "Vertical Title") + """Vertical Title""" + + MIXED = (-2, "", "Return value only; multiple placeholders of differing types.") + """Return value only; multiple placeholders of differing types.""" + + +PP_PLACEHOLDER = PP_PLACEHOLDER_TYPE + + +class PROG_ID(enum.Enum): """One-off Enum-like object for progId values. Indicates the type of an OLE object in terms of the program used to open it. @@ -828,54 +973,41 @@ class _ProgIdEnum(object): assert embedded_xlsx_shape.ole_format.prog_id == "Excel.Sheet.12" """ - class Member(object): - """A particular progID with its attributes.""" - - def __init__(self, name, progId, icon_filename, width, height): - self._name = name - self._progId = progId - self._icon_filename = icon_filename - self._width = width - self._height = height - - def __repr__(self): - return "PROG_ID.%s" % self._name + _progId: str + _icon_filename: str + _width: int + _height: int - @property - def height(self): - return self._height + def __new__(cls, value: str, progId: str, icon_filename: str, width: int, height: int): + self = object.__new__(cls) + self._value_ = value + self._progId = progId + self._icon_filename = icon_filename + self._width = width + self._height = height + return self - @property - def icon_filename(self): - return self._icon_filename + @property + def height(self): + return self._height - @property - def progId(self): - return self._progId + @property + def icon_filename(self): + return self._icon_filename - @property - def width(self): - return self._width + @property + def progId(self): + return self._progId - def __contains__(self, item): - return item in (self.DOCX, self.PPTX, self.XLSX,) - - def __repr__(self): - return "%s.PROG_ID" % __name__ - - @lazyproperty - def DOCX(self): - return self.Member("DOCX", "Word.Document.12", "docx-icon.emf", 965200, 609600) - - @lazyproperty - def PPTX(self): - return self.Member( - "PPTX", "PowerPoint.Show.12", "pptx-icon.emf", 965200, 609600 - ) + @property + def width(self): + return self._width - @lazyproperty - def XLSX(self): - return self.Member("XLSX", "Excel.Sheet.12", "xlsx-icon.emf", 965200, 609600) + DOCX = ("DOCX", "Word.Document.12", "docx-icon.emf", 965200, 609600) + """`progId` for an embedded Word 2007+ (.docx) document.""" + PPTX = ("PPTX", "PowerPoint.Show.12", "pptx-icon.emf", 965200, 609600) + """`progId` for an embedded PowerPoint 2007+ (.pptx) document.""" -PROG_ID = _ProgIdEnum() + XLSX = ("XLSX", "Excel.Sheet.12", "xlsx-icon.emf", 965200, 609600) + """`progId` for an embedded Excel 2007+ (.xlsx) document.""" diff --git a/src/pptx/enum/text.py b/src/pptx/enum/text.py index 54297bbd5..892385153 100644 --- a/src/pptx/enum/text.py +++ b/src/pptx/enum/text.py @@ -1,85 +1,64 @@ -# encoding: utf-8 +"""Enumerations used by text and related objects.""" -""" -Enumerations used by text and related objects -""" +from __future__ import annotations -from __future__ import absolute_import +from pptx.enum.base import BaseEnum, BaseXmlEnum -from .base import ( - alias, - Enumeration, - EnumMember, - ReturnValueOnlyEnumMember, - XmlEnumeration, - XmlMappedEnumMember, -) +class MSO_AUTO_SIZE(BaseEnum): + """Determines the type of automatic sizing allowed. -class MSO_AUTO_SIZE(Enumeration): - """ - 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:: + 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. + 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` - 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. + http://msdn.microsoft.com/en-us/library/office/ff865367(v=office.15).aspx """ - NONE = 0 - SHAPE_TO_FIT_TEXT = 1 - TEXT_TO_FIT_SHAPE = 2 + 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. - __ms_name__ = "MsoAutoSize" + Text can freely extend beyond the horizontal and vertical edges of the shape bounding box. + """ - __url__ = ( - "http://msdn.microsoft.com/en-us/library/office/ff865367(v=office.15" ").aspx" + 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. - __members__ = ( - EnumMember( - "NONE", - 0, - "No automatic sizing of the shape or text will be don" - "e. Text can freely extend beyond the horizontal and vertical ed" - "ges of the shape bounding box.", - ), - EnumMember( - "SHAPE_TO_FIT_TEXT", - 1, - "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 o" - "n, only the height of the shape will be adjusted; soft line bre" - "aks will be used to fit the text horizontally.", - ), - EnumMember( - "TEXT_TO_FIT_SHAPE", - 2, - "The font size is reduced as necessary t" - "o fit the text within the shape.", - ), - ReturnValueOnlyEnumMember( - "MIXED", - -2, - "Return value only; indicates a combination of auto" - "matic sizing schemes are used.", - ), + 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.""" -@alias("MSO_UNDERLINE") -class MSO_TEXT_UNDERLINE_TYPE(XmlEnumeration): +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. @@ -91,165 +70,149 @@ class MSO_TEXT_UNDERLINE_TYPE(XmlEnumeration): 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 """ - __ms_name__ = "MsoTextUnderlineType" - - __url__ = "http://msdn.microsoft.com/en-us/library/aa432699.aspx" - - __members__ = ( - XmlMappedEnumMember("NONE", 0, "none", "Specifies no underline."), - XmlMappedEnumMember( - "DASH_HEAVY_LINE", 8, "dashHeavy", "Specifies a dash underline." - ), - XmlMappedEnumMember("DASH_LINE", 7, "dash", "Specifies a dash line underline."), - XmlMappedEnumMember( - "DASH_LONG_HEAVY_LINE", - 10, - "dashLongHeavy", - "Specifies a long heavy line underline.", - ), - XmlMappedEnumMember( - "DASH_LONG_LINE", 9, "dashLong", "Specifies a dashed long line underline." - ), - XmlMappedEnumMember( - "DOT_DASH_HEAVY_LINE", - 12, - "dotDashHeavy", - "Specifies a dot dash heavy line underline.", - ), - XmlMappedEnumMember( - "DOT_DASH_LINE", 11, "dotDash", "Specifies a dot dash line underline." - ), - XmlMappedEnumMember( - "DOT_DOT_DASH_HEAVY_LINE", - 14, - "dotDotDashHeavy", - "Specifies a dot dot dash heavy line underline.", - ), - XmlMappedEnumMember( - "DOT_DOT_DASH_LINE", - 13, - "dotDotDash", - "Specifies a dot dot dash line underline.", - ), - XmlMappedEnumMember( - "DOTTED_HEAVY_LINE", - 6, - "dottedHeavy", - "Specifies a dotted heavy line underline.", - ), - XmlMappedEnumMember( - "DOTTED_LINE", 5, "dotted", "Specifies a dotted line underline." - ), - XmlMappedEnumMember( - "DOUBLE_LINE", 3, "dbl", "Specifies a double line underline." - ), - XmlMappedEnumMember( - "HEAVY_LINE", 4, "heavy", "Specifies a heavy line underline." - ), - XmlMappedEnumMember( - "SINGLE_LINE", 2, "sng", "Specifies a single line underline." - ), - XmlMappedEnumMember( - "WAVY_DOUBLE_LINE", 17, "wavyDbl", "Specifies a wavy double line underline." - ), - XmlMappedEnumMember( - "WAVY_HEAVY_LINE", 16, "wavyHeavy", "Specifies a wavy heavy line underline." - ), - XmlMappedEnumMember( - "WAVY_LINE", 15, "wavy", "Specifies a wavy line underline." - ), - XmlMappedEnumMember("WORDS", 1, "words", "Specifies underlining words."), - ReturnValueOnlyEnumMember("MIXED", -2, "Specifies a mixed of underline types."), - ) + NONE = (0, "none", "Specifies no underline.") + """Specifies no underline.""" + DASH_HEAVY_LINE = (8, "dashHeavy", "Specifies a dash underline.") + """Specifies a dash underline.""" -@alias("MSO_ANCHOR") -class MSO_VERTICAL_ANCHOR(XmlEnumeration): - """ - 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. - """ + DASH_LINE = (7, "dash", "Specifies a dash line underline.") + """Specifies a dash line underline.""" - __ms_name__ = "MsoVerticalAnchor" - - __url__ = "http://msdn.microsoft.com/en-us/library/office/ff865255.aspx" - - __members__ = ( - XmlMappedEnumMember( - None, - None, - None, - "Text frame has no vertical anchor specified " - "and inherits its value from its layout placeholder or theme.", - ), - XmlMappedEnumMember("TOP", 1, "t", "Aligns text to top of text frame"), - XmlMappedEnumMember("MIDDLE", 3, "ctr", "Centers text vertically"), - XmlMappedEnumMember("BOTTOM", 4, "b", "Aligns text to bottom of text frame"), - ReturnValueOnlyEnumMember( - "MIXED", - -2, - "Return value only; indicates a combination of the " "other states.", - ), + 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.""" -@alias("PP_ALIGN") -class PP_PARAGRAPH_ALIGNMENT(XmlEnumeration): + WORDS = (1, "words", "Specifies underlining words.") + """Specifies underlining words.""" + + +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 """ - Specifies the horizontal alignment for one or more paragraphs. - Alias: ``PP_ALIGN`` + 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""" + + +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 """ - __ms_name__ = "PpParagraphAlignment" + CENTER = (2, "ctr", "Center align") + """Center align""" - __url__ = ( - "http://msdn.microsoft.com/en-us/library/office/ff745375(v=office.15" ").aspx" + 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""" - __members__ = ( - XmlMappedEnumMember("CENTER", 2, "ctr", "Center align"), - XmlMappedEnumMember( - "DISTRIBUTE", - 5, - "dist", - "Evenly distributes e.g. Japanese chara" - "cters from left to right within a line", - ), - XmlMappedEnumMember( - "JUSTIFY", - 4, - "just", - "Justified, i.e. each line both begins and" - " ends at the margin with spacing between words adjusted such th" - "at the line exactly fills the width of the paragraph.", - ), - XmlMappedEnumMember( - "JUSTIFY_LOW", - 7, - "justLow", - "Justify using a small amount of sp" "ace between words.", - ), - XmlMappedEnumMember("LEFT", 1, "l", "Left aligned"), - XmlMappedEnumMember("RIGHT", 3, "r", "Right aligned"), - XmlMappedEnumMember("THAI_DISTRIBUTE", 6, "thaiDist", "Thai distributed"), - ReturnValueOnlyEnumMember( - "MIXED", - -2, - "Return value only; indicates multiple paragraph al" - "ignments are present in a set of paragraphs.", - ), + 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""" + + +PP_ALIGN = PP_PARAGRAPH_ALIGNMENT diff --git a/src/pptx/oxml/text.py b/src/pptx/oxml/text.py index cf99dd0da..ced0f8088 100644 --- a/src/pptx/oxml/text.py +++ b/src/pptx/oxml/text.py @@ -69,9 +69,7 @@ def _escape_ctrl_chars(s): (x09) and line-feed (x0A) are not escaped. All other characters in the range x00-x1F are escaped. """ - return re.sub( - r"([\x00-\x08\x0B-\x1F])", lambda match: "_x%04X_" % ord(match.group(1)), s - ) + return re.sub(r"([\x00-\x08\x0B-\x1F])", lambda match: "_x%04X_" % ord(match.group(1)), s) class CT_TextBody(BaseOxmlElement): @@ -178,20 +176,12 @@ def unclear_content(self): @classmethod def _a_txBody_tmpl(cls): - return ( - "\n" - " \n" - " \n" - "\n" % (nsdecls("a")) - ) + return "\n" " \n" " \n" "\n" % (nsdecls("a")) @classmethod def _p_txBody_tmpl(cls): return ( - "\n" - " \n" - " \n" - "\n" % (nsdecls("p", "a")) + "\n" " \n" " \n" "\n" % (nsdecls("p", "a")) ) @classmethod @@ -237,7 +227,7 @@ def autofit(self): @autofit.setter def autofit(self, value): - if value is not None and value not in MSO_AUTO_SIZE._valid_settings: + if value is not None and value not in MSO_AUTO_SIZE: raise ValueError( "only None or a member of the MSO_AUTO_SIZE enumeration can " "be assigned to CT_TextBodyProperties.autofit, got %s" % value @@ -297,9 +287,7 @@ class CT_TextCharacterProperties(BaseOxmlElement): "a:extLst", ), ) - hlinkClick = ZeroOrOne( - "a:hlinkClick", successors=("a:hlinkMouseOver", "a:rtl", "a:extLst") - ) + hlinkClick = ZeroOrOne("a:hlinkClick", successors=("a:hlinkMouseOver", "a:rtl", "a:extLst")) lang = OptionalAttribute("lang", MSO_LANGUAGE_ID) sz = OptionalAttribute("sz", ST_TextFontSize) diff --git a/src/pptx/parts/embeddedpackage.py b/src/pptx/parts/embeddedpackage.py index a04cc224a..c2d434e04 100644 --- a/src/pptx/parts/embeddedpackage.py +++ b/src/pptx/parts/embeddedpackage.py @@ -25,7 +25,7 @@ def factory(cls, prog_id, object_blob, package): bytes of `object_blob` and has the content-type also determined by `prog_id`. """ # --- a generic OLE object has no subclass --- - if prog_id not in PROG_ID: + if not isinstance(prog_id, PROG_ID): return cls( package.next_partname("/ppt/embeddings/oleObject%d.bin"), CT.OFC_OLE_OBJECT, diff --git a/src/pptx/parts/slide.py b/src/pptx/parts/slide.py index dfd81b4e4..5d721bb41 100644 --- a/src/pptx/parts/slide.py +++ b/src/pptx/parts/slide.py @@ -112,9 +112,7 @@ def new(cls, package, slide_part): one is created based on the default template. """ notes_master_part = package.presentation_part.notes_master_part - notes_slide_part = cls._add_notes_slide_part( - package, slide_part, notes_master_part - ) + notes_slide_part = cls._add_notes_slide_part(package, slide_part, notes_master_part) notes_slide = notes_slide_part.notes_slide notes_slide.clone_master_placeholders(notes_master_part.notes_master) return notes_slide_part @@ -167,13 +165,11 @@ def add_chart_part(self, chart_type, chart_data): The chart depicts `chart_data` and is related to the slide contained in this part by `rId`. """ - return self.relate_to( - ChartPart.new(chart_type, chart_data, self._package), RT.CHART - ) + return self.relate_to(ChartPart.new(chart_type, chart_data, self._package), RT.CHART) def add_embedded_ole_object_part(self, prog_id, ole_object_file): """Return rId of newly-added OLE-object part formed from `ole_object_file`.""" - relationship_type = RT.PACKAGE if prog_id in PROG_ID else RT.OLE_OBJECT + relationship_type = RT.PACKAGE if isinstance(prog_id, PROG_ID) else RT.OLE_OBJECT return self.relate_to( EmbeddedPackagePart.factory( prog_id, self._blob_from_file(ole_object_file), self._package diff --git a/src/pptx/shapes/shapetree.py b/src/pptx/shapes/shapetree.py index 65369d51e..cebdfc91f 100644 --- a/src/pptx/shapes/shapetree.py +++ b/src/pptx/shapes/shapetree.py @@ -437,9 +437,7 @@ def _add_cxnSp(self, connector_type, begin_x, begin_y, end_x, end_y): x, y = min(begin_x, end_x), min(begin_y, end_y) cx, cy = abs(end_x - begin_x), abs(end_y - begin_y) - return self._element.add_cxnSp( - id_, name, connector_type, x, y, cx, cy, flipH, flipV - ) + return self._element.add_cxnSp(id_, name, connector_type, x, y, cx, cy, flipH, flipV) def _add_pic_from_image_part(self, image_part, rId, x, y, cx, cy): """Return a newly appended `p:pic` element as specified. @@ -564,9 +562,7 @@ def add_table(self, rows, cols, left, top, width, height): the ``.table`` property on the returned |GraphicFrame| shape must be used to access the enclosed |Table| object. """ - graphicFrame = self._add_graphicFrame_containing_table( - rows, cols, left, top, width, height - ) + graphicFrame = self._add_graphicFrame_containing_table(rows, cols, left, top, width, height) graphic_frame = self._shape_factory(graphicFrame) return graphic_frame @@ -788,9 +784,7 @@ def __iter__(self): """ Generate placeholder shapes in `idx` order. """ - ph_elms = sorted( - [e for e in self._element.iter_ph_elms()], key=lambda e: e.ph_idx - ) + ph_elms = sorted([e for e in self._element.iter_ph_elms()], key=lambda e: e.ph_idx) return (SlideShapeFactory(e, self) for e in ph_elms) def __len__(self): @@ -896,9 +890,7 @@ class is not intended to be constructed or an instance of it retained by a object such that its helper methods can be organized here. """ - def __init__( - self, shapes, shape_id, movie_file, x, y, cx, cy, poster_frame_file, mime_type - ): + def __init__(self, shapes, shape_id, movie_file, x, y, cx, cy, poster_frame_file, mime_type): super(_MoviePicElementCreator, self).__init__() self._shapes = shapes self._shape_id = shape_id @@ -917,9 +909,7 @@ def new_movie_pic( *poster_frame_file* is None, the default "media loudspeaker" image is used. """ - return cls( - shapes, shape_id, movie_file, x, y, cx, cy, poster_frame_image, mime_type - )._pic + return cls(shapes, shape_id, movie_file, x, y, cx, cy, poster_frame_image, mime_type)._pic return @property @@ -965,9 +955,7 @@ def _poster_frame_rId(self): The poster frame is the image used to represent the video before it's played. """ - _, poster_frame_rId = self._slide_part.get_or_add_image_part( - self._poster_frame_image_file - ) + _, poster_frame_rId = self._slide_part.get_or_add_image_part(self._poster_frame_image_file) return poster_frame_rId @property @@ -1101,9 +1089,7 @@ def _cx(self): # --- the default width is specified by the PROG_ID member if prog_id is one, # --- otherwise it gets the default icon width. return ( - Emu(self._prog_id_arg.width) - if self._prog_id_arg in PROG_ID - else Emu(965200) + Emu(self._prog_id_arg.width) if isinstance(self._prog_id_arg, PROG_ID) else Emu(965200) ) @lazyproperty @@ -1116,9 +1102,7 @@ def _cy(self): # --- the default height is specified by the PROG_ID member if prog_id is one, # --- otherwise it gets the default icon height. return ( - Emu(self._prog_id_arg.height) - if self._prog_id_arg in PROG_ID - else Emu(609600) + Emu(self._prog_id_arg.height) if isinstance(self._prog_id_arg, PROG_ID) else Emu(609600) ) @lazyproperty @@ -1132,9 +1116,7 @@ def _icon_height(self): The correct size can be determined by creating an example PPTX using PowerPoint and then inspecting the XML of the OLE graphics-frame (p:oleObj.imgH). """ - return ( - self._icon_height_arg if self._icon_height_arg is not None else Emu(609600) - ) + return self._icon_height_arg if self._icon_height_arg is not None else Emu(609600) @lazyproperty def _icon_image_file(self): @@ -1150,7 +1132,7 @@ def _icon_image_file(self): # --- user-specified (str) prog_id gets the default icon. icon_filename = ( self._prog_id_arg.icon_filename - if self._prog_id_arg in PROG_ID + if isinstance(self._prog_id_arg, PROG_ID) else "generic-icon.emf" ) @@ -1195,7 +1177,7 @@ def _progId(self): # --- member of PROG_ID enumeration knows its progId keyphrase, otherwise caller # --- has specified it explicitly (as str) - return prog_id_arg.progId if prog_id_arg in PROG_ID else prog_id_arg + return prog_id_arg.progId if isinstance(prog_id_arg, PROG_ID) else prog_id_arg @lazyproperty def _shape_name(self): diff --git a/tests/chart/test_data.py b/tests/chart/test_data.py index 537875569..10b325bf9 100644 --- a/tests/chart/test_data.py +++ b/tests/chart/test_data.py @@ -28,7 +28,7 @@ XySeriesData, ) from pptx.chart.xlsx import CategoryWorkbookWriter -from pptx.enum.base import EnumValue +from pptx.enum.chart import XL_CHART_TYPE from ..unitutil.mock import call, class_mock, instance_mock, property_mock @@ -74,8 +74,8 @@ def ChartXmlWriter_(self, request): return ChartXmlWriter_ @pytest.fixture - def chart_type_(self, request): - return instance_mock(request, EnumValue) + def chart_type_(self): + return XL_CHART_TYPE.PIE class Describe_BaseSeriesData(object): @@ -229,15 +229,11 @@ def values_ref_fixture(self, _workbook_writer_prop_, workbook_writer_, series_): @pytest.fixture def Categories_(self, request, categories_): - return class_mock( - request, "pptx.chart.data.Categories", return_value=categories_ - ) + return class_mock(request, "pptx.chart.data.Categories", return_value=categories_) @pytest.fixture def CategorySeriesData_(self, request, series_): - return class_mock( - request, "pptx.chart.data.CategorySeriesData", return_value=series_ - ) + return class_mock(request, "pptx.chart.data.CategorySeriesData", return_value=series_) @pytest.fixture def categories_(self, request): @@ -245,9 +241,7 @@ def categories_(self, request): @pytest.fixture def categories_prop_(self, request, categories_): - return property_mock( - request, CategoryChartData, "categories", return_value=categories_ - ) + return property_mock(request, CategoryChartData, "categories", return_value=categories_) @pytest.fixture def category_(self, request): @@ -357,9 +351,7 @@ def are_numeric_fixture(self, request): categories.add_category(label) return categories, expected_value - @pytest.fixture( - params=[((), 0), ((1,), 1), ((3,), 3), ((1, 1, 1), 1), ((3, 3, 3), 3)] - ) + @pytest.fixture(params=[((), 0), ((1,), 1), ((3,), 3), ((1, 1, 1), 1), ((3, 3, 3), 3)]) def depth_fixture(self, request): depths, expected_value = request.param categories = Categories() @@ -392,9 +384,7 @@ def leaf_fixture(self, request): leaf_counts, expected_value = request.param categories = Categories() for leaf_count in leaf_counts: - categories._categories.append( - instance_mock(request, Category, leaf_count=leaf_count) - ) + categories._categories.append(instance_mock(request, Category, leaf_count=leaf_count)) return categories, expected_value @pytest.fixture( @@ -525,9 +515,7 @@ def it_calculates_an_excel_date_number_to_help(self, excel_date_fixture): def add_sub_fixture(self, request, category_): category = Category(None, None) name = "foobar" - Category_ = class_mock( - request, "pptx.chart.data.Category", return_value=category_ - ) + Category_ = class_mock(request, "pptx.chart.data.Category", return_value=category_) return category, name, Category_, category_ @pytest.fixture(params=[((), 1), ((1,), 2), ((1, 1, 1), 2), ((2, 2, 2), 3)]) @@ -535,18 +523,14 @@ def depth_fixture(self, request): depths, expected_value = request.param category = Category(None, None) for depth in depths: - category._sub_categories.append( - instance_mock(request, Category, depth=depth) - ) + category._sub_categories.append(instance_mock(request, Category, depth=depth)) return category, expected_value @pytest.fixture def depth_raises_fixture(self, request): category = Category(None, None) for depth in (1, 2, 1): - category._sub_categories.append( - instance_mock(request, Category, depth=depth) - ) + category._sub_categories.append(instance_mock(request, Category, depth=depth)) return category @pytest.fixture( @@ -594,9 +578,7 @@ def leaf_fixture(self, request): leaf_counts, expected_value = request.param category = Category(None, None) for leaf_count in leaf_counts: - category._sub_categories.append( - instance_mock(request, Category, leaf_count=leaf_count) - ) + category._sub_categories.append(instance_mock(request, Category, leaf_count=leaf_count)) return category, expected_value @pytest.fixture( @@ -683,9 +665,7 @@ def values_fixture(self, request): series_data = CategorySeriesData(None, None, None) expected_values = [1, 2, 3] for value in expected_values: - series_data._data_points.append( - instance_mock(request, CategoryDataPoint, value=value) - ) + series_data._data_points.append(instance_mock(request, CategoryDataPoint, value=value)) return series_data, expected_values @pytest.fixture @@ -699,9 +679,7 @@ def values_ref_fixture(self, chart_data_): @pytest.fixture def CategoryDataPoint_(self, request, data_point_): - return class_mock( - request, "pptx.chart.data.CategoryDataPoint", return_value=data_point_ - ) + return class_mock(request, "pptx.chart.data.CategoryDataPoint", return_value=data_point_) @pytest.fixture def categories_(self, request): @@ -736,9 +714,7 @@ def add_series_fixture(self, request, BubbleSeriesData_, series_data_): @pytest.fixture def BubbleSeriesData_(self, request, series_data_): - return class_mock( - request, "pptx.chart.data.BubbleSeriesData", return_value=series_data_ - ) + return class_mock(request, "pptx.chart.data.BubbleSeriesData", return_value=series_data_) @pytest.fixture def series_data_(self, request): @@ -768,9 +744,7 @@ def add_series_fixture(self, request, XySeriesData_, series_data_): @pytest.fixture def XySeriesData_(self, request, series_data_): - return class_mock( - request, "pptx.chart.data.XySeriesData", return_value=series_data_ - ) + return class_mock(request, "pptx.chart.data.XySeriesData", return_value=series_data_) @pytest.fixture def series_data_(self, request): @@ -797,9 +771,7 @@ def add_data_point_fixture(self, request, BubbleDataPoint_, data_point_): @pytest.fixture def BubbleDataPoint_(self, request, data_point_): - return class_mock( - request, "pptx.chart.data.BubbleDataPoint", return_value=data_point_ - ) + return class_mock(request, "pptx.chart.data.BubbleDataPoint", return_value=data_point_) @pytest.fixture def data_point_(self, request): @@ -842,9 +814,7 @@ def data_point_(self, request): @pytest.fixture def XyDataPoint_(self, request, data_point_): - return class_mock( - request, "pptx.chart.data.XyDataPoint", return_value=data_point_ - ) + return class_mock(request, "pptx.chart.data.XyDataPoint", return_value=data_point_) class DescribeCategoryDataPoint(object): diff --git a/tests/dml/test_line.py b/tests/dml/test_line.py index 9d6cec30a..b33e6e094 100644 --- a/tests/dml/test_line.py +++ b/tests/dml/test_line.py @@ -53,9 +53,7 @@ def it_has_a_color(self, color_fixture): # fixtures ------------------------------------------------------- - @pytest.fixture( - params=[(MSO_FILL.SOLID, False), (MSO_FILL.BACKGROUND, True), (None, True)] - ) + @pytest.fixture(params=[(MSO_FILL.SOLID, False), (MSO_FILL.BACKGROUND, True), (None, True)]) def color_fixture(self, request, line, fill_prop_, fill_, color_): pre_call_fill_type, solid_call_expected = request.param fill_.type = pre_call_fill_type @@ -80,7 +78,7 @@ def dash_style_get_fixture(self, request): @pytest.fixture( params=[ ("p:spPr{a:b=c}", MSO_LINE.DASH, "p:spPr{a:b=c}/a:ln/a:prstDash{val=dash}"), - ("p:spPr/a:ln", MSO_LINE.ROUND_DOT, "p:spPr/a:ln/a:prstDash{val=dot}"), + ("p:spPr/a:ln", MSO_LINE.ROUND_DOT, "p:spPr/a:ln/a:prstDash{val=sysDot}"), ( "p:spPr/a:ln/a:prstDash", MSO_LINE.SOLID, @@ -129,9 +127,7 @@ def width_get_fixture(self, request, shape_): ) def width_set_fixture(self, request, shape_): initial_width, width = request.param - shape_.ln = shape_.get_or_add_ln.return_value = self.ln_bldr( - initial_width - ).element + shape_.ln = shape_.get_or_add_ln.return_value = self.ln_bldr(initial_width).element line = LineFormat(shape_) expected_xml = self.ln_bldr(width).xml() return line, width, expected_xml diff --git a/tests/enum/__init__.py b/tests/enum/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/enum/test_base.py b/tests/enum/test_base.py new file mode 100644 index 000000000..3b4e970a7 --- /dev/null +++ b/tests/enum/test_base.py @@ -0,0 +1,73 @@ +"""Unit-test suite for `pptx.enum.base`.""" + +from __future__ import annotations + +import pytest + +from pptx.enum.action import PP_ACTION, PP_ACTION_TYPE +from pptx.enum.dml import MSO_LINE_DASH_STYLE + + +class DescribeBaseEnum: + """Unit-test suite for `pptx.enum.base.BaseEnum`.""" + + def it_produces_members_each_equivalent_to_an_integer_value(self): + assert PP_ACTION_TYPE.END_SHOW == 6 + assert PP_ACTION_TYPE.NONE == 0 + + def but_member_reprs_are_a_str_indicating_the_enum_and_member_name(self): + assert repr(PP_ACTION_TYPE.END_SHOW) == "" + assert repr(PP_ACTION_TYPE.RUN_MACRO) == "" + + def and_member_str_values_are_a_str_indicating_the_member_name(self): + assert str(PP_ACTION_TYPE.FIRST_SLIDE) == "FIRST_SLIDE (3)" + assert str(PP_ACTION_TYPE.HYPERLINK) == "HYPERLINK (7)" + + def it_provides_a_docstring_for_each_member(self): + assert PP_ACTION_TYPE.LAST_SLIDE.__doc__ == "Moves to the last slide." + assert PP_ACTION_TYPE.LAST_SLIDE_VIEWED.__doc__ == "Moves to the last slide viewed." + + def it_can_look_up_a_member_by_its_value(self): + assert PP_ACTION_TYPE(10) == PP_ACTION_TYPE.NAMED_SLIDE_SHOW + assert PP_ACTION_TYPE(101) == PP_ACTION_TYPE.NAMED_SLIDE + + def but_it_raises_when_no_member_has_that_value(self): + with pytest.raises(ValueError, match="42 is not a valid PP_ACTION_TYPE"): + PP_ACTION_TYPE(42) + + def it_knows_its_name(self): + assert PP_ACTION_TYPE.NEXT_SLIDE.name == "NEXT_SLIDE" + assert PP_ACTION_TYPE.NONE.name == "NONE" + + def it_can_be_referred_to_by_a_convenience_alias_if_defined(self): + assert PP_ACTION_TYPE.OPEN_FILE is PP_ACTION.OPEN_FILE + + +class DescribeBaseXmlEnum: + """Unit-test suite for `pptx.enum.base.BaseXmlEnum`.""" + + def it_can_look_up_a_member_by_its_corresponding_XML_attribute_value(self): + assert MSO_LINE_DASH_STYLE.from_xml("dash") == MSO_LINE_DASH_STYLE.DASH + assert MSO_LINE_DASH_STYLE.from_xml("dashDot") == MSO_LINE_DASH_STYLE.DASH_DOT + + def but_it_raises_on_an_attribute_value_that_is_not_regitstered(self): + with pytest.raises(ValueError, match="MSO_LINE_DASH_STYLE has no XML mapping for 'wavy'"): + MSO_LINE_DASH_STYLE.from_xml("wavy") + + def and_the_empty_string_never_maps_to_a_member(self): + with pytest.raises(ValueError, match="MSO_LINE_DASH_STYLE has no XML mapping for ''"): + MSO_LINE_DASH_STYLE.from_xml("") + + def it_knows_the_XML_attribute_value_for_each_member_that_has_one(self): + assert MSO_LINE_DASH_STYLE.to_xml(MSO_LINE_DASH_STYLE.SOLID) == "solid" + + def and_it_looks_up_the_member_by_int_value_before_mapping_when_provided_that_way(self): + assert MSO_LINE_DASH_STYLE.to_xml(3) == "sysDot" + + def but_it_raises_when_no_member_has_the_provided_int_value(self): + with pytest.raises(ValueError, match="42 is not a valid MSO_LINE_DASH_STYLE"): + MSO_LINE_DASH_STYLE.to_xml(42) + + def and_it_raises_when_the_member_has_no_XML_value(self): + with pytest.raises(ValueError, match="MSO_LINE_DASH_STYLE.DASH_STYLE_MIXED has no XML r"): + MSO_LINE_DASH_STYLE.to_xml(-2) diff --git a/tests/enum/test_shapes.py b/tests/enum/test_shapes.py new file mode 100644 index 000000000..5bfac6966 --- /dev/null +++ b/tests/enum/test_shapes.py @@ -0,0 +1,46 @@ +"""Unit-test suite for `pptx.enum.shapes`.""" + +from __future__ import annotations + +import pytest + +from pptx.enum.shapes import PROG_ID + + +class DescribeProgId: + """Unit-test suite for `pptx.enum.shapes.ProgId`.""" + + def it_has_members_for_the_OLE_embeddings_known_to_work_on_Windows(self): + assert PROG_ID.DOCX + assert PROG_ID.PPTX + assert PROG_ID.XLSX + + @pytest.mark.parametrize( + ("member", "expected_value"), + [(PROG_ID.DOCX, 609600), (PROG_ID.PPTX, 609600), (PROG_ID.XLSX, 609600)], + ) + def it_knows_its_height(self, member: PROG_ID, expected_value: int): + assert member.height == expected_value + + def it_knows_its_icon_filename(self): + assert PROG_ID.DOCX.icon_filename == "docx-icon.emf" + + def it_knows_its_progId(self): + assert PROG_ID.PPTX.progId == "PowerPoint.Show.12" + + def it_knows_its_width(self): + assert PROG_ID.XLSX.width == 965200 + + @pytest.mark.parametrize( + ("value", "expected_value"), + [ + # -DELETEME--------------------------------------------------------------- + (PROG_ID.DOCX, True), + (PROG_ID.PPTX, True), + (PROG_ID.XLSX, True), + (17, False), + ("XLSX", False), + ], + ) + def it_knows_each_of_its_members_is_an_instance(self, value: object, expected_value: bool): + assert isinstance(value, PROG_ID) is expected_value diff --git a/tests/shapes/test_autoshape.py b/tests/shapes/test_autoshape.py index 1c4787c85..9e6173caf 100644 --- a/tests/shapes/test_autoshape.py +++ b/tests/shapes/test_autoshape.py @@ -72,17 +72,13 @@ def it_should_load_adj_val_actuals_from_xml(self, load_adj_actuals_fixture_): actual_actuals = dict([(a.name, a.actual) for a in adjustments]) assert actual_actuals == expected_actuals - def it_provides_normalized_effective_value_on_indexed_access( - self, indexed_access_fixture_ - ): + def it_provides_normalized_effective_value_on_indexed_access(self, indexed_access_fixture_): prstGeom, prst, expected_values = indexed_access_fixture_ adjustments = AdjustmentCollection(prstGeom) actual_values = [adjustments[idx] for idx in range(len(adjustments))] assert actual_values == expected_values - def it_should_update_actual_value_on_indexed_assignment( - self, indexed_assignment_fixture_ - ): + def it_should_update_actual_value_on_indexed_assignment(self, indexed_assignment_fixture_): """ Assignment to AdjustmentCollection[n] updates nth actual """ @@ -147,9 +143,7 @@ def adjustments_with_prstGeom_(self, request): def _adj_actuals_cases(): gd_bldr = a_gd().with_name("adj2").with_fmla("val 25000") avLst_bldr = an_avLst().with_child(gd_bldr) - mathDivide_bldr = ( - a_prstGeom().with_nsdecls().with_prst("mathDivide").with_child(avLst_bldr) - ) + mathDivide_bldr = a_prstGeom().with_nsdecls().with_prst("mathDivide").with_child(avLst_bldr) gd_bldr = a_gd().with_name("adj").with_fmla("val 25000") avLst_bldr = an_avLst().with_child(gd_bldr) @@ -158,14 +152,9 @@ def _adj_actuals_cases(): gd_bldr_1 = a_gd().with_name("adj1").with_fmla("val 111") gd_bldr_2 = a_gd().with_name("adj2").with_fmla("val 222") gd_bldr_3 = a_gd().with_name("adj3").with_fmla("val 333") - avLst_bldr = ( - an_avLst().with_child(gd_bldr_1).with_child(gd_bldr_2).with_child(gd_bldr_3) - ) + avLst_bldr = an_avLst().with_child(gd_bldr_1).with_child(gd_bldr_2).with_child(gd_bldr_3) wedgeRoundRectCallout_bldr = ( - a_prstGeom() - .with_nsdecls() - .with_prst("wedgeRoundRectCallout") - .with_child(avLst_bldr) + a_prstGeom().with_nsdecls().with_prst("wedgeRoundRectCallout").with_child(avLst_bldr) ) return [ @@ -230,9 +219,7 @@ def _prstGeom_cases(): @pytest.fixture(params=_prstGeom_cases()) def prstGeom_cases_(self, request): prst, expected_values = request.param - prstGeom = ( - a_prstGeom().with_nsdecls().with_prst(prst).with_child(an_avLst()).element - ) + prstGeom = a_prstGeom().with_nsdecls().with_prst(prst).with_child(an_avLst()).element return prstGeom, prst, expected_values def _effective_val_cases(): @@ -274,9 +261,7 @@ def it_xml_escapes_the_basename_when_the_name_contains_special_characters(self): assert autoshape_type.prst == "noSmoking" assert autoshape_type.basename == ""No" Symbol" - def it_knows_the_default_adj_vals_for_its_autoshape_type( - self, default_adj_vals_fixture_ - ): + def it_knows_the_default_adj_vals_for_its_autoshape_type(self, default_adj_vals_fixture_): prst, default_adj_vals = default_adj_vals_fixture_ _default_adj_vals = AutoShapeType.default_adjustment_values(prst) assert _default_adj_vals == default_adj_vals @@ -285,7 +270,7 @@ def it_knows_the_autoshape_type_id_for_each_prst_key(self): assert AutoShapeType.id_from_prst("rect") == MSO_SHAPE.RECTANGLE def it_raises_when_asked_for_autoshape_type_id_with_a_bad_prst(self): - with pytest.raises(KeyError): + with pytest.raises(ValueError): AutoShapeType.id_from_prst("badPrst") def it_caches_autoshape_type_lookups(self): @@ -335,9 +320,7 @@ def it_knows_its_autoshape_type(self, autoshape_type_fixture_): auto_shape_type = shape.auto_shape_type assert auto_shape_type == expected_value - def but_it_raises_when_auto_shape_type_called_on_non_autoshape( - self, non_autoshape_shape_ - ): + def but_it_raises_when_auto_shape_type_called_on_non_autoshape(self, non_autoshape_shape_): with pytest.raises(ValueError): non_autoshape_shape_.auto_shape_type @@ -354,9 +337,7 @@ def it_has_a_line(self, shape): def it_knows_its_shape_type_when_its_a_placeholder(self, placeholder_shape_): assert placeholder_shape_.shape_type == MSO_SHAPE_TYPE.PLACEHOLDER - def and_it_knows_its_shape_type_when_its_not_a_placeholder( - self, non_placeholder_shapes_ - ): + def and_it_knows_its_shape_type_when_its_not_a_placeholder(self, non_placeholder_shapes_): autoshape_shape_, textbox_shape_, freeform_ = non_placeholder_shapes_ assert autoshape_shape_.shape_type == MSO_SHAPE_TYPE.AUTO_SHAPE assert textbox_shape_.shape_type == MSO_SHAPE_TYPE.TEXT_BOX @@ -417,9 +398,7 @@ def autoshape_type_fixture_(self, shape, prst): return shape, MSO_SHAPE.CHEVRON @pytest.fixture - def init_adjs_fixture_( - self, request, shape, sp_, adjustments_, AdjustmentCollection_ - ): + def init_adjs_fixture_(self, request, shape, sp_, adjustments_, AdjustmentCollection_): return shape, adjustments_, AdjustmentCollection_, sp_ @pytest.fixture @@ -508,9 +487,7 @@ def sp_(self, request, prst): @pytest.fixture def TextFrame_(self, request, text_frame_): - return class_mock( - request, "pptx.shapes.autoshape.TextFrame", return_value=text_frame_ - ) + return class_mock(request, "pptx.shapes.autoshape.TextFrame", return_value=text_frame_) @pytest.fixture def text_frame_(self, request): diff --git a/tests/test_enum.py b/tests/test_enum.py deleted file mode 100644 index db1ff58d0..000000000 --- a/tests/test_enum.py +++ /dev/null @@ -1,120 +0,0 @@ -# encoding: utf-8 - -"""Unit-test suite for `pptx.enum` subpackage, focused on base classes. - -Configured a little differently because of the meta-programming, the two enumeration -classes at the top constitute the entire fixture and most of the tests themselves just -make assertions on those. -""" - -import pytest - -from pptx.enum.base import ( - alias, - Enumeration, - EnumMember, - ReturnValueOnlyEnumMember, - XmlEnumeration, - XmlMappedEnumMember, -) -from pptx.enum.shapes import PROG_ID, _ProgIdEnum -from pptx.util import Emu - - -@alias("BARFOO") -class FOOBAR(Enumeration): - """ - Enumeration docstring - """ - - __ms_name__ = "MsoFoobar" - - __url__ = "http://msdn.microsoft.com/foobar.aspx" - - __members__ = ( - EnumMember("READ_WRITE", 1, "Readable and settable"), - ReturnValueOnlyEnumMember("READ_ONLY", -2, "Return value only"), - ) - - -@alias("XML-FU") -class XMLFOO(XmlEnumeration): - """ - XmlEnumeration docstring - """ - - __ms_name__ = "MsoXmlFoobar" - - __url__ = "http://msdn.microsoft.com/msoxmlfoobar.aspx" - - __members__ = ( - XmlMappedEnumMember(None, None, None, "No setting"), - XmlMappedEnumMember("XML_RW", 42, "attrVal", "Read/write setting"), - ReturnValueOnlyEnumMember("RO", -2, "Return value only;"), - ) - - -class DescribeEnumeration(object): - def it_has_the_right_metaclass(self): - assert type(FOOBAR).__name__ == "MetaEnumeration" - - def it_provides_an_EnumValue_instance_for_each_named_member(self): - for obj in (FOOBAR.READ_WRITE, FOOBAR.READ_ONLY): - assert type(obj).__name__ == "EnumValue" - - def it_provides_the_enumeration_value_for_each_named_member(self): - assert FOOBAR.READ_WRITE == 1 - assert FOOBAR.READ_ONLY == -2 - - def it_knows_if_a_setting_is_valid(self): - FOOBAR.validate(FOOBAR.READ_WRITE) - with pytest.raises(ValueError): - FOOBAR.validate("foobar") - with pytest.raises(ValueError): - FOOBAR.validate(FOOBAR.READ_ONLY) - - def it_can_be_referred_to_by_a_convenience_alias_if_defined(self): - assert BARFOO is FOOBAR # noqa - - -class DescribeEnumValue(object): - def it_provides_its_symbolic_name_as_its_string_value(self): - assert ("%s" % FOOBAR.READ_WRITE) == "READ_WRITE (1)" - - def it_provides_its_description_as_its_docstring(self): - assert FOOBAR.READ_ONLY.__doc__ == "Return value only" - - -class DescribeXmlEnumeration(object): - def it_knows_the_XML_value_for_each_of_its_xml_members(self): - assert XMLFOO.to_xml(XMLFOO.XML_RW) == "attrVal" - assert XMLFOO.to_xml(42) == "attrVal" - with pytest.raises(ValueError): - XMLFOO.to_xml(XMLFOO.RO) - - def it_can_map_each_of_its_xml_members_from_the_XML_value(self): - assert XMLFOO.from_xml(None) is None - assert XMLFOO.from_xml("attrVal") == XMLFOO.XML_RW - assert str(XMLFOO.from_xml("attrVal")) == "XML_RW (42)" - - -class Describe_ProgIdEnum(object): - """Unit-test suite for `pptx.enum.shapes._ProgIdEnum.""" - - def it_provides_access_to_its_members(self): - assert type(PROG_ID.XLSX) == _ProgIdEnum.Member - - def it_can_test_an_item_for_membership(self): - assert PROG_ID.XLSX in PROG_ID - - def it_has_a_readable_representation_for_itself(self): - assert repr(PROG_ID) == "pptx.enum.shapes.PROG_ID" - - def it_has_a_readable_representation_for_each_of_its_members(self): - assert repr(PROG_ID.XLSX) == "PROG_ID.XLSX" - - def it_has_attributes_on_each_member(self): - assert PROG_ID.XLSX.height == Emu(609600) - assert PROG_ID.XLSX.icon_filename == "xlsx-icon.emf" - assert PROG_ID.XLSX.progId == "Excel.Sheet.12" - assert PROG_ID.XLSX.width == Emu(965200)