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

from sys import version_info as _swig_python_version_info
if _swig_python_version_info >= (3, 0, 0):
    new_instancemethod = lambda func, inst, cls: _context.SWIG_PyInstanceMethod_New(func)
else:
    from new import instancemethod as new_instancemethod
if _swig_python_version_info >= (2, 7, 0):
    def swig_import_helper():
        import importlib
        pkg = __name__.rpartition('.')[0]
        mname = '.'.join((pkg, '_context')).lstrip('.')
        try:
            return importlib.import_module(mname)
        except ImportError:
            return importlib.import_module('_context')
    _context = swig_import_helper()
    del swig_import_helper
elif _swig_python_version_info >= (2, 6, 0):
    def swig_import_helper():
        from os.path import dirname
        import imp
        fp = None
        try:
            fp, pathname, description = imp.find_module('_context', [dirname(__file__)])
        except ImportError:
            import _context
            return _context
        try:
            _mod = imp.load_module('_context', fp, pathname, description)
        finally:
            if fp is not None:
                fp.close()
        return _mod
    _context = swig_import_helper()
    del swig_import_helper
else:
    import _context
del _swig_python_version_info

try:
    _swig_property = property
except NameError:
    pass  # Python < 2.2 doesn't have 'property'.

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
    if (name == "thisown"):
        return self.this.own(value)
    if (name == "this"):
        if type(value).__name__ == 'SwigPyObject':
            self.__dict__[name] = value
            return
    method = class_type.__swig_setmethods__.get(name, None)
    if method:
        return method(self, value)
    if (not static):
        object.__setattr__(self, name, value)
    else:
        raise AttributeError("You cannot add attributes to %s" % self)


def _swig_setattr(self, class_type, name, value):
    return _swig_setattr_nondynamic(self, class_type, name, value, 0)


def _swig_getattr(self, class_type, name):
    if (name == "thisown"):
        return self.this.own()
    method = class_type.__swig_getmethods__.get(name, None)
    if method:
        return method(self)
    raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))


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_method(set):
    def set_attr(self, name, value):
        if (name == "thisown"):
            return self.this.own(value)
        if hasattr(self, name) or (name == "this"):
            set(self, name, value)
        else:
            raise AttributeError("You cannot add attributes to %s" % self)
    return set_attr


import gphoto2.abilities_list
import gphoto2.camera
import gphoto2.file
import gphoto2.filesys
import gphoto2.list
import gphoto2.port_info_list
import gphoto2.port_log
import gphoto2.result
import gphoto2.version
import gphoto2.widget
class CallbackDetails(object):
    """Proxy of C CallbackDetails struct."""

    thisown = _swig_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")
    __repr__ = _swig_repr
    func_1 = _swig_property(_context.CallbackDetails_func_1_get, _context.CallbackDetails_func_1_set)
    func_2 = _swig_property(_context.CallbackDetails_func_2_get, _context.CallbackDetails_func_2_set)
    func_3 = _swig_property(_context.CallbackDetails_func_3_get, _context.CallbackDetails_func_3_set)
    __swig_destroy__ = _context.delete_CallbackDetails
CallbackDetails_swigregister = _context.CallbackDetails_swigregister
CallbackDetails_swigregister(CallbackDetails)


def unset_progress_funcs(context: 'Context', start_func: 'GPContextProgressStartFunc', data: 'void *') -> "void":
    """
    unset_progress_funcs(context, start_func, data)

    Parameters
    ----------
    context: gphoto2.GPContext
    start_func: GPContextProgressStartFunc
    data: void *

    """
    return _context.unset_progress_funcs(context, start_func, data)
class Context(object):
    """Proxy of C _GPContext struct."""

    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
    __repr__ = _swig_repr

    def camera_autodetect(self) -> "void":
        """
        camera_autodetect(self)

        Parameters
        ----------
        self: struct _GPContext *

        """
        return _context.Context_camera_autodetect(self)


    def set_idle_func(self, func: 'GPContextIdleFunc', data: 'void *') -> "void":
        """
        set_idle_func(self, func, data)

        Parameters
        ----------
        func: callable function
        data: object

        """
        return _context.Context_set_idle_func(self, func, data)


    def set_error_func(self, func: 'GPContextErrorFunc', data: 'void *') -> "void":
        """
        set_error_func(self, func, data)

        Parameters
        ----------
        func: callable function
        data: object

        """
        return _context.Context_set_error_func(self, func, data)


    def set_message_func(self, func: 'GPContextMessageFunc', data: 'void *') -> "void":
        """
        set_message_func(self, func, data)

        Parameters
        ----------
        func: callable function
        data: object

        """
        return _context.Context_set_message_func(self, func, data)


    def set_question_func(self, func: 'GPContextQuestionFunc', data: 'void *') -> "void":
        """
        set_question_func(self, func, data)

        Parameters
        ----------
        func: callable function
        data: object

        """
        return _context.Context_set_question_func(self, func, data)


    def set_cancel_func(self, func: 'GPContextCancelFunc', data: 'void *') -> "void":
        """
        set_cancel_func(self, func, data)

        Parameters
        ----------
        func: callable function
        data: object

        """
        return _context.Context_set_cancel_func(self, func, data)


    def set_progress_funcs(self, start_func: 'GPContextProgressStartFunc', update_func: 'GPContextProgressUpdateFunc', stop_func: 'GPContextProgressStopFunc', data: 'void *') -> "void":
        """
        set_progress_funcs(self, start_func, update_func, stop_func, data)

        Parameters
        ----------
        start_func: callable function
        update_func: callable function
        stop_func: callable function
        data: object

        """
        return _context.Context_set_progress_funcs(self, start_func, update_func, stop_func, data)


    def set_status_func(self, func: 'GPContextStatusFunc', data: 'void *') -> "void":
        """
        set_status_func(self, func, data)

        Parameters
        ----------
        func: callable function
        data: object

        """
        return _context.Context_set_status_func(self, func, data)


    def __init__(self):
        """__init__(self) -> Context"""
        _context.Context_swiginit(self, _context.new_Context())
    __swig_destroy__ = _context.delete_Context
