# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
"""
This file contains the exact signatures for all functions in module
PySide6.QtSerialPort, except for defaults which are replaced by "...".
"""

# mypy: disable-error-code="override, overload-overlap"
# Module `PySide6.QtSerialPort`

import PySide6.QtSerialPort
import PySide6.QtCore

import enum
import typing
from PySide6.QtCore import Signal
from shiboken6 import Shiboken


class QIntList: ...


class QSerialPort(PySide6.QtCore.QIODevice):

    baudRateChanged          : typing.ClassVar[Signal] = ... # baudRateChanged(int,QSerialPort::Directions)
    breakEnabledChanged      : typing.ClassVar[Signal] = ... # breakEnabledChanged(bool)
    dataBitsChanged          : typing.ClassVar[Signal] = ... # dataBitsChanged(QSerialPort::DataBits)
    dataTerminalReadyChanged : typing.ClassVar[Signal] = ... # dataTerminalReadyChanged(bool)
    errorOccurred            : typing.ClassVar[Signal] = ... # errorOccurred(QSerialPort::SerialPortError)
    flowControlChanged       : typing.ClassVar[Signal] = ... # flowControlChanged(QSerialPort::FlowControl)
    parityChanged            : typing.ClassVar[Signal] = ... # parityChanged(QSerialPort::Parity)
    requestToSendChanged     : typing.ClassVar[Signal] = ... # requestToSendChanged(bool)
    settingsRestoredOnCloseChanged: typing.ClassVar[Signal] = ... # settingsRestoredOnCloseChanged(bool)
    stopBitsChanged          : typing.ClassVar[Signal] = ... # stopBitsChanged(QSerialPort::StopBits)

    class BaudRate(enum.IntEnum):

        Baud1200                  = 0x4b0
        Baud2400                  = 0x960
        Baud4800                  = 0x12c0
        Baud9600                  = 0x2580
        Baud19200                 = 0x4b00
        Baud38400                 = 0x9600
        Baud57600                 = 0xe100
        Baud115200                = 0x1c200

    class DataBits(enum.Enum):

        Data5                     = 0x5
        Data6                     = 0x6
        Data7                     = 0x7
        Data8                     = 0x8

    class Direction(enum.Flag):

        Input                     = 0x1
        Output                    = 0x2
        AllDirections             = 0x3

    class FlowControl(enum.Enum):

        NoFlowControl             = 0x0
        HardwareControl           = 0x1
        SoftwareControl           = 0x2

    class Parity(enum.Enum):

        NoParity                  = 0x0
        EvenParity                = 0x2
        OddParity                 = 0x3
        SpaceParity               = 0x4
        MarkParity                = 0x5

    class PinoutSignal(enum.Flag):

        NoSignal                  = 0x0
        DataTerminalReadySignal   = 0x4
        DataCarrierDetectSignal   = 0x8
        DataSetReadySignal        = 0x10
        RingIndicatorSignal       = 0x20
        RequestToSendSignal       = 0x40
        ClearToSendSignal         = 0x80
        SecondaryTransmittedDataSignal = 0x100
        SecondaryReceivedDataSignal = 0x200

    class SerialPortError(enum.Enum):

        NoError                   = 0x0
        DeviceNotFoundError       = 0x1
        PermissionError           = 0x2
        OpenError                 = 0x3
        WriteError                = 0x4
        ReadError                 = 0x5
        ResourceError             = 0x6
        UnsupportedOperationError = 0x7
        UnknownError              = 0x8
        TimeoutError              = 0x9
        NotOpenError              = 0xa

    class StopBits(enum.Enum):

        OneStop                   = 0x1
        TwoStop                   = 0x2
        OneAndHalfStop            = 0x3


class QSerialPortInfo(Shiboken.Object): ...


# eof
