summaryrefslogtreecommitdiffstats
path: root/src/printsupport/kernel/qplatformprintersupport.h
Commit message (Collapse)AuthorAgeFilesLines
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Remove QPlatformPrinterSupport::createDefaultPrintDeviceAlbert Astals Cid2018-02-051-1/+0
| | | | | | | no one uses it Change-Id: I03d0350a44a19545d57b47d1b21d85f1a2059f4d Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Initialize the print engine with the given printer nameAndy Shaw2017-08-251-1/+1
| | | | | | | | | | | Originally when the QPrinter was created it would create the engine with the default printer and then change it afterwards even though the desired printer may already be known here. So by passing the printer name we ensure that it is initialized with the desired one right away. Task-number: QTBUG-62221 Change-Id: Iaa90243708b57bf89354a527a982ac45c991f603 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add qtprintsupportglobal_p.h and fix qtprintsupportglobal.hLars Knoll2016-07-141-0/+1
| | | | | | | | | Include qtwidgetsglobal.h from qtprintsupportglobal.h. Add qtprintsupportglobal_p.h. Include those headers from all header files in the module. Change-Id: I8d8b2012ee7d513172b985e13fdfeb3493d26d23 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* QPrinterInfo - Switch to QPlatformPrintDeviceJohn Layt2014-03-171-18/+2
| | | | | | | | | | | | | | | | | | | Change the QPrinterInfo implementation to use QPlatformPrintDevice as the backend. Remove all the old QPrinterInfo related code from the QPA plugin. Add public api to QPrinterInfo to support some features from QPlatformPrintDevice. [ChangeLog][QtPrintSupport][QPrinterInfo] Added new public api for isRemote(), state(), defaultPageSize(), supportedPageSizes(), supportsCustomPageSizes(), minimumPhysicalPageSize(), maximumPhysicalPageSize(), supportedResolutions(), availablePrinterNames(), and defaultPrinterName(). The use of availablePrinters() is discouraged due to performance concerns. Task-number: QTBUG-35248 Change-Id: Ic38323a930549ad67bf04a1a6bb43d623dfe6a33 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QPlatformPrintDevice - New QPA base classJohn Layt2014-03-171-0/+10
| | | | | | | | | | Add a new QPA class to abstract Print Devices. Each platform instance will encapsulate all required details about a print device instead of the code being distributed throughout the print engine and print plugin. Change-Id: I7f6a537ad55a6e7f599d83f461b1e2ee62b15094 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add support for getting the paper names available for the printerAndy Shaw2013-02-111-1/+1
| | | | | | | Task-number: QTBUG-27714 Change-Id: I9bc6f1188f262e43f581add058d7895e1b5bd9e3 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-291-4/+0
| | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* printsupport: Fix missing or improper include guard in headersSergio Ahumada2012-09-081-3/+3
| | | | | | | | Use an include guard in headers to ensure the header is not included more than once. Make the header guard match its file name. Change-Id: Iefc02181fe235ede51c567fb54997531e5cd08a3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtPrintSupport - Add CUPS printer and options queries to pluginJohn Layt2012-06-091-0/+6
| | | | | | | | | | | | | | | | Implement initial support in the CUPS plugin for directly calling CUPS to obtain printer list and basic printer info rather than QCupsSupport. Add api to the plugin to return any options for a printer, usually IPP options as implemented for CUPS, but whatever applies for the host print system. Future changes will add support for returning the PPD options. This api may eventually be added to QPrinterInfo, but not in 5.0. Change-Id: I6c8bae4c9295009599e6ab31382f5fff4c93981f Reviewed-by: Teemu Katajisto <teemu.katajisto@digia.com> Reviewed-by: John Layt <jlayt@kde.org>
* QtPrintSupport: Move printer list into plugin base classJohn Layt2012-06-081-1/+4
| | | | | | | | | Move the cached printer list from the Windows plugin into the base class so the CUPS plugin can also use it in a subsequent commit. Change-Id: Idf5fb7fc49b1820aad58f16e8854ab9120caa193 Reviewed-by: Teemu Katajisto <teemu.katajisto@digia.com> Reviewed-by: John Layt <jlayt@kde.org>
* QtPrintSupport: Move plugin access of QPrinterInfo internals to baseJohn Layt2012-06-081-2/+4
| | | | | | | | | | Move all plugin methods requiring access to QPrinterInfo internals into the plugin base class, and remove the plugin classes as friends from QPrinterInfo. Change-Id: Ic527efc681e198abf19e038dd77c36bb8017d049 Reviewed-by: Teemu Katajisto <teemu.katajisto@digia.com> Reviewed-by: John Layt <jlayt@kde.org>
* QtPrintSupport: Add CUPS printsupport pluginJohn Layt2012-05-311-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move CUPS code around to create a new CUPS printsupport plugin, this fixes QPrinterInfo for CUPS which depends on the plugin to work. It QT_NO_CUPS is defined then the plugin is not built and only Print to PDF is supported under Linux. * Move unused genericiunixprintersupport plugin to start new CUPS printsupport plugin * Split QPdfPrintEngine to create QCupsPrintEngine * Remove LPR related code from QPdfPrintEngine * Move CUPS specific code from plugin base class to derived CUPS class * Remove forcing CUPS print engine to use PDF mode as PDF is now Native * Move qt_getCupsPrinterPaperSizes from qprinterinfo_unix to QCUPSSupport * Remove qprinterinfo_unix as no longer used * Remove all QT_NO_LPR uses There is now no CUPS specific code left in printsupport/kernel except QCUPSSupport which is needed for the dialogs. Task-number: QTBUG-23060 Change-Id: Ie8fa4512a2424edc8943068e0fa9fb714cc42db9 Reviewed-by: Teemu Katajisto <teemu.katajisto@digia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: John Layt <jlayt@kde.org>
* QtPrintSupport - Modify Platform Plugin QPrinterInfo apiJohn Layt2012-05-241-1/+1
| | | | | | | | | | | | | | Change the way the printsupport plugin creates QPrinterInfo objects, provide platform api to return a named printer, and expose this as static public api in QPrinterInfo. Only the Mac plugin used the old api, the other plugins will have direct support added in separate commits, but will use the default implementation for now. Change-Id: I7d6b6556eb39919cfb15bc0e814afbaf13c5712c Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* qpa api: replace QPA headers with something more benignGirish Ramakrishnan2012-05-221-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current 'we mean it' headers are considered too aggressive for QPA. Replaced using the following script. for file in `find -type f -name "qplatform*.h" -and -not -name "*_p.h"`; do LINE_NO_1=`grep -n -m 1 "W A R N I N G" $file | awk -F ':' '{print $1}'` LINE_NO_2=`grep -n -m 1 "We mean it." $file | awk -F ':' '{print $1}'` if [ -z "$LINE_NO_1" ]; then LINE_NO_1=`grep -n -m 1 "#define " $file | awk -F ':' '{print $1}'` LINE_NO_2=$((1+$LINE_NO_1)) else LINE_NO_1=$(($LINE_NO_1-2)) LINE_NO_2=$(($LINE_NO_2+2)) fi head -n $LINE_NO_1 $file > $file.new cat >> $file.new <<EOF // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // EOF tail -n +$LINE_NO_2 $file >> $file.new mv $file.new $file done Change-Id: I8a974c9bf8942647b7ad950afb372c1f738aa725 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Expose QPA API under qpa/*Girish Ramakrishnan2012-05-071-0/+86
The main reasons for doing this are: 1. _qpa.h end up in the master QtGui include file. QtGui is meant for userland applications. qpa code is neither binary nor source compatible. Inadvertant use of QPA api makes the user code binary-incompatible. 2. syncqt creates forwarding headers for non-private header files. This gives people the impression that this is public API. As discussed on the mailing list, even though QPA api is internal and subject to change, it needs to treated differently from private headers since they will be used by in-qtbase and out-of-qtbase plugins. This commit does the following: 1. The _qpa in QPA header files is dropped. 2. syncqt now treats any file with qplatform prefix as a special file and moves it to qpa/ directory. The recommended way of using QPA API in plugins is: #include <qpa/qplatformfoo.h>. This allows the user include QPA API from multiple modules (for example, qplatformfoo might be in QtPrintSupport) 3. The user needs to explicitly add QT += <module>-private to get access to the qpa api. 4. Creates compat headers for the olden style qplatformfoo_qpa.h and QPlatformFoo includes. This commit does not change the cpp filenames. This requires a more careful merging of existing non qpa cpp files and existing cpp files on a case by case basis. This can be done at anytime. The following files are not renamed as part of this changed but will be fixed as part of a future change: src/gui/kernel/qgenericpluginfactory_qpa.h src/gui/kernel/qgenericplugin_qpa.h src/gui/kernel/qwindowsysteminterface_qpa.h files were renamed using for x in `find . -name "qplatform*_qpa.h"`; do git mv $x "${x/_qpa.h/.h}"; done for x in `find . -name "qplatform*_qpa_p.h"`; do git mv $x "${x/_qpa_p.h/_p.h}"; done includes were renamed using script for file in `find . -name "*.h" -or -name "*.cpp" -or -name "*.mm"`; do sed -i -e 's,.*#.*include.*<\(Qt.*/\)\?\(QPlatform.*\)>,#include <qpa/\L\2.h>,g' \ -e 's,.*#.*include.*"\(Qt.*/\)\?\(QPlatform.*\)",#include <qpa/\L\2.h>,g' \ -e 's,.*#.*include.* "\(qplatform.*\)_qpa.h",#include <qpa/\L\1.h>,g' \ -e 's,.*#.*include.*"\(qplatform.*\)_qpa_p.h",#include <qpa/\L\1_p.h>,g' \ -e 's,.*#.*include.*<\(Qt.*/\|Qt.*/private/\|private/\)\?\(qplatform.*\)_qpa\(.*\)>,#include <qpa/\2\3>,g' \ -e 's,.*#.*include.*"\(Qt.*/\|Qt.*/private/\|private/\)\?\(qplatform.*\)_qpa\(.*\)",#include <qpa/\2\3>,g' \ $file done Change-Id: I04a350314a45746e3911f54b3b21ad03315afb67 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>