Context.camera_autodetect = new_instancemethod(_context.Context_camera_autodetect, None, Context)
Context.set_idle_func = new_instancemethod(_context.Context_set_idle_func, None, Context)
Context.set_error_func = new_instancemethod(_context.Context_set_error_func, None, Context)
Context.set_message_func = new_instancemethod(_context.Context_set_message_func, None, Context)
Context.set_question_func = new_instancemethod(_context.Context_set_question_func, None, Context)
Context.set_cancel_func = new_instancemethod(_context.Context_set_cancel_func, None, Context)
Context.set_progress_funcs = new_instancemethod(_context.Context_set_progress_funcs, None, Context)
Context.set_status_func = new_instancemethod(_context.Context_set_status_func, None, Context)
Context_swigregister = _context.Context_swigregister
Context_swigregister(Context)


def gp_context_new() -> "GPContext *":
    """
    gp_context_new() -> Context

    Creates a new context.  

    To be used by the frontend.  

    Returns
    -------
    a GPContext.

    See also gphoto2.Context
    """
    return _context.gp_context_new()
GP_CONTEXT_FEEDBACK_OK = _context.GP_CONTEXT_FEEDBACK_OK
GP_CONTEXT_FEEDBACK_CANCEL = _context.GP_CONTEXT_FEEDBACK_CANCEL

def gp_context_set_idle_func(context: 'Context', func: 'GPContextIdleFunc', data: 'void *') -> "GPContextIdleFunc":
    """
    gp_context_set_idle_func(context, func, data)

    Parameters
    ----------
    context: gphoto2.GPContext
    func: callable function
    data: object

    """
    return _context.gp_context_set_idle_func(context, func, data)

def gp_context_set_progress_funcs(context: 'Context', start_func: 'GPContextProgressStartFunc', update_func: 'GPContextProgressUpdateFunc', stop_func: 'GPContextProgressStopFunc', data: 'void *') -> "GPContextProgressStartFunc":
    """
    gp_context_set_progress_funcs(context, start_func, update_func, stop_func, data)

    Parameters
    ----------
    context: gphoto2.GPContext
    start_func: callable function
    update_func: callable function
    stop_func: callable function
    data: object

    """
    return _context.gp_context_set_progress_funcs(context, start_func, update_func, stop_func, data)

def gp_context_set_error_func(context: 'Context', func: 'GPContextErrorFunc', data: 'void *') -> "GPContextErrorFunc":
    """
    gp_context_set_error_func(context, func, data)

    Parameters
    ----------
    context: gphoto2.GPContext
    func: callable function
    data: object

    """
    return _context.gp_context_set_error_func(context, func, data)

def gp_context_set_status_func(context: 'Context', func: 'GPContextStatusFunc', data: 'void *') -> "GPContextStatusFunc":
    """
    gp_context_set_status_func(context, func, data)

    Parameters
    ----------
    context: gphoto2.GPContext
    func: callable function
    data: object

    """
    return _context.gp_context_set_status_func(context, func, data)

def gp_context_set_question_func(context: 'Context', func: 'GPContextQuestionFunc', data: 'void *') -> "GPContextQuestionFunc":
    """
    gp_context_set_question_func(context, func, data)

    Parameters
    ----------
    context: gphoto2.GPContext
    func: callable function
    data: object

    """
    return _context.gp_context_set_question_func(context, func, data)

def gp_context_set_cancel_func(context: 'Context', func: 'GPContextCancelFunc', data: 'void *') -> "GPContextCancelFunc":
    """
    gp_context_set_cancel_func(context, func, data)

    Parameters
    ----------
    context: gphoto2.GPContext
    func: callable function
    data: object

    """
    return _context.gp_context_set_cancel_func(context, func, data)

def gp_context_set_message_func(context: 'Context', func: 'GPContextMessageFunc', data: 'void *') -> "GPContextMessageFunc":
    """
    gp_context_set_message_func(context, func, data)

    Parameters
    ----------
    context: gphoto2.GPContext
    func: callable function
    data: object

    """
    return _context.gp_context_set_message_func(context, func, data)


