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


import json



from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
    raise RuntimeError("Python 2.7 or later required")

# Import the low-level C/C++ module
if __package__ or "." in __name__:
    from . import _verovio
else:
    import _verovio

try:
    import builtins as __builtin__
except ImportError:
    import __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 == "thisown":
            self.this.own(value)
        elif name == "this":
            set(self, name, 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


def _swig_add_metaclass(metaclass):
    """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
    def wrapper(cls):
        return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
    return wrapper


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


class toolkit(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, initFont: "bool"=True):
        _verovio.toolkit_swiginit(self, _verovio.new_toolkit(initFont))
    __swig_destroy__ = _verovio.delete_toolkit

    def getID(self) -> "std::string":
        return _verovio.toolkit_getID(self)

    def getResourcePath(self) -> "std::string":
        return _verovio.toolkit_getResourcePath(self)

    def setResourcePath(self, path: "std::string const &") -> "bool":
        return _verovio.toolkit_setResourcePath(self, path)

    def getLog(self) -> "std::string":
        return _verovio.toolkit_getLog(self)

    def getVersion(self) -> "std::string":
        return _verovio.toolkit_getVersion(self)

    def resetXmlIdSeed(self, seed: "int") -> "void":
        return _verovio.toolkit_resetXmlIdSeed(self, seed)

    def loadFile(self, filename: "std::string const &") -> "bool":
        return _verovio.toolkit_loadFile(self, filename)

    def loadData(self, data: "std::string const &") -> "bool":
        return _verovio.toolkit_loadData(self, data)

    def loadZipDataBase64(self, data: "std::string const &") -> "bool":
        return _verovio.toolkit_loadZipDataBase64(self, data)

    def loadZipDataBuffer(self, data: "unsigned char const *", length: "int") -> "bool":
        return _verovio.toolkit_loadZipDataBuffer(self, data, length)

    def validatePAEFile(self, filename: "std::string const &") -> "std::string":
        return _verovio.toolkit_validatePAEFile(self, filename)

    def validatePAE(toolkit, data):
        if isinstance(data, dict):
            data = json.dumps(data);
        return json.loads(_verovio.toolkit_validatePAE(toolkit, data))



    def getPageCount(self) -> "int":
        return _verovio.toolkit_getPageCount(self)

    def getOptions(toolkit):
        return json.loads(_verovio.toolkit_getOptions(toolkit))



    def getDefaultOptions(toolkit):
        return json.loads(_verovio.toolkit_getDefaultOptions(toolkit))



    def getAvailableOptions(toolkit):
        return json.loads(_verovio.toolkit_getAvailableOptions(toolkit))



    def setOptions(toolkit, json_options):
        return _verovio.toolkit_setOptions(toolkit, json.dumps(json_options))



    def resetOptions(self) -> "void":
        return _verovio.toolkit_resetOptions(self)

    def setScale(self, scale: "int") -> "bool":
        return _verovio.toolkit_setScale(self, scale)

    def getScale(self) -> "int":
        return _verovio.toolkit_getScale(self)

    def setOutputTo(self, outputTo: "std::string const &") -> "bool":
        return _verovio.toolkit_setOutputTo(self, outputTo)

    def select(toolkit, selection):
        return _verovio.toolkit_select(toolkit, json.dumps(selection))



    def edit(toolkit, editor_action):
        return _verovio.toolkit_edit(toolkit, json.dumps(editor_action))



    def editInfo(toolkit):
        return json.loads(_verovio.toolkit_editInfo(toolkit))



    def renderData(toolkit, data, options):
        return _verovio.toolkit_renderData(toolkit, data, json.dumps(options))



    def renderToSVG(self, pageNo: "int"=1, xmlDeclaration: "bool"=False) -> "std::string":
        return _verovio.toolkit_renderToSVG(self, pageNo, xmlDeclaration)

    def renderToSVGFile(self, filename: "std::string const &", pageNo: "int"=1) -> "bool":
        return _verovio.toolkit_renderToSVGFile(self, filename, pageNo)

    def renderToMIDI(self) -> "std::string":
        return _verovio.toolkit_renderToMIDI(self)

    def renderToMIDIFile(self, filename: "std::string const &") -> "bool":
        return _verovio.toolkit_renderToMIDIFile(self, filename)

    def renderToPAE(self) -> "std::string":
        return _verovio.toolkit_renderToPAE(self)

    def renderToPAEFile(self, filename: "std::string const &") -> "bool":
        return _verovio.toolkit_renderToPAEFile(self, filename)

    def renderToTimemap(toolkit, options = None):
        if options == None:
            options = {}
        return json.loads(_verovio.toolkit_renderToTimemap(toolkit, json.dumps(options)))



    def renderToTimemapFile(toolkit, filename, options = None):
        if options == None:
            options = {}
        return _verovio.toolkit_renderToTimemapFile(toolkit, filename, json.dumps(options))



    def convertMEIToHumdrum(self, meiData: "std::string const &") -> "std::string":
        return _verovio.toolkit_convertMEIToHumdrum(self, meiData)

    def convertHumdrumToHumdrum(self, humdrumData: "std::string const &") -> "std::string":
        return _verovio.toolkit_convertHumdrumToHumdrum(self, humdrumData)

    def convertHumdrumToMIDI(self, humdrumData: "std::string const &") -> "std::string":
        return _verovio.toolkit_convertHumdrumToMIDI(self, humdrumData)

    def getHumdrumFile(self, filename: "std::string const &") -> "bool":
        return _verovio.toolkit_getHumdrumFile(self, filename)

    def getMEI(toolkit, options = None):
        if options == None:
            options = {}
        return _verovio.toolkit_getMEI(toolkit, json.dumps(options))



    def saveFile(toolkit, filename, options = None):
        if options == None:
            options = {}
        return _verovio.toolkit_saveFile(toolkit, filename, json.dumps(options))



    def getDescriptiveFeatures(toolkit, options):
        return json.loads(_verovio.toolkit_getDescriptiveFeatures(toolkit, json.dumps(options)))



    def getElementsAtTime(toolkit, millisec):
        return json.loads(_verovio.toolkit_getElementsAtTime(toolkit, millisec))



    def getPageWithElement(self, xmlId: "std::string const &") -> "int":
        return _verovio.toolkit_getPageWithElement(self, xmlId)

    def getElementAttr(toolkit, xml_id):
        return json.loads(_verovio.toolkit_getElementAttr(toolkit, xml_id))



    def getNotatedIdForElement(self, xmlId: "std::string const &") -> "std::string":
        return _verovio.toolkit_getNotatedIdForElement(self, xmlId)

    def getExpansionIdsForElement(toolkit, xml_id):
        return json.loads(_verovio.toolkit_getExpansionIdsForElement(toolkit, xml_id))



    def getTimeForElement(self, xmlId: "std::string const &") -> "int":
        return _verovio.toolkit_getTimeForElement(self, xmlId)

    def getMIDIValuesForElement(toolkit, xml_id):
        return json.loads(_verovio.toolkit_getMIDIValuesForElement(toolkit, xml_id))



    def getTimesForElement(toolkit, xml_id):
        return json.loads(_verovio.toolkit_getTimesForElement(toolkit, xml_id))



    def redoLayout(toolkit, options = None):
        if options == None:
            options = {}
        return _verovio.toolkit_redoLayout(toolkit, json.dumps(options))



    def redoPagePitchPosLayout(self) -> "void":
        return _verovio.toolkit_redoPagePitchPosLayout(self)

    def skipLayoutOnLoad(self, value: "bool") -> "void":
        return _verovio.toolkit_skipLayoutOnLoad(self, value)

    def renderToDeviceContext(self, pageNo: "int", deviceContext: "DeviceContext *") -> "bool":
        return _verovio.toolkit_renderToDeviceContext(self, pageNo, deviceContext)

    def getHumdrum(self, *args) -> "void":
        return _verovio.toolkit_getHumdrum(self, *args)

    def setHumdrumBuffer(self, contents: "char const *") -> "void":
        return _verovio.toolkit_setHumdrumBuffer(self, contents)

    def getHumdrumBuffer(self) -> "char const *":
        return _verovio.toolkit_getHumdrumBuffer(self)

    def clearHumdrumBuffer(self) -> "void":
        return _verovio.toolkit_clearHumdrumBuffer(self)

    def setInputFrom(self, *args) -> "void":
        return _verovio.toolkit_setInputFrom(self, *args)

    def getInputFrom(self) -> "int":
        return _verovio.toolkit_getInputFrom(self)

    def getOutputTo(self) -> "int":
        return _verovio.toolkit_getOutputTo(self)

    def initClock(self) -> "void":
        return _verovio.toolkit_initClock(self)

    def resetClock(self) -> "void":
        return _verovio.toolkit_resetClock(self)

    def getRuntimeInSeconds(self) -> "double":
        return _verovio.toolkit_getRuntimeInSeconds(self)

    def logRuntime(self) -> "void":
        return _verovio.toolkit_logRuntime(self)

# Register toolkit in _verovio:
_verovio.toolkit_swigregister(toolkit)

UNKNOWN = _verovio.UNKNOWN
AUTO = _verovio.AUTO
MEI = _verovio.MEI
HUMDRUM = _verovio.HUMDRUM
HUMMEI = _verovio.HUMMEI
HUMMIDI = _verovio.HUMMIDI
PAE = _verovio.PAE
ABC = _verovio.ABC
DARMS = _verovio.DARMS
MUSICXML = _verovio.MUSICXML
MUSICXMLHUM = _verovio.MUSICXMLHUM
MEIHUM = _verovio.MEIHUM
MUSEDATAHUM = _verovio.MUSEDATAHUM
ESAC = _verovio.ESAC
MIDI = _verovio.MIDI
TIMEMAP = _verovio.TIMEMAP
LOG_OFF = _verovio.LOG_OFF
LOG_ERROR = _verovio.LOG_ERROR
LOG_WARNING = _verovio.LOG_WARNING
LOG_INFO = _verovio.LOG_INFO
LOG_DEBUG = _verovio.LOG_DEBUG

def setDefaultResourcePath(path: "std::string const &") -> "void":
    return _verovio.setDefaultResourcePath(path)

def enableLog(level: "vrv::LogLevel") -> "void":
    return _verovio.enableLog(level)

def enableLogToBuffer(value: "bool") -> "void":
    return _verovio.enableLogToBuffer(value)


