File size: 17,875 Bytes
3bb804c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
# The PEP 484 type hints stub file for the QtPrintSupport module.
#
# Generated by SIP 6.14.0
#
# Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
# 
# This file is part of PyQt6.
# 
# 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 collections, re, typing, enum

try:
    from warnings import deprecated
except ImportError:
    pass

import PyQt6.sip

from PyQt6 import QtCore
from PyQt6 import QtGui
from PyQt6 import QtWidgets

# Support for QDate, QDateTime and QTime.
import datetime

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


class QAbstractPrintDialog(QtWidgets.QDialog):

    class PrintDialogOption(enum.Flag):
        PrintToFile = ... # type: QAbstractPrintDialog.PrintDialogOption
        PrintSelection = ... # type: QAbstractPrintDialog.PrintDialogOption
        PrintPageRange = ... # type: QAbstractPrintDialog.PrintDialogOption
        PrintCollateCopies = ... # type: QAbstractPrintDialog.PrintDialogOption
        PrintShowPageSize = ... # type: QAbstractPrintDialog.PrintDialogOption
        PrintCurrentPage = ... # type: QAbstractPrintDialog.PrintDialogOption

    class PrintRange(enum.Enum):
        AllPages = ... # type: QAbstractPrintDialog.PrintRange
        Selection = ... # type: QAbstractPrintDialog.PrintRange
        PageRange = ... # type: QAbstractPrintDialog.PrintRange
        CurrentPage = ... # type: QAbstractPrintDialog.PrintRange

    def __init__(self, printer: typing.Optional['QPrinter'], parent: typing.Optional[QtWidgets.QWidget] = ...) -> None: ...

    def setOptionTabs(self, tabs: collections.abc.Iterable[QtWidgets.QWidget]) -> None: ...
    def printer(self) -> typing.Optional['QPrinter']: ...
    def toPage(self) -> int: ...
    def fromPage(self) -> int: ...
    def setFromTo(self, fromPage: int, toPage: int) -> None: ...
    def maxPage(self) -> int: ...
    def minPage(self) -> int: ...
    def setMinMax(self, min: int, max: int) -> None: ...
    def printRange(self) -> 'QAbstractPrintDialog.PrintRange': ...
    def setPrintRange(self, range: 'QAbstractPrintDialog.PrintRange') -> None: ...


class QPageSetupDialog(QtWidgets.QDialog):

    @typing.overload
    def __init__(self, printer: typing.Optional['QPrinter'], parent: typing.Optional[QtWidgets.QWidget] = ...) -> None: ...
    @typing.overload
    def __init__(self, parent: typing.Optional[QtWidgets.QWidget] = ...) -> None: ...

    def printer(self) -> typing.Optional['QPrinter']: ...
    def done(self, result: int) -> None: ...
    @typing.overload
    def open(self) -> None: ...
    @typing.overload
    def open(self, slot: PYQT_SLOT) -> None: ...
    def exec(self) -> int: ...
    def setVisible(self, visible: bool) -> None: ...


class QPrintDialog(QAbstractPrintDialog):

    @typing.overload
    def __init__(self, printer: typing.Optional['QPrinter'], parent: typing.Optional[QtWidgets.QWidget] = ...) -> None: ...
    @typing.overload
    def __init__(self, parent: typing.Optional[QtWidgets.QWidget] = ...) -> None: ...

    accepted: typing.ClassVar[QtCore.pyqtSignal]
    @typing.overload
    def open(self) -> None: ...
    @typing.overload
    def open(self, slot: PYQT_SLOT) -> None: ...
    def setVisible(self, visible: bool) -> None: ...
    def options(self) -> QAbstractPrintDialog.PrintDialogOption: ...
    def setOptions(self, options: QAbstractPrintDialog.PrintDialogOption) -> None: ...
    def testOption(self, option: QAbstractPrintDialog.PrintDialogOption) -> bool: ...
    def setOption(self, option: QAbstractPrintDialog.PrintDialogOption, on: bool = ...) -> None: ...
    def done(self, result: int) -> None: ...
    def exec(self) -> int: ...


