# The PEP 484 type hints stub file for the QtScript module.
#
# Generated by SIP 4.19
#
# Copyright (c) 2016 Riverbank Computing Limited <info@riverbankcomputing.com>
# 
# This file is part of PyQt4.
# 
# This file may be used under the terms of the GNU General Public License
# version 3.0 as published by the Free Software Foundation and appearing in
# the file LICENSE included in the packaging of this file.  Please review the
# following information to ensure the GNU General Public License version 3.0
# requirements will be met: http://www.gnu.org/copyleft/gpl.html.
# 
# If you do not wish to use this file under the terms of the GPL version 3.0
# then you may purchase a commercial license.  For more information contact
# info@riverbankcomputing.com.
# 
# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.


import typing
import sip

from PyQt4 import QtCore

# Support for QDate, QDateTime and QTime.
import datetime

# Convenient type aliases.
PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]

# Support for old-style signals and slots.
QT_SIGNAL = str
QT_SLOT = str


class QScriptClass(sip.simplewrapper):

    class Extension(int): ...
    Callable = ... # type: 'QScriptClass.Extension'
    HasInstance = ... # type: 'QScriptClass.Extension'

    class QueryFlag(int): ...
    HandlesReadAccess = ... # type: 'QScriptClass.QueryFlag'
    HandlesWriteAccess = ... # type: 'QScriptClass.QueryFlag'

    class QueryFlags(sip.simplewrapper):

        @typing.overload
        def __init__(self) -> None: ...
        @typing.overload
        def __init__(self, f: typing.Union['QScriptClass.QueryFlags', 'QScriptClass.QueryFlag']) -> None: ...
        @typing.overload
        def __init__(self, a0: 'QScriptClass.QueryFlags') -> None: ...

        def __bool__(self) -> int: ...
        def __invert__(self) -> 'QScriptClass.QueryFlags': ...
        def __int__(self) -> int: ...

    def __init__(self, engine: 'QScriptEngine') -> None: ...

    def extension(self, extension: 'QScriptClass.Extension', argument: typing.Any = ...) -> typing.Any: ...
    def supportsExtension(self, extension: 'QScriptClass.Extension') -> bool: ...
    def name(self) -> str: ...
    def prototype(self) -> 'QScriptValue': ...
    def newIterator(self, object: 'QScriptValue') -> 'QScriptClassPropertyIterator': ...
    def propertyFlags(self, object: 'QScriptValue', name: 'QScriptString', id: int) -> 'QScriptValue.PropertyFlags': ...
    def setProperty(self, object: 'QScriptValue', name: 'QScriptString', id: int, value: 'QScriptValue') -> None: ...
    def property(self, object: 'QScriptValue', name: 'QScriptString', id: int) -> 'QScriptValue': ...
    def queryProperty(self, object: 'QScriptValue', name: 'QScriptString', flags: 'QScriptClass.QueryFlags') -> typing.Tuple['QScriptClass.QueryFlags', int]: ...
    def engine(self) -> 'QScriptEngine': ...


class QScriptClassPropertyIterator(sip.simplewrapper):

    def __init__(self, object: 'QScriptValue') -> None: ...

    def flags(self) -> 'QScriptValue.PropertyFlags': ...
    def id(self) -> int: ...
    def name(self) -> 'QScriptString': ...
    def toBack(self) -> None: ...
    def toFront(self) -> None: ...
    def previous(self) -> None: ...
    def hasPrevious(self) -> bool: ...
    def next(self) -> None: ...
    def hasNext(self) -> bool: ...
    def object(self) -> 'QScriptValue': ...


class QScriptContext(sip.simplewrapper):

    class Error(int): ...
    UnknownError = ... # type: 'QScriptContext.Error'
    ReferenceError = ... # type: 'QScriptContext.Error'
    SyntaxError = ... # type: 'QScriptContext.Error'
    TypeError = ... # type: 'QScriptContext.Error'
    RangeError = ... # type: 'QScriptContext.Error'
    URIError = ... # type: 'QScriptContext.Error'

    class ExecutionState(int): ...
    NormalState = ... # type: 'QScriptContext.ExecutionState'
    ExceptionState = ... # type: 'QScriptContext.ExecutionState'

    def toString(self) -> str: ...
    @typing.overload
    def throwError(self, error: 'QScriptContext.Error', text: str) -> 'QScriptValue': ...
    @typing.overload
    def throwError(self, text: str) -> 'QScriptValue': ...
    def throwValue(self, value: 'QScriptValue') -> 'QScriptValue': ...
    def backtrace(self) -> typing.List[str]: ...
    def isCalledAsConstructor(self) -> bool: ...
    def setThisObject(self, thisObject: 'QScriptValue') -> None: ...
    def thisObject(self) -> 'QScriptValue': ...
    def setActivationObject(self, activation: 'QScriptValue') -> None: ...
    def activationObject(self) -> 'QScriptValue': ...
    def argumentsObject(self) -> 'QScriptValue': ...
    def argument(self, index: int) -> 'QScriptValue': ...
    def argumentCount(self) -> int: ...
    def callee(self) -> 'QScriptValue': ...
    def state(self) -> 'QScriptContext.ExecutionState': ...
    def engine(self) -> 'QScriptEngine': ...
    def parentContext(self) -> 'QScriptContext': ...


