from PySide6.QtCore import QObject, Slot
from PySide6.QtPrintSupport import QPrinterInfo

class Printers(QObject):
    __printers = None
    __default_printer = None
    __default_printer_name = None
    __available_printers = []

    def __init__(self):
        super().__init__()
        self.__printers = QPrinterInfo.availablePrinters()
        self.__available_printers = QPrinterInfo.availablePrinterNames()
        self.__default_printer = QPrinterInfo.defaultPrinter()
        self.__default_printer_name = QPrinterInfo.defaultPrinterName()

    @Slot(result = list)
    def getPrinters(self):
        return self.__available_printers

    @Slot(result = str)
    def getDefaultPrinter(self):
        return self.__default_printer_name
