# 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: _list.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, '_list')).lstrip('.')
        try:
            return importlib.import_module(mname)
        except ImportError:
            return importlib.import_module('_list')
    _list = 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('_list', [dirname(__file__)])
        except ImportError:
            import _list
            return _list
        try:
            _mod = imp.load_module('_list', fp, pathname, description)
        finally:
            if fp is not None:
                fp.close()
        return _mod
    _list = swig_import_helper()
    del swig_import_helper
else:
    import _list
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.context
import gphoto2.file
import gphoto2.filesys
import gphoto2.port_info_list
import gphoto2.port_log
import gphoto2.result
import gphoto2.version
import gphoto2.widget
class CameraList(object):
    """Proxy of C _CameraList struct."""

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

    def __len__(self):
        """
        __len__(self) -> int

        Parameters
        ----------
        self: struct _CameraList *

        """
        return _list.CameraList___len__(self)


    def __getitem__(self, idx):
        """
        __getitem__(self, idx) -> PyObject *

        Parameters
        ----------
        idx: int

        """
        return _list.CameraList___getitem__(self, idx)


    def count(self):
        """
        count(self) -> int

        Parameters
        ----------
        self: struct _CameraList *


        Counts the entries in the `list`.  

        Parameters
        ----------
        * `list` :  
            a CameraList  

        Returns
        -------
        a gphoto2 error code

        See also gphoto2.gp_list_count
        """
        return _list.CameraList_count(self)


    def append(self, name, value):
        """
        append(self, name, value)

        Parameters
        ----------
        name: str
        value: str


        Appends `name` and `value` to the `list`.  

        Parameters
        ----------
        * `list` :  
            a CameraList  
        * `name` :  
            the name of the entry to append  
        * `value` :  
            the value of the entry to append  

        Returns
        -------
        a gphoto2 error code

        See also gphoto2.gp_list_append
        """
        return _list.CameraList_append(self, name, value)


    def reset(self):
        """
        reset(self)

        Parameters
        ----------
        self: struct _CameraList *


        Resets the `list` and removes all entries.  

        Parameters
        ----------
        * `list` :  
            a CameraList  

        Returns
        -------
        a gphoto2 error code

        See also gphoto2.gp_list_reset
        """
        return _list.CameraList_reset(self)


    def sort(self):
        """
        sort(self)

        Parameters
        ----------
        self: struct _CameraList *


        Sorts the `list` entries with respect to the names.  

        Parameters
        ----------
        * `list` :  
            a CameraList  

        Returns
        -------
        a gphoto2 error code

        See also gphoto2.gp_list_sort
        """
        return _list.CameraList_sort(self)


    def find_by_name(self, index, name):
        """
        find_by_name(self, index, name)

        Parameters
        ----------
        index: int *
        name: str


        Retrieves the `index` of an arbitrary entry with `name`.  

        Parameters
        ----------
        * `list` :  
            a CameraList  
        * `index` :  
            pointer to the result index (may be NULL, only set if found)  
        * `name` :  
            name of the entry  

        Returns
        -------
        a gphoto2 error code: GP_OK if found.  

        No guarantees as to the speed of the search, or in what sequence the
        list is searched.

        See also gphoto2.gp_list_find_by_name
        """
        return _list.CameraList_find_by_name(self, index, name)


    def get_name(self, index):
        """
        get_name(self, index)

        Parameters
        ----------
        index: int


        Retrieves the `name` of entry with `index`.  

        Parameters
        ----------
        * `list` :  
            a CameraList  
        * `index` :  
            index of the entry  
        * `name` :  

        Returns
        -------
        a gphoto2 error code.

        See also gphoto2.gp_list_get_name
        """
        return _list.CameraList_get_name(self, index)


    def get_value(self, index):
        """
        get_value(self, index)

        Parameters
        ----------
        index: int


        Retrieves the value of entry with `index`.  

        Parameters
        ----------
        * `list` :  
            a CameraList  
        * `index` :  
            index of the entry  
        * `value` :  

        Returns
        -------
        a gphoto2 error code

        See also gphoto2.gp_list_get_value
        """
        return _list.CameraList_get_value(self, index)


    def set_name(self, index, name):
        """
        set_name(self, index, name)

        Parameters
        ----------
        index: int
        name: str


        Sets the name of an entry.  

        Parameters
        ----------
        * `list` :  
            a CameraList  
        * `index` :  
            index of entry  
        * `name` :  
            name to be set  

        Returns
        -------
        a gphoto2 error code

        See also gphoto2.gp_list_set_name
        """
        return _list.CameraList_set_name(self, index, name)


    def set_value(self, index, value):
        """
        set_value(self, index, value)

        Parameters
        ----------
        index: int
        value: str


        Sets the `value` of an entry.  

        Parameters
        ----------
        * `list` :  
            a CameraList  
        * `index` :  
            index of the entry  
        * `value` :  
            the value to be set  

        Returns
        -------
        a gphoto2 error code

        See also gphoto2.gp_list_set_value
        """
        return _list.CameraList_set_value(self, index, value)


    def populate(self, format, count):
        """
        populate(self, format, count)

        Parameters
        ----------
        format: str
        count: int


        Adds `count` entries to the list.  

        Parameters
        ----------
        * `list` :  
            a CameraList  
        * `format` :  
            the format  
        * `count` :  
            number of entries to be added to the list return a gphoto2 error
            code  

        Typically, this function is called by a camera driver when there is no
        way of retrieving the real name of a picture. In this case, when asked
        for a file list (see #CameraFilesystemListFunc), the list is populated
        with dummy names generated by this function.

        See also gphoto2.gp_list_populate
        """
        return _list.CameraList_populate(self, format, count)


    def __init__(self):
        """__init__(self) -> CameraList"""
        _list.CameraList_swiginit(self, _list.new_CameraList())
    __swig_destroy__ = _list.delete_CameraList