class QPrintEngine(PyQt6.sip.simplewrapper):

    class PrintEnginePropertyKey(enum.Enum):
        PPK_CollateCopies = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_ColorMode = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_Creator = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_DocumentName = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_FullPage = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_NumberOfCopies = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_Orientation = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_OutputFileName = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_PageOrder = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_PageRect = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_PageSize = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_PaperRect = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_PaperSource = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_PrinterName = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_PrinterProgram = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_Resolution = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_SelectionOption = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_SupportedResolutions = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_WindowsPageSize = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_FontEmbedding = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_Duplex = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_PaperSources = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_CustomPaperSize = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_PageMargins = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_PaperSize = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_CopyCount = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_SupportsMultipleCopies = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_PaperName = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_QPageSize = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_QPageMargins = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_QPageLayout = ... # type: QPrintEngine.PrintEnginePropertyKey
        PPK_CustomBase = ... # type: QPrintEngine.PrintEnginePropertyKey

    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, a0: 'QPrintEngine') -> None: ...

    def printerState(self) -> 'QPrinter.PrinterState': ...
    def metric(self, a0: QtGui.QPaintDevice.PaintDeviceMetric) -> int: ...
    def abort(self) -> bool: ...
    def newPage(self) -> bool: ...
    def property(self, key: 'QPrintEngine.PrintEnginePropertyKey') -> typing.Any: ...
    def setProperty(self, key: 'QPrintEngine.PrintEnginePropertyKey', value: typing.Any) -> None: ...