class QScriptContextInfo(sip.simplewrapper):

    class FunctionType(int): ...
    ScriptFunction = ... # type: 'QScriptContextInfo.FunctionType'
    QtFunction = ... # type: 'QScriptContextInfo.FunctionType'
    QtPropertyFunction = ... # type: 'QScriptContextInfo.FunctionType'
    NativeFunction = ... # type: 'QScriptContextInfo.FunctionType'

    @typing.overload
    def __init__(self, context: QScriptContext) -> None: ...
    @typing.overload
    def __init__(self, other: 'QScriptContextInfo') -> None: ...
    @typing.overload
    def __init__(self) -> None: ...

    def functionMetaIndex(self) -> int: ...
    def functionEndLineNumber(self) -> int: ...
    def functionStartLineNumber(self) -> int: ...
    def functionParameterNames(self) -> typing.List[str]: ...
    def functionType(self) -> 'QScriptContextInfo.FunctionType': ...
    def functionName(self) -> str: ...
    def columnNumber(self) -> int: ...
    def lineNumber(self) -> int: ...
    def fileName(self) -> str: ...
    def scriptId(self) -> int: ...
    def isNull(self) -> bool: ...


class QScriptEngine(QtCore.QObject):

    class QObjectWrapOption(int): ...
    ExcludeChildObjects = ... # type: 'QScriptEngine.QObjectWrapOption'
    ExcludeSuperClassMethods = ... # type: 'QScriptEngine.QObjectWrapOption'
    ExcludeSuperClassProperties = ... # type: 'QScriptEngine.QObjectWrapOption'
    AutoCreateDynamicProperties = ... # type: 'QScriptEngine.QObjectWrapOption'
    SkipMethodsInEnumeration = ... # type: 'QScriptEngine.QObjectWrapOption'
    PreferExistingWrapperObject = ... # type: 'QScriptEngine.QObjectWrapOption'
    ExcludeSuperClassContents = ... # type: 'QScriptEngine.QObjectWrapOption'
    ExcludeDeleteLater = ... # type: 'QScriptEngine.QObjectWrapOption'
    ExcludeSlots = ... # type: 'QScriptEngine.QObjectWrapOption'

    class ValueOwnership(int): ...
    QtOwnership = ... # type: 'QScriptEngine.ValueOwnership'
    ScriptOwnership = ... # type: 'QScriptEngine.ValueOwnership'
    AutoOwnership = ... # type: 'QScriptEngine.ValueOwnership'

    class QObjectWrapOptions(sip.simplewrapper):

        @typing.overload
        def __init__(self) -> None: ...
        @typing.overload
        def __init__(self, f: typing.Union['QScriptEngine.QObjectWrapOptions', 'QScriptEngine.QObjectWrapOption']) -> None: ...
        @typing.overload
        def __init__(self, a0: 'QScriptEngine.QObjectWrapOptions') -> None: ...

        def __bool__(self) -> int: ...
        def __invert__(self) -> 'QScriptEngine.QObjectWrapOptions': ...
        def __int__(self) -> int: ...

    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, parent: QtCore.QObject) -> None: ...

    def reportAdditionalMemoryCost(self, size: int) -> None: ...
    def signalHandlerException(self, exception: 'QScriptValue') -> None: ...
    def toObject(self, value: 'QScriptValue') -> 'QScriptValue': ...
    def installTranslatorFunctions(self, object: 'QScriptValue' = ...) -> None: ...
    @staticmethod
    def checkSyntax(program: str) -> 'QScriptSyntaxCheckResult': ...
    def setGlobalObject(self, object: 'QScriptValue') -> None: ...
    def toStringHandle(self, str: str) -> 'QScriptString': ...
    def agent(self) -> 'QScriptEngineAgent': ...
    def setAgent(self, agent: 'QScriptEngineAgent') -> None: ...
    def importedExtensions(self) -> typing.List[str]: ...
    def availableExtensions(self) -> typing.List[str]: ...
    def clearExceptions(self) -> None: ...
    def abortEvaluation(self, result: 'QScriptValue' = ...) -> None: ...
    def isEvaluating(self) -> bool: ...
    def processEventsInterval(self) -> int: ...
    def setProcessEventsInterval(self, interval: int) -> None: ...
    def collectGarbage(self) -> None: ...
    def importExtension(self, extension: str) -> 'QScriptValue': ...
    def setDefaultPrototype(self, metaTypeId: int, prototype: 'QScriptValue') -> None: ...
    def defaultPrototype(self, metaTypeId: int) -> 'QScriptValue': ...
    def newQMetaObject(self, metaObject: QtCore.QMetaObject, ctor: 'QScriptValue' = ...) -> 'QScriptValue': ...
    @typing.overload
    def newQObject(self, object: QtCore.QObject, ownership: 'QScriptEngine.ValueOwnership' = ..., options: 'QScriptEngine.QObjectWrapOptions' = ...) -> 'QScriptValue': ...
    @typing.overload
    def newQObject(self, scriptObject: 'QScriptValue', qtObject: QtCore.QObject, ownership: 'QScriptEngine.ValueOwnership' = ..., options: 'QScriptEngine.QObjectWrapOptions' = ...) -> 'QScriptValue': ...
    @typing.overload
    def newDate(self, value: float) -> 'QScriptValue': ...
    @typing.overload
    def newDate(self, value: typing.Union[QtCore.QDateTime, datetime.datetime]) -> 'QScriptValue': ...
    def newArray(self, length: int = ...) -> 'QScriptValue': ...
    @typing.overload
    def newObject(self) -> 'QScriptValue': ...
    @typing.overload
    def newObject(self, scriptClass: QScriptClass, data: 'QScriptValue' = ...) -> 'QScriptValue': ...
    @typing.overload
    def newRegExp(self, regexp: QtCore.QRegExp) -> 'QScriptValue': ...
    @typing.overload
    def newRegExp(self, pattern: str, flags: str) -> 'QScriptValue': ...
    @typing.overload
    def newVariant(self, value: typing.Any) -> 'QScriptValue': ...
    @typing.overload
    def newVariant(self, object: 'QScriptValue', value: typing.Any) -> 'QScriptValue': ...
    @typing.overload
    def newFunction(self, signature: typing.Callable[[], 'QScriptValue'], length: int = ...) -> 'QScriptValue': ...
    @typing.overload
    def newFunction(self, signature: typing.Callable[[], 'QScriptValue'], prototype: 'QScriptValue', length: int = ...) -> 'QScriptValue': ...
    def undefinedValue(self) -> 'QScriptValue': ...
    def nullValue(self) -> 'QScriptValue': ...
    def uncaughtExceptionLineNumber(self) -> int: ...
    def uncaughtException(self) -> 'QScriptValue': ...
    def uncaughtExceptionBacktrace(self) -> typing.List[str]: ...
    def hasUncaughtException(self) -> bool: ...
    def evaluate(self, program: str, fileName: str = ..., lineNumber: int = ...) -> 'QScriptValue': ...
    def canEvaluate(self, program: str) -> bool: ...
    def popContext(self) -> None: ...
    def pushContext(self) -> QScriptContext: ...
    def currentContext(self) -> QScriptContext: ...
    def globalObject(self) -> 'QScriptValue': ...


