# This file was automatically generated by SWIG (https://www.swig.org).
# Version 4.5.1
#
# Do not make changes to this file unless you know what you are doing - modify
# the SWIG interface file instead.

import typing
# Import the low-level C/C++ module
if getattr(globals().get("__spec__"), "parent", None) or __package__ or "." in __name__:
    from . import _progressbar
else:
    import _progressbar

import builtins as __builtin__

def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)


def _swig_setattr_nondynamic_instance_variable(set):
    def set_instance_attr(self, name, value):
        if name == "this":
            set(self, name, value)
        elif name == "thisown":
            self.this.own(value)
        elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
            set(self, name, value)
        else:
            raise AttributeError("You cannot add instance attributes to %s" % self)
    return set_instance_attr


def _swig_setattr_nondynamic_class_variable(set):
    def set_class_attr(cls, name, value):
        if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
            set(cls, name, value)
        else:
            raise AttributeError("You cannot add class attributes to %s" % cls)
    return set_class_attr


class _SwigNonDynamicMeta(type):
    """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
    __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)


ProgressBarState_READY = _progressbar.ProgressBarState_READY
ProgressBarState_STARTED = _progressbar.ProgressBarState_STARTED
ProgressBarState_SUCCESS = _progressbar.ProgressBarState_SUCCESS
ProgressBarState_WARNING = _progressbar.ProgressBarState_WARNING
ProgressBarState_ERROR = _progressbar.ProgressBarState_ERROR
MessageType_INFO = _progressbar.MessageType_INFO
MessageType_SUCCESS = _progressbar.MessageType_SUCCESS
MessageType_WARNING = _progressbar.MessageType_WARNING
MessageType_ERROR = _progressbar.MessageType_ERROR
class ProgressBar(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _progressbar.delete_ProgressBar

    def reset(self):
        return _progressbar.ProgressBar_reset(self)

    def get_ticks(self):
        return _progressbar.ProgressBar_get_ticks(self)

    def set_ticks(self, value):
        return _progressbar.ProgressBar_set_ticks(self, value)

    def add_ticks(self, value):
        return _progressbar.ProgressBar_add_ticks(self, value)

    def get_total_ticks(self):
        return _progressbar.ProgressBar_get_total_ticks(self)

    def set_total_ticks(self, value):
        return _progressbar.ProgressBar_set_total_ticks(self, value)

    def get_number(self):
        return _progressbar.ProgressBar_get_number(self)

    def set_number(self, value):
        return _progressbar.ProgressBar_set_number(self, value)

    def get_total(self):
        return _progressbar.ProgressBar_get_total(self)

    def set_total(self, value):
        return _progressbar.ProgressBar_set_total(self, value)

    def start(self):
        return _progressbar.ProgressBar_start(self)

    def get_state(self):
        return _progressbar.ProgressBar_get_state(self)

    def set_state(self, value):
        return _progressbar.ProgressBar_set_state(self, value)

    def is_finished(self):
        return _progressbar.ProgressBar_is_finished(self)

    def is_failed(self):
        return _progressbar.ProgressBar_is_failed(self)

    def get_description(self):
        return _progressbar.ProgressBar_get_description(self)

    def set_description(self, value):
        return _progressbar.ProgressBar_set_description(self, value)

    def get_description_width(self):
        return _progressbar.ProgressBar_get_description_width(self)

    def add_message(self, type, message):
        return _progressbar.ProgressBar_add_message(self, type, message)

    def pop_message(self):
        r"""remove the last message"""
        return _progressbar.ProgressBar_pop_message(self)

    def get_messages(self):
        return _progressbar.ProgressBar_get_messages(self)

    def get_message_prefix(self):
        return _progressbar.ProgressBar_get_message_prefix(self)

    def calculate_messages_terminal_lines(self, terminal_width):
        r"""
        Calculate number of lines occupied by messages when printed on terminal of the given width.
        Takes new lines and wide utf characters into account.
        """
        return _progressbar.ProgressBar_calculate_messages_terminal_lines(self, terminal_width)

    def get_auto_finish(self):
        return _progressbar.ProgressBar_get_auto_finish(self)

    def set_auto_finish(self, value):
        return _progressbar.ProgressBar_set_auto_finish(self, value)

    def update(self):
        return _progressbar.ProgressBar_update(self)

    def get_percent_done(self):
        return _progressbar.ProgressBar_get_percent_done(self)

    def get_current_speed(self):
        return _progressbar.ProgressBar_get_current_speed(self)

    def get_average_speed(self):
        return _progressbar.ProgressBar_get_average_speed(self)

    def get_elapsed_seconds(self):
        return _progressbar.ProgressBar_get_elapsed_seconds(self)

    def get_remaining_seconds(self):
        return _progressbar.ProgressBar_get_remaining_seconds(self)

    def get_begin(self):
        return _progressbar.ProgressBar_get_begin(self)

# Register ProgressBar in _progressbar:
_progressbar.ProgressBar_swigregister(ProgressBar)
class DownloadProgressBar(ProgressBar):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    __swig_destroy__ = _progressbar.delete_DownloadProgressBar

    def __init__(self, *args):
        _progressbar.DownloadProgressBar_swiginit(self, _progressbar.new_DownloadProgressBar(*args))

    def get_messages(self):
        return _progressbar.DownloadProgressBar_get_messages(self)

    def set_state(self, value):
        return _progressbar.DownloadProgressBar_set_state(self, value)

    def set_ticks(self, value):
        return _progressbar.DownloadProgressBar_set_ticks(self, value)

    def set_total_ticks(self, value):
        return _progressbar.DownloadProgressBar_set_total_ticks(self, value)

    def get_number_widget_visible(self):
        return _progressbar.DownloadProgressBar_get_number_widget_visible(self)

    def set_number_widget_visible(self, value):
        return _progressbar.DownloadProgressBar_set_number_widget_visible(self, value)

# Register DownloadProgressBar in _progressbar:
_progressbar.DownloadProgressBar_swigregister(DownloadProgressBar)
class MultiProgressBar(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    NEVER_VISIBLE_LIMIT = _progressbar.MultiProgressBar_NEVER_VISIBLE_LIMIT
    TrackingMode_ON_RENDER = _progressbar.MultiProgressBar_TrackingMode_ON_RENDER
    r"""All bars are scanned on every render to detect state changes."""
    TrackingMode_ON_CHANGE = _progressbar.MultiProgressBar_TrackingMode_ON_CHANGE
    r"""
    State changes are tracked incrementally via bar_*() wrapper methods.
    Much faster when many bars are registered but only a few are active.
    """

    def __init__(self, *args):
        r"""
        *Overload 1:*
        Constructs a MultiProgressBar with the given tracking mode.

        |

        *Overload 2:*
        Constructs a MultiProgressBar with TrackingMode::ON_RENDER.
        """
        _progressbar.MultiProgressBar_swiginit(self, _progressbar.new_MultiProgressBar(*args))
    __swig_destroy__ = _progressbar.delete_MultiProgressBar

    def get_tracking_mode(self):
        r"""Returns the tracking mode set at construction."""
        return _progressbar.MultiProgressBar_get_tracking_mode(self)

    def add_bar(self, bar):
        return _progressbar.MultiProgressBar_add_bar(self, bar)

    def print(self):
        return _progressbar.MultiProgressBar_print(self)

    def get_total_bar(self):
        r"""Returns the total bar."""
        return _progressbar.MultiProgressBar_get_total_bar(self)

    def set_total_bar_visible_limit(self, value):
        r"""Sets the minimum number of registered progress bars to show the total bar."""
        return _progressbar.MultiProgressBar_set_total_bar_visible_limit(self, value)

    def set_total_bar_number_widget_visible(self, value):
        r"""Sets the visibility of number widget in the total bar."""
        return _progressbar.MultiProgressBar_set_total_bar_number_widget_visible(self, value)

    def set_total_num_of_bars(self, value):
        r"""
        Allows one to preset the value of the total number of progress bars.
        If the value is lower than the current number of registered progress bars, it is automatically increased.
        """
        return _progressbar.MultiProgressBar_set_total_num_of_bars(self, value)

    def get_total_num_of_bars(self):
        r"""
        Returns the total number of progress bars.
        It can be greater than the current number of registered progress bars.
        """
        return _progressbar.MultiProgressBar_get_total_num_of_bars(self)

    def bar_get_ticks(self, bar):
        r"""Returns the number of processed ticks."""
        return _progressbar.MultiProgressBar_bar_get_ticks(self, bar)

    def bar_set_ticks(self, bar, value):
        r"""Sets the number of processed ticks."""
        return _progressbar.MultiProgressBar_bar_set_ticks(self, bar, value)

    def bar_add_ticks(self, bar, value):
        r"""Adds to the number of processed ticks."""
        return _progressbar.MultiProgressBar_bar_add_ticks(self, bar, value)

    def bar_get_total_ticks(self, bar):
        r"""Returns the total number of ticks."""
        return _progressbar.MultiProgressBar_bar_get_total_ticks(self, bar)

    def bar_set_total_ticks(self, bar, value):
        r"""Sets the total number of ticks."""
        return _progressbar.MultiProgressBar_bar_set_total_ticks(self, bar, value)

    def bar_get_number(self, bar):
        r"""Returns the display number of the bar."""
        return _progressbar.MultiProgressBar_bar_get_number(self, bar)

    def bar_start(self, bar):
        r"""Starts the bar (transitions from READY to STARTED)."""
        return _progressbar.MultiProgressBar_bar_start(self, bar)

    def bar_get_state(self, bar):
        r"""Returns the current state."""
        return _progressbar.MultiProgressBar_bar_get_state(self, bar)

    def bar_set_state(self, bar, value):
        r"""Sets the state. Setting back to READY is not allowed."""
        return _progressbar.MultiProgressBar_bar_set_state(self, bar, value)

    def bar_is_finished(self, bar):
        r"""Returns true if the bar has reached a terminal state (SUCCESS or ERROR)."""
        return _progressbar.MultiProgressBar_bar_is_finished(self, bar)

    def bar_is_failed(self, bar):
        r"""Returns true if the bar is in the ERROR state."""
        return _progressbar.MultiProgressBar_bar_is_failed(self, bar)

    def bar_get_description(self, bar):
        r"""Returns the description string."""
        return _progressbar.MultiProgressBar_bar_get_description(self, bar)

    def bar_set_description(self, bar, value):
        r"""Sets the description string."""
        return _progressbar.MultiProgressBar_bar_set_description(self, bar, value)

    def bar_add_message(self, bar, type, message):
        r"""Adds a message to the bar."""
        return _progressbar.MultiProgressBar_bar_add_message(self, bar, type, message)

    def bar_pop_message(self, bar):
        r"""Removes the last message."""
        return _progressbar.MultiProgressBar_bar_pop_message(self, bar)

    def bar_get_messages(self, bar):
        r"""Returns all messages."""
        return _progressbar.MultiProgressBar_bar_get_messages(self, bar)

    def bar_get_message_prefix(self, bar):
        r"""Returns the message prefix string."""
        return _progressbar.MultiProgressBar_bar_get_message_prefix(self, bar)

    def bar_get_auto_finish(self, bar):
        r"""Returns whether auto-finish is enabled."""
        return _progressbar.MultiProgressBar_bar_get_auto_finish(self, bar)

    def bar_set_auto_finish(self, bar, value):
        r"""Enables or disables auto-finish. Disable to manage the terminal state manually."""
        return _progressbar.MultiProgressBar_bar_set_auto_finish(self, bar, value)

    def bar_get_percent_done(self, bar):
        r"""Returns the percentage of ticks done (0–100)."""
        return _progressbar.MultiProgressBar_bar_get_percent_done(self, bar)

    def bar_get_current_speed(self, bar):
        r"""Returns the current (recent) speed in ticks per second."""
        return _progressbar.MultiProgressBar_bar_get_current_speed(self, bar)

    def bar_get_average_speed(self, bar):
        r"""Returns the average speed in ticks per second."""
        return _progressbar.MultiProgressBar_bar_get_average_speed(self, bar)

    def bar_get_elapsed_seconds(self, bar):
        r"""Returns elapsed time in seconds."""
        return _progressbar.MultiProgressBar_bar_get_elapsed_seconds(self, bar)

    def bar_get_remaining_seconds(self, bar):
        r"""Returns estimated remaining time in seconds."""
        return _progressbar.MultiProgressBar_bar_get_remaining_seconds(self, bar)

# Register MultiProgressBar in _progressbar:
_progressbar.MultiProgressBar_swigregister(MultiProgressBar)

def __lshift__(*args):
    return _progressbar.__lshift__(*args)