class QPrinter(QtGui.QPagedPaintDevice):

    class DuplexMode(enum.Enum):
        DuplexNone = ... # type: QPrinter.DuplexMode
        DuplexAuto = ... # type: QPrinter.DuplexMode
        DuplexLongSide = ... # type: QPrinter.DuplexMode
        DuplexShortSide = ... # type: QPrinter.DuplexMode

    class Unit(enum.Enum):
        Millimeter = ... # type: QPrinter.Unit
        Point = ... # type: QPrinter.Unit
        Inch = ... # type: QPrinter.Unit
        Pica = ... # type: QPrinter.Unit
        Didot = ... # type: QPrinter.Unit
        Cicero = ... # type: QPrinter.Unit
        DevicePixel = ... # type: QPrinter.Unit

    class PrintRange(enum.Enum):
        AllPages = ... # type: QPrinter.PrintRange
        Selection = ... # type: QPrinter.PrintRange
        PageRange = ... # type: QPrinter.PrintRange
        CurrentPage = ... # type: QPrinter.PrintRange

    class OutputFormat(enum.Enum):
        NativeFormat = ... # type: QPrinter.OutputFormat
        PdfFormat = ... # type: QPrinter.OutputFormat

    class PrinterState(enum.Enum):
        Idle = ... # type: QPrinter.PrinterState
        Active = ... # type: QPrinter.PrinterState
        Aborted = ... # type: QPrinter.PrinterState
        Error = ... # type: QPrinter.PrinterState

    class PaperSource(enum.Enum):
        OnlyOne = ... # type: QPrinter.PaperSource
        Lower = ... # type: QPrinter.PaperSource
        Middle = ... # type: QPrinter.PaperSource
        Manual = ... # type: QPrinter.PaperSource
        Envelope = ... # type: QPrinter.PaperSource
        EnvelopeManual = ... # type: QPrinter.PaperSource
        Auto = ... # type: QPrinter.PaperSource
        Tractor = ... # type: QPrinter.PaperSource
        SmallFormat = ... # type: QPrinter.PaperSource
        LargeFormat = ... # type: QPrinter.PaperSource
        LargeCapacity = ... # type: QPrinter.PaperSource
        Cassette = ... # type: QPrinter.PaperSource
        FormSource = ... # type: QPrinter.PaperSource
        MaxPageSource = ... # type: QPrinter.PaperSource
        Upper = ... # type: QPrinter.PaperSource
        CustomSource = ... # type: QPrinter.PaperSource
        LastPaperSource = ... # type: QPrinter.PaperSource

    class ColorMode(enum.Enum):
        GrayScale = ... # type: QPrinter.ColorMode
        Color = ... # type: QPrinter.ColorMode

    class PageOrder(enum.Enum):
        FirstPageFirst = ... # type: QPrinter.PageOrder
        LastPageFirst = ... # type: QPrinter.PageOrder

    class PrinterMode(enum.Enum):
        ScreenResolution = ... # type: QPrinter.PrinterMode
        PrinterResolution = ... # type: QPrinter.PrinterMode
        HighResolution = ... # type: QPrinter.PrinterMode

    @typing.overload
    def __init__(self, mode: 'QPrinter.PrinterMode' = ...) -> None: ...
    @typing.overload
    def __init__(self, printer: 'QPrinterInfo', mode: 'QPrinter.PrinterMode' = ...) -> None: ...

    def pdfVersion(self) -> QtGui.QPagedPaintDevice.PdfVersion: ...
    def setPdfVersion(self, version: QtGui.QPagedPaintDevice.PdfVersion) -> None: ...
    def setEngines(self, printEngine: typing.Optional[QPrintEngine], paintEngine: typing.Optional[QtGui.QPaintEngine]) -> None: ...
    def metric(self, a0: QtGui.QPaintDevice.PaintDeviceMetric) -> int: ...
    def printRange(self) -> 'QPrinter.PrintRange': ...
    def setPrintRange(self, range: 'QPrinter.PrintRange') -> None: ...
    def toPage(self) -> int: ...
    def fromPage(self) -> int: ...
    def setFromTo(self, fromPage: int, toPage: int) -> None: ...
    def printEngine(self) -> typing.Optional[QPrintEngine]: ...
    def paintEngine(self) -> typing.Optional[QtGui.QPaintEngine]: ...
    def printerState(self) -> 'QPrinter.PrinterState': ...
    def abort(self) -> bool: ...
    def newPage(self) -> bool: ...
    def pageRect(self, a0: 'QPrinter.Unit') -> QtCore.QRectF: ...
    def paperRect(self, a0: 'QPrinter.Unit') -> QtCore.QRectF: ...
    def fontEmbeddingEnabled(self) -> bool: ...
    def setFontEmbeddingEnabled(self, enable: bool) -> None: ...
    def supportedResolutions(self) -> list[int]: ...
    def duplex(self) -> 'QPrinter.DuplexMode': ...
    def setDuplex(self, duplex: 'QPrinter.DuplexMode') -> None: ...
    def paperSource(self) -> 'QPrinter.PaperSource': ...
    def setPaperSource(self, a0: 'QPrinter.PaperSource') -> None: ...
    def supportsMultipleCopies(self) -> bool: ...
    def copyCount(self) -> int: ...
    def setCopyCount(self, a0: int) -> None: ...
    def fullPage(self) -> bool: ...
    def setFullPage(self, a0: bool) -> None: ...
    def collateCopies(self) -> bool: ...
    def setCollateCopies(self, collate: bool) -> None: ...
    def colorMode(self) -> 'QPrinter.ColorMode': ...
    def setColorMode(self, a0: 'QPrinter.ColorMode') -> None: ...
    def resolution(self) -> int: ...
    def setResolution(self, a0: int) -> None: ...
    def pageOrder(self) -> 'QPrinter.PageOrder': ...
    def setPageOrder(self, a0: 'QPrinter.PageOrder') -> None: ...
    def creator(self) -> str: ...
    def setCreator(self, a0: typing.Optional[str]) -> None: ...
    def docName(self) -> str: ...
    def setDocName(self, a0: typing.Optional[str]) -> None: ...
    def printProgram(self) -> str: ...
    def setPrintProgram(self, a0: typing.Optional[str]) -> None: ...
    def outputFileName(self) -> str: ...
    def setOutputFileName(self, a0: typing.Optional[str]) -> None: ...
    def isValid(self) -> bool: ...
    def printerName(self) -> str: ...
    def setPrinterName(self, a0: typing.Optional[str]) -> None: ...
    def outputFormat(self) -> 'QPrinter.OutputFormat': ...
    def setOutputFormat(self, format: 'QPrinter.OutputFormat') -> None: ...