CameraList.__len__ = new_instancemethod(_list.CameraList___len__, None, CameraList)
CameraList.__getitem__ = new_instancemethod(_list.CameraList___getitem__, None, CameraList)
CameraList.count = new_instancemethod(_list.CameraList_count, None, CameraList)
CameraList.append = new_instancemethod(_list.CameraList_append, None, CameraList)
CameraList.reset = new_instancemethod(_list.CameraList_reset, None, CameraList)
CameraList.sort = new_instancemethod(_list.CameraList_sort, None, CameraList)
CameraList.find_by_name = new_instancemethod(_list.CameraList_find_by_name, None, CameraList)
CameraList.get_name = new_instancemethod(_list.CameraList_get_name, None, CameraList)
CameraList.get_value = new_instancemethod(_list.CameraList_get_value, None, CameraList)
CameraList.set_name = new_instancemethod(_list.CameraList_set_name, None, CameraList)
CameraList.set_value = new_instancemethod(_list.CameraList_set_value, None, CameraList)
CameraList.populate = new_instancemethod(_list.CameraList_populate, None, CameraList)
CameraList_swigregister = _list.CameraList_swigregister
CameraList_swigregister(CameraList)


def gp_list_new():
    """
    gp_list_new() -> int

    Creates a new CameraList.  

    Parameters
    ----------
    * `list` :  

    Returns
    -------
    a gphoto2 error code

    See also gphoto2.CameraList
    """
    return _list.gp_list_new()

def gp_list_count(list):
    """
    gp_list_count(list) -> int

    Parameters
    ----------
    list: gphoto2.CameraList


    Counts the entries in the `list`.  

    Parameters
    ----------
    * `list` :  
        a CameraList  

    Returns
    -------
    a gphoto2 error code

    See also gphoto2.CameraList.count
    """
    return _list.gp_list_count(list)

def gp_list_append(list, name, value):
    """
    gp_list_append(list, name, value) -> int

    Parameters
    ----------
    list: gphoto2.CameraList
    name: str
    value: str


    Appends `name` and `value` to the `list`.  

    Parameters
    ----------
    * `list` :  
        a CameraList  
    * `name` :  
        the name of the entry to append  
    * `value` :  
        the value of the entry to append  

    Returns
    -------
    a gphoto2 error code

    See also gphoto2.CameraList.append
    """
    return _list.gp_list_append(list, name, value)

