# SPDX-FileCopyrightText: 2022 Chris Heywood
#
# SPDX-License-Identifier: GPL-3.0-or-later

from gi.repository import GObject

from abc import abstractmethod
from typing import Optional

from iotas.note import Note


class NoteExporter(GObject.Object):
    """Single note exporter."""

    # __gsignals__ = {
    #     # str: single export out path
    #     "finished": (GObject.SignalFlags.RUN_FIRST, None, (str,)),
    #     # str: reason
    #     "failed": (GObject.SignalFlags.RUN_FIRST, None, (str,)),
    # }

    @abstractmethod
    def export(
        self,
        note: Note,
        out_format: str,
        file_extension: str,
        supporting_tex: bool,
        allow_missing_images: bool = False,
        user_location: Optional[str] = None,
    ) -> None:
        """Export note.

        :param Note note: Note to render
        :param str out_format: Export format
        :param str file_extension: File extension
        :param bool supporting_tex: TeX support
        :param bool allow_missing_images: Whether missing images are treated as a failure
        :param str user_location: User chosen export location, optional
        """
        raise NotImplementedError()
