aboutsummaryrefslogtreecommitdiff
path: root/.venv/lib/python3.12/site-packages/pptx/types.py
blob: 46d86661b822a3c0e4f7108aa3511aa392162eb1 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"""Abstract types used by `python-pptx`."""

from __future__ import annotations

from typing import TYPE_CHECKING

from typing_extensions import Protocol

if TYPE_CHECKING:
    from pptx.opc.package import XmlPart
    from pptx.util import Length


class ProvidesExtents(Protocol):
    """An object that has width and height."""

    @property
    def height(self) -> Length:
        """Distance between top and bottom extents of shape in EMUs."""
        ...

    @property
    def width(self) -> Length:
        """Distance between left and right extents of shape in EMUs."""
        ...


class ProvidesPart(Protocol):
    """An object that provides access to its XmlPart.

    This type is for objects that need access to their part, possibly because they need access to
    the package or related parts.
    """

    @property
    def part(self) -> XmlPart: ...