class QScriptSyntaxCheckResult(sip.simplewrapper):

    class State(int): ...
    Error = ... # type: 'QScriptSyntaxCheckResult.State'
    Intermediate = ... # type: 'QScriptSyntaxCheckResult.State'
    Valid = ... # type: 'QScriptSyntaxCheckResult.State'

    def __init__(self, other: 'QScriptSyntaxCheckResult') -> None: ...

    def errorMessage(self) -> str: ...
    def errorColumnNumber(self) -> int: ...
    def errorLineNumber(self) -> int: ...
    def state(self) -> 'QScriptSyntaxCheckResult.State': ...


class QScriptEngineAgent(sip.wrapper):

    class Extension(int): ...
    DebuggerInvocationRequest = ... # type: 'QScriptEngineAgent.Extension'

    def __init__(self, engine: QScriptEngine) -> None: ...

    def engine(self) -> QScriptEngine: ...
    def extension(self, extension: 'QScriptEngineAgent.Extension', argument: typing.Any = ...) -> typing.Any: ...
    def supportsExtension(self, extension: 'QScriptEngineAgent.Extension') -> bool: ...
    def exceptionCatch(self, scriptId: int, exception: 'QScriptValue') -> None: ...
    def exceptionThrow(self, scriptId: int, exception: 'QScriptValue', hasHandler: bool) -> None: ...
    def positionChange(self, scriptId: int, lineNumber: int, columnNumber: int) -> None: ...
    def functionExit(self, scriptId: int, returnValue: 'QScriptValue') -> None: ...
    def functionEntry(self, scriptId: int) -> None: ...
    def contextPop(self) -> None: ...
    def contextPush(self) -> None: ...
    def scriptUnload(self, id: int) -> None: ...
    def scriptLoad(self, id: int, program: str, fileName: str, baseLineNumber: int) -> None: ...


