# Path: awesometts/gui/common.py
# class Checkbox(QtWidgets.QCheckBox):
#     """Provides a checkbox with a better constructor."""
# 
#     def __init__(self, text=None, object_name=None, parent=None):
#         super(Checkbox, self).__init__(text, parent)
#         self.setObjectName(object_name)
# 
# class HTML(QtWidgets.QLabel):
#     """Label with HTML enabled."""
# 
#     def __init__(self, *args, **kwargs):
#         super(HTML, self).__init__(*args, **kwargs)
#         self.setTextFormat(QtCore.Qt.RichText)


import re
from PyQt5 import QtCore, QtWidgets
from .common import Checkbox, HTML
            *args, **kwargs
        )


class _Delegate(QtWidgets.QItemDelegate):
    """Abstract delegate view for use throughout AwesomeTTS."""

    def sizeHint(self,            # pylint:disable=invalid-name
                 option, index):  # pylint:disable=unused-argument
        """Always return the same size."""
        return self.sizeHint.SIZE

    sizeHint.SIZE = QtCore.QSize(-1, 40)


class _SubRuleDelegate(_Delegate):
    """Item view specifically for a substitution rule."""

    __slots__ = ['_sul_compiler']

    def __init__(self, sul_compiler, *args, **kwargs):
        super(_SubRuleDelegate, self).__init__(*args, **kwargs)
        self._sul_compiler = sul_compiler

    def createEditor(self, parent,    # pylint:disable=C0103
                     option, index):  # pylint:disable=W0613
        """Return a panel to change rule values."""

        edits = QtWidgets.QHBoxLayout()
        edits.addWidget(QtWidgets.QLineEdit())

# Path: awesometts/gui/common.py
# class Checkbox(QtWidgets.QCheckBox):
#     """Provides a checkbox with a better constructor."""
# 
#     def __init__(self, text=None, object_name=None, parent=None):
#         super(Checkbox, self).__init__(text, parent)
#         self.setObjectName(object_name)
# 
# class HTML(QtWidgets.QLabel):
#     """Label with HTML enabled."""
# 
#     def __init__(self, *args, **kwargs):
#         super(HTML, self).__init__(*args, **kwargs)
#         self.setTextFormat(QtCore.Qt.RichText)


# Path: awesometts/gui/listviews.py
import re
from PyQt5 import QtCore, QtWidgets
from .common import Checkbox, HTML

            *args, **kwargs
        )


class _Delegate(QtWidgets.QItemDelegate):
    """Abstract delegate view for use throughout AwesomeTTS."""

    def sizeHint(self,            # pylint:disable=invalid-name
                 option, index):  # pylint:disable=unused-argument
        """Always return the same size."""
        return self.sizeHint.SIZE

    sizeHint.SIZE = QtCore.QSize(-1, 40)


class _SubRuleDelegate(_Delegate):
    """Item view specifically for a substitution rule."""

    __slots__ = ['_sul_compiler']

    def __init__(self, sul_compiler, *args, **kwargs):
        super(_SubRuleDelegate, self).__init__(*args, **kwargs)
        self._sul_compiler = sul_compiler

    def createEditor(self, parent,    # pylint:disable=C0103
                     option, index):  # pylint:disable=W0613
        """Return a panel to change rule values."""

        edits = QtWidgets.QHBoxLayout()
        edits.addWidget(QtWidgets.QLineEdit())

        edits.addWidget(HTML("&nbsp;<strong>&rarr;</strong>&nbsp;"))