class QPrinterInfo(PyQt6.sip.simplewrapper):

    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, src: 'QPrinterInfo') -> None: ...
    @typing.overload
    def __init__(self, printer: QPrinter) -> None: ...

    def supportedColorModes(self) -> list[QPrinter.ColorMode]: ...
    def defaultColorMode(self) -> QPrinter.ColorMode: ...
    def supportedDuplexModes(self) -> list[QPrinter.DuplexMode]: ...
    def defaultDuplexMode(self) -> QPrinter.DuplexMode: ...
    @staticmethod
    def defaultPrinterName() -> str: ...
    @staticmethod
    def availablePrinterNames() -> list[str]: ...
    def supportedResolutions(self) -> list[int]: ...
    def maximumPhysicalPageSize(self) -> QtGui.QPageSize: ...
    def minimumPhysicalPageSize(self) -> QtGui.QPageSize: ...
    def supportsCustomPageSizes(self) -> bool: ...
    def defaultPageSize(self) -> QtGui.QPageSize: ...
    def supportedPageSizes(self) -> list[QtGui.QPageSize]: ...
    def state(self) -> QPrinter.PrinterState: ...
    def isRemote(self) -> bool: ...
    @staticmethod
    def printerInfo(printerName: typing.Optional[str]) -> 'QPrinterInfo': ...
    def makeAndModel(self) -> str: ...
    def location(self) -> str: ...
    def description(self) -> str: ...
    @staticmethod
    def defaultPrinter() -> 'QPrinterInfo': ...
    @staticmethod
    def availablePrinters() -> list['QPrinterInfo']: ...
    def isDefault(self) -> bool: ...
    def isNull(self) -> bool: ...
    def printerName(self) -> str: ...


class QPrintPreviewDialog(QtWidgets.QDialog):

    @typing.overload
    def __init__(self, parent: typing.Optional[QtWidgets.QWidget] = ..., flags: QtCore.Qt.WindowType = ...) -> None: ...
    @typing.overload
    def __init__(self, printer: typing.Optional[QPrinter], parent: typing.Optional[QtWidgets.QWidget] = ..., flags: QtCore.Qt.WindowType = ...) -> None: ...

    paintRequested: typing.ClassVar[QtCore.pyqtSignal]
    def done(self, result: int) -> None: ...
    def printer(self) -> typing.Optional[QPrinter]: ...
    @typing.overload
    def open(self) -> None: ...
    @typing.overload
    def open(self, slot: PYQT_SLOT) -> None: ...
    def setVisible(self, visible: bool) -> None: ...


class QPrintPreviewWidget(QtWidgets.QWidget):

    class ZoomMode(enum.Enum):
        CustomZoom = ... # type: QPrintPreviewWidget.ZoomMode
        FitToWidth = ... # type: QPrintPreviewWidget.ZoomMode
        FitInView = ... # type: QPrintPreviewWidget.ZoomMode

    class ViewMode(enum.Enum):
        SinglePageView = ... # type: QPrintPreviewWidget.ViewMode
        FacingPagesView = ... # type: QPrintPreviewWidget.ViewMode
        AllPagesView = ... # type: QPrintPreviewWidget.ViewMode

    @typing.overload
    def __init__(self, printer: typing.Optional[QPrinter], parent: typing.Optional[QtWidgets.QWidget] = ..., flags: QtCore.Qt.WindowType = ...) -> None: ...
    @typing.overload
    def __init__(self, parent: typing.Optional[QtWidgets.QWidget] = ..., flags: QtCore.Qt.WindowType = ...) -> None: ...

    def pageCount(self) -> int: ...
    previewChanged: typing.ClassVar[QtCore.pyqtSignal]
    paintRequested: typing.ClassVar[QtCore.pyqtSignal]
    def updatePreview(self) -> None: ...
    def setAllPagesViewMode(self) -> None: ...
    def setFacingPagesViewMode(self) -> None: ...
    def setSinglePageViewMode(self) -> None: ...
    def setPortraitOrientation(self) -> None: ...
    def setLandscapeOrientation(self) -> None: ...
    def fitInView(self) -> None: ...
    def fitToWidth(self) -> None: ...
    def setCurrentPage(self, pageNumber: int) -> None: ...
    def setZoomMode(self, zoomMode: 'QPrintPreviewWidget.ZoomMode') -> None: ...
    def setViewMode(self, viewMode: 'QPrintPreviewWidget.ViewMode') -> None: ...
    def setOrientation(self, orientation: QtGui.QPageLayout.Orientation) -> None: ...
    def setZoomFactor(self, zoomFactor: float) -> None: ...
    def zoomOut(self, factor: float = ...) -> None: ...
    def zoomIn(self, factor: float = ...) -> None: ...
    def print(self) -> None: ...
    def setVisible(self, visible: bool) -> None: ...
    def currentPage(self) -> int: ...
    def zoomMode(self) -> 'QPrintPreviewWidget.ZoomMode': ...
    def viewMode(self) -> 'QPrintPreviewWidget.ViewMode': ...
    def orientation(self) -> QtGui.QPageLayout.Orientation: ...
    def zoomFactor(self) -> float: ...