Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qprintdevice_p.h
Go to the documentation of this file.
1// Copyright (C) 2014 John Layt <jlayt@kde.org>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QPRINTDEVICE_H
5#define QPRINTDEVICE_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists for the convenience
12// of internal files. This header file may change from version to version
13// without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtPrintSupport/private/qtprintsupportglobal_p.h>
19#include "private/qprint_p.h"
20
21#include <QtCore/qsharedpointer.h>
22#include <QtGui/qpagelayout.h>
23
25
26#ifndef QT_NO_PRINTER
27
29class QMarginsF;
30class QMimeType;
31class QDebug;
32
33class Q_PRINTSUPPORT_EXPORT QPrintDevice
34{
35public:
36
38 QPrintDevice(const QString & id);
41
42 QPrintDevice &operator=(const QPrintDevice &other);
44
45 void swap(QPrintDevice &other) { d.swap(other.d); }
46
47 bool operator==(const QPrintDevice &other) const;
48
49 QString id() const;
50 QString name() const;
51 QString location() const;
52 QString makeAndModel() const;
53
54 bool isValid() const;
55 bool isDefault() const;
56 bool isRemote() const;
57
59
60 bool isValidPageLayout(const QPageLayout &layout, int resolution) const;
61
62 bool supportsMultipleCopies() const;
63 bool supportsCollateCopies() const;
64
65 QPageSize defaultPageSize() const;
66 QList<QPageSize> supportedPageSizes() const;
67
68 QPageSize supportedPageSize(const QPageSize &pageSize) const;
69 QPageSize supportedPageSize(QPageSize::PageSizeId pageSizeId) const;
70 QPageSize supportedPageSize(const QString &pageName) const;
71 QPageSize supportedPageSize(const QSize &pointSize) const;
72 QPageSize supportedPageSize(const QSizeF &size, QPageSize::Unit units = QPageSize::Point) const;
73
74 bool supportsCustomPageSizes() const;
75
76 QSize minimumPhysicalPageSize() const;
77 QSize maximumPhysicalPageSize() const;
78
79 QMarginsF printableMargins(const QPageSize &pageSize, QPageLayout::Orientation orientation, int resolution) const;
80
81 int defaultResolution() const;
82 QList<int> supportedResolutions() const;
83
84 QPrint::InputSlot defaultInputSlot() const;
85 QList<QPrint::InputSlot> supportedInputSlots() const;
86
87 QPrint::OutputBin defaultOutputBin() const;
88 QList<QPrint::OutputBin> supportedOutputBins() const;
89
90 QPrint::DuplexMode defaultDuplexMode() const;
91 QList<QPrint::DuplexMode> supportedDuplexModes() const;
92
93 QPrint::ColorMode defaultColorMode() const;
94 QList<QPrint::ColorMode> supportedColorModes() const;
95
97 PDPK_CustomBase = 0xff00
98 };
99
100 QVariant property(PrintDevicePropertyKey key) const;
101 bool setProperty(PrintDevicePropertyKey key, const QVariant &value);
102 bool isFeatureAvailable(PrintDevicePropertyKey key, const QVariant &params) const;
103
104#if QT_CONFIG(mimetype)
105 QList<QMimeType> supportedMimeTypes() const;
106#endif
107
108# ifndef QT_NO_DEBUG_STREAM
109 void format(QDebug debug) const;
110# endif
111
112private:
116 QSharedPointer<QPlatformPrintDevice> d;
117};
118
119Q_DECLARE_SHARED(QPrintDevice)
120
121# ifndef QT_NO_DEBUG_STREAM
122Q_PRINTSUPPORT_EXPORT QDebug operator<<(QDebug debug, const QPrintDevice &);
123# endif
124#endif // QT_NO_PRINTER
125
127
128#endif // QPLATFORMPRINTDEVICE_H
\inmodule QtCore
\inmodule QtCore
Definition qmargins.h:270
\inmodule QtCore
Definition qmimetype.h:25
\inmodule QtGui
Definition qpagelayout.h:20
Orientation
This enum type defines the page orientation.
Definition qpagelayout.h:33
\inmodule QtGui
Definition qpagesize.h:22
Unit
This enum type is used to specify the measurement unit for page sizes.
Definition qpagesize.h:175
PageSizeId
This enum type lists the available page sizes as defined in the Postscript PPD standard.
Definition qpagesize.h:25
The QPlatformPrinterSupport class provides an abstraction for print support.
void swap(QPrintDevice &other)
QPrintDevice & operator=(QPrintDevice &&other)
\inmodule QtCore
Definition qsize.h:208
\inmodule QtCore
Definition qsize.h:25
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qvariant.h:65
else opt state
[0]
ColorMode
Definition qprint_p.h:72
DuplexMode
Definition qprint_p.h:64
DeviceState
Definition qprint_p.h:56
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLint location
GLuint64 key
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint id
[7]
GLfloat units
GLuint name
GLint GLsizei GLsizei GLenum format
void ** params
Q_PRINTSUPPORT_EXPORT QDebug operator<<(QDebug debug, const QPrintDevice &)
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
Definition qrandom.cpp:1220
const char property[13]
Definition qwizard.cpp:101
QVBoxLayout * layout
QSharedPointer< T > other(t)
[5]
this swap(other)
args<< 1<< 2;QJSValue threeAgain=fun.call(args);QString fileName="helloworld.qs";QFile scriptFile(fileName);if(!scriptFile.open(QIODevice::ReadOnly)) QTextStream stream(&scriptFile);QString contents=stream.readAll();scriptFile.close();myEngine.evaluate(contents, fileName);myEngine.globalObject().setProperty("myNumber", 123);...QJSValue myNumberPlusOne=myEngine.evaluate("myNumber + 1");QJSValue result=myEngine.evaluate(...);if(result.isError()) qDebug()<< "Uncaught exception at line"<< result.property("lineNumber").toInt()<< ":"<< result.toString();QPushButton *button=new QPushButton;QJSValue scriptButton=myEngine.newQObject(button);myEngine.globalObject().setProperty("button", scriptButton);myEngine.evaluate("button.checkable = true");qDebug()<< scriptButton.property("checkable").toBool();scriptButton.property("show").call();QJSEngine engine;QObject *myQObject=new QObject();myQObject- setProperty)("dynamicProperty", 3)