Skip to content

Commit

Permalink
rfctr(enum): modernize enumerations
Browse files Browse the repository at this point in the history
  • Loading branch information
scanny committed Aug 3, 2024
1 parent 7efa08d commit 01b86e6
Show file tree
Hide file tree
Showing 18 changed files with 2,785 additions and 2,556 deletions.
85 changes: 55 additions & 30 deletions src/pptx/enum/action.py
Original file line number Diff line number Diff line change
@@ -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).
Expand All @@ -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
Loading

0 comments on commit 01b86e6

Please sign in to comment.