class QScriptString(sip.simplewrapper):

    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, other: 'QScriptString') -> None: ...

    def toArrayIndex(self) -> typing.Tuple[int, bool]: ...
    def toString(self) -> str: ...
    def isValid(self) -> bool: ...
    def __hash__(self) -> int: ...


class QScriptValue(sip.simplewrapper):

    class SpecialValue(int): ...
    NullValue = ... # type: 'QScriptValue.SpecialValue'
    UndefinedValue = ... # type: 'QScriptValue.SpecialValue'

    class PropertyFlag(int): ...
    ReadOnly = ... # type: 'QScriptValue.PropertyFlag'
    Undeletable = ... # type: 'QScriptValue.PropertyFlag'
    SkipInEnumeration = ... # type: 'QScriptValue.PropertyFlag'
    PropertyGetter = ... # type: 'QScriptValue.PropertyFlag'
    PropertySetter = ... # type: 'QScriptValue.PropertyFlag'
    QObjectMember = ... # type: 'QScriptValue.PropertyFlag'
    KeepExistingFlags = ... # type: 'QScriptValue.PropertyFlag'
    UserRange = ... # type: 'QScriptValue.PropertyFlag'

    class ResolveFlag(int): ...
    ResolveLocal = ... # type: 'QScriptValue.ResolveFlag'
    ResolvePrototype = ... # type: 'QScriptValue.ResolveFlag'
    ResolveScope = ... # type: 'QScriptValue.ResolveFlag'
    ResolveFull = ... # type: 'QScriptValue.ResolveFlag'

    class ResolveFlags(sip.simplewrapper):

        @typing.overload
        def __init__(self) -> None: ...
        @typing.overload
        def __init__(self, f: typing.Union['QScriptValue.ResolveFlags', 'QScriptValue.ResolveFlag']) -> None: ...
        @typing.overload
        def __init__(self, a0: 'QScriptValue.ResolveFlags') -> None: ...

        def __bool__(self) -> int: ...
        def __invert__(self) -> 'QScriptValue.ResolveFlags': ...
        def __int__(self) -> int: ...

    class PropertyFlags(sip.simplewrapper):

        @typing.overload
        def __init__(self) -> None: ...
        @typing.overload
        def __init__(self, f: typing.Union['QScriptValue.PropertyFlags', 'QScriptValue.PropertyFlag']) -> None: ...
        @typing.overload
        def __init__(self, a0: 'QScriptValue.PropertyFlags') -> None: ...

        def __bool__(self) -> int: ...
        def __invert__(self) -> 'QScriptValue.PropertyFlags': ...
        def __int__(self) -> int: ...

    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, other: 'QScriptValue') -> None: ...
    @typing.overload
    def __init__(self, value: 'QScriptValue.SpecialValue') -> None: ...
    @typing.overload
    def __init__(self, engine: QScriptEngine, val: 'QScriptValue.SpecialValue') -> None: ...
    @typing.overload
    def __init__(self, value: bool) -> None: ...
    @typing.overload
    def __init__(self, engine: QScriptEngine, val: bool) -> None: ...
    @typing.overload
    def __init__(self, value: int) -> None: ...
    @typing.overload
    def __init__(self, engine: QScriptEngine, val: int) -> None: ...
    @typing.overload
    def __init__(self, value: float) -> None: ...
    @typing.overload
    def __init__(self, engine: QScriptEngine, val: float) -> None: ...
    @typing.overload
    def __init__(self, value: str) -> None: ...
    @typing.overload
    def __init__(self, engine: QScriptEngine, val: str) -> None: ...

    def setScriptClass(self, scriptClass: QScriptClass) -> None: ...
    def scriptClass(self) -> QScriptClass: ...
    def setData(self, data: 'QScriptValue') -> None: ...
    def data(self) -> 'QScriptValue': ...
    @typing.overload
    def construct(self, args: typing.Any = ...) -> 'QScriptValue': ...
    @typing.overload
    def construct(self, arguments: 'QScriptValue') -> 'QScriptValue': ...
    @typing.overload
    def call(self, thisObject: 'QScriptValue' = ..., args: typing.Any = ...) -> 'QScriptValue': ...
    @typing.overload
    def call(self, thisObject: 'QScriptValue', arguments: 'QScriptValue') -> 'QScriptValue': ...
    @typing.overload
    def propertyFlags(self, name: str, mode: 'QScriptValue.ResolveFlags' = ...) -> 'QScriptValue.PropertyFlags': ...
    @typing.overload
    def propertyFlags(self, name: QScriptString, mode: 'QScriptValue.ResolveFlags' = ...) -> 'QScriptValue.PropertyFlags': ...
    @typing.overload
    def setProperty(self, name: str, value: 'QScriptValue', flags: 'QScriptValue.PropertyFlags' = ...) -> None: ...
    @typing.overload
    def setProperty(self, name: QScriptString, value: 'QScriptValue', flags: 'QScriptValue.PropertyFlags' = ...) -> None: ...
    @typing.overload
    def setProperty(self, arrayIndex: int, value: 'QScriptValue', flags: 'QScriptValue.PropertyFlags' = ...) -> None: ...
    @typing.overload
    def property(self, name: str, mode: 'QScriptValue.ResolveFlags' = ...) -> 'QScriptValue': ...
    @typing.overload
    def property(self, name: QScriptString, mode: 'QScriptValue.ResolveFlags' = ...) -> 'QScriptValue': ...
    @typing.overload
    def property(self, arrayIndex: int, mode: 'QScriptValue.ResolveFlags' = ...) -> 'QScriptValue': ...
    def setPrototype(self, prototype: 'QScriptValue') -> None: ...
    def prototype(self) -> 'QScriptValue': ...
    def strictlyEquals(self, other: 'QScriptValue') -> bool: ...
    def equals(self, other: 'QScriptValue') -> bool: ...
    def lessThan(self, other: 'QScriptValue') -> bool: ...
    def instanceOf(self, ctor: 'QScriptValue') -> bool: ...
    def toRegExp(self) -> QtCore.QRegExp: ...
    def toDateTime(self) -> QtCore.QDateTime: ...
    def toObject(self) -> 'QScriptValue': ...
    def toQMetaObject(self) -> QtCore.QMetaObject: ...
    def toQObject(self) -> QtCore.QObject: ...
    def toVariant(self) -> typing.Any: ...
    def toUInt16(self) -> int: ...
    def toUInt32(self) -> int: ...
    def toInt32(self) -> int: ...
    def toInteger(self) -> float: ...
    def toBoolean(self) -> bool: ...
    def toBool(self) -> bool: ...
    def toNumber(self) -> float: ...
    def toString(self) -> str: ...
    def isError(self) -> bool: ...
    def isArray(self) -> bool: ...
    def isRegExp(self) -> bool: ...
    def isDate(self) -> bool: ...
    def isObject(self) -> bool: ...
    def isQMetaObject(self) -> bool: ...
    def isQObject(self) -> bool: ...
    def isVariant(self) -> bool: ...
    def isUndefined(self) -> bool: ...
    def isString(self) -> bool: ...
    def isNull(self) -> bool: ...
    def isFunction(self) -> bool: ...
    def isNumber(self) -> bool: ...
    def isBoolean(self) -> bool: ...
    def isBool(self) -> bool: ...
    def isValid(self) -> bool: ...
    def engine(self) -> QScriptEngine: ...


class QScriptValueIterator(sip.simplewrapper):

    def __init__(self, value: QScriptValue) -> None: ...

    def scriptName(self) -> QScriptString: ...
    def toBack(self) -> None: ...
    def toFront(self) -> None: ...
    def remove(self) -> None: ...
    def flags(self) -> QScriptValue.PropertyFlags: ...
    def setValue(self, value: QScriptValue) -> None: ...
    def value(self) -> QScriptValue: ...
    def name(self) -> str: ...
    def previous(self) -> None: ...
    def hasPrevious(self) -> bool: ...
    def next(self) -> None: ...
    def hasNext(self) -> bool: ...


def qScriptDisconnect(sender: QtCore.QObject, signal: QT_SIGNAL, receiver: QScriptValue, function: QScriptValue) -> bool: ...
def qScriptConnect(sender: QtCore.QObject, signal: QT_SIGNAL, receiver: QScriptValue, function: QScriptValue) -> bool: ...