def gp_list_reset(list):
    """
    gp_list_reset(list) -> int

    Parameters
    ----------
    list: gphoto2.CameraList


    Resets the `list` and removes all entries.  

    Parameters
    ----------
    * `list` :  
        a CameraList  

    Returns
    -------
    a gphoto2 error code

    See also gphoto2.CameraList.reset
    """
    return _list.gp_list_reset(list)

def gp_list_sort(list):
    """
    gp_list_sort(list) -> int

    Parameters
    ----------
    list: gphoto2.CameraList


    Sorts the `list` entries with respect to the names.  

    Parameters
    ----------
    * `list` :  
        a CameraList  

    Returns
    -------
    a gphoto2 error code

    See also gphoto2.CameraList.sort
    """
    return _list.gp_list_sort(list)

def gp_list_find_by_name(list, index, name):
    """
    gp_list_find_by_name(list, index, name) -> int

    Parameters
    ----------
    list: gphoto2.CameraList
    index: int *
    name: str


    Retrieves the `index` of an arbitrary entry with `name`.  

    Parameters
    ----------
    * `list` :  
        a CameraList  
    * `index` :  
        pointer to the result index (may be NULL, only set if found)  
    * `name` :  
        name of the entry  

    Returns
    -------
    a gphoto2 error code: GP_OK if found.  

    No guarantees as to the speed of the search, or in what sequence the
    list is searched.

    See also gphoto2.CameraList.find_by_name
    """
    return _list.gp_list_find_by_name(list, index, name)

def gp_list_get_name(list, index):
    """
    gp_list_get_name(list, index) -> int

    Parameters
    ----------
    list: gphoto2.CameraList
    index: int


    Retrieves the `name` of entry with `index`.  

    Parameters
    ----------
    * `list` :  
        a CameraList  
    * `index` :  
        index of the entry  
    * `name` :  

    Returns
    -------
    a gphoto2 error code.

    See also gphoto2.CameraList.get_name
    """
    return _list.gp_list_get_name(list, index)

def gp_list_get_value(list, index):
    """
    gp_list_get_value(list, index) -> int

    Parameters
    ----------
    list: gphoto2.CameraList
    index: int


    Retrieves the value of entry with `index`.  

    Parameters
    ----------
    * `list` :  
        a CameraList  
    * `index` :  
        index of the entry  
    * `value` :  

    Returns
    -------
    a gphoto2 error code

    See also gphoto2.CameraList.get_value
    """
    return _list.gp_list_get_value(list, index)

def gp_list_set_name(list, index, name):
    """
    gp_list_set_name(list, index, name) -> int

    Parameters
    ----------
    list: gphoto2.CameraList
    index: int
    name: str


    Sets the name of an entry.  

    Parameters
    ----------
    * `list` :  
        a CameraList  
    * `index` :  
        index of entry  
    * `name` :  
        name to be set  

    Returns
    -------
    a gphoto2 error code

    See also gphoto2.CameraList.set_name
    """
    return _list.gp_list_set_name(list, index, name)

def gp_list_set_value(list, index, value):
    """
    gp_list_set_value(list, index, value) -> int

    Parameters
    ----------
    list: gphoto2.CameraList
    index: int
    value: str


    Sets the `value` of an entry.  

    Parameters
    ----------
    * `list` :  
        a CameraList  
    * `index` :  
        index of the entry  
    * `value` :  
        the value to be set  

    Returns
    -------
    a gphoto2 error code

    See also gphoto2.CameraList.set_value
    """
    return _list.gp_list_set_value(list, index, value)

def gp_list_populate(list, format, count):
    """
    gp_list_populate(list, format, count) -> int

    Parameters
    ----------
    list: gphoto2.CameraList
    format: str
    count: int


    Adds `count` entries to the list.  

    Parameters
    ----------
    * `list` :  
        a CameraList  
    * `format` :  
        the format  
    * `count` :  
        number of entries to be added to the list return a gphoto2 error
        code  

    Typically, this function is called by a camera driver when there is no
    way of retrieving the real name of a picture. In this case, when asked
    for a file list (see #CameraFilesystemListFunc), the list is populated
    with dummy names generated by this function.

    See also gphoto2.CameraList.populate
    """
    return _list.gp_list_populate(list, format, count)


