From d16fe3cd429da87fe9dbd7956682ff1457db8227 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Fri, 10 Jul 2009 15:30:17 +0000 Subject: [PATCH] 2009-07-10 08:19 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * harbour/contrib/hbqt/generator/qt45.qtp * harbour/contrib/hbqt/hbqt.ch * harbour/contrib/hbqt/hbqt.h * harbour/contrib/hbqt/hbqt_slots.cpp * harbour/contrib/hbqt/hbqt_slots.h * harbour/contrib/hbqt/Makefile_gen * harbour/contrib/hbqt/moc_slots.cpp + harbour/contrib/hbqt/QPrintEngine.cpp + harbour/contrib/hbqt/QPrinter.cpp + harbour/contrib/hbqt/TQPrintEngine.prg + harbour/contrib/hbqt/TQPrinter.prg + harbour/contrib/hbqt/qth/QPrintEngine.qth + harbour/contrib/hbqt/qth/QPrinter.qth + Added two more classes. + Added one more event handler. --- harbour/ChangeLog | 21 + harbour/contrib/hbqt/Makefile_gen | 4 + harbour/contrib/hbqt/QPrintEngine.cpp | 126 +++++ harbour/contrib/hbqt/QPrinter.cpp | 556 ++++++++++++++++++++++ harbour/contrib/hbqt/TQPrintEngine.prg | 86 ++++ harbour/contrib/hbqt/TQPrinter.prg | 137 ++++++ harbour/contrib/hbqt/generator/qt45.qtp | 2 + harbour/contrib/hbqt/hbqt.ch | 230 ++++++++- harbour/contrib/hbqt/hbqt.h | 1 + harbour/contrib/hbqt/hbqt_slots.cpp | 11 + harbour/contrib/hbqt/hbqt_slots.h | 1 + harbour/contrib/hbqt/moc_slots.cpp | 11 +- harbour/contrib/hbqt/qth/QPrintEngine.qth | 99 ++++ harbour/contrib/hbqt/qth/QPrinter.qth | 166 +++++++ 14 files changed, 1426 insertions(+), 25 deletions(-) create mode 100644 harbour/contrib/hbqt/QPrintEngine.cpp create mode 100644 harbour/contrib/hbqt/QPrinter.cpp create mode 100644 harbour/contrib/hbqt/TQPrintEngine.prg create mode 100644 harbour/contrib/hbqt/TQPrinter.prg create mode 100644 harbour/contrib/hbqt/qth/QPrintEngine.qth create mode 100644 harbour/contrib/hbqt/qth/QPrinter.qth diff --git a/harbour/ChangeLog b/harbour/ChangeLog index d9548afacb..f4e3aca161 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,27 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-07-10 08:19 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * harbour/contrib/hbqt/generator/qt45.qtp + + * harbour/contrib/hbqt/hbqt.ch + * harbour/contrib/hbqt/hbqt.h + * harbour/contrib/hbqt/hbqt_slots.cpp + * harbour/contrib/hbqt/hbqt_slots.h + * harbour/contrib/hbqt/Makefile_gen + * harbour/contrib/hbqt/moc_slots.cpp + + + harbour/contrib/hbqt/QPrintEngine.cpp + + harbour/contrib/hbqt/QPrinter.cpp + + harbour/contrib/hbqt/TQPrintEngine.prg + + harbour/contrib/hbqt/TQPrinter.prg + + + harbour/contrib/hbqt/qth/QPrintEngine.qth + + harbour/contrib/hbqt/qth/QPrinter.qth + + + Added two more classes. + + Added one more event handler. + 2009-07-10 16:18 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) - examples/terminal/terminal.ch * examples/terminal/trm_cli.hbp diff --git a/harbour/contrib/hbqt/Makefile_gen b/harbour/contrib/hbqt/Makefile_gen index d486cdb3bd..c0c3223cc9 100644 --- a/harbour/contrib/hbqt/Makefile_gen +++ b/harbour/contrib/hbqt/Makefile_gen @@ -108,6 +108,8 @@ CPP_SOURCES=\ QPoint.cpp \ QPointF.cpp \ QPrintDialog.cpp \ + QPrintEngine.cpp \ + QPrinter.cpp \ QPrintPreviewDialog.cpp \ QProgressBar.cpp \ QProgressDialog.cpp \ @@ -328,6 +330,8 @@ PRG_SOURCES=\ TQPoint.prg \ TQPointF.prg \ TQPrintDialog.prg \ + TQPrintEngine.prg \ + TQPrinter.prg \ TQPrintPreviewDialog.prg \ TQProgressBar.prg \ TQProgressDialog.prg \ diff --git a/harbour/contrib/hbqt/QPrintEngine.cpp b/harbour/contrib/hbqt/QPrintEngine.cpp new file mode 100644 index 0000000000..624aa76b14 --- /dev/null +++ b/harbour/contrib/hbqt/QPrintEngine.cpp @@ -0,0 +1,126 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Marcos Antonio Gambeta + * Copyright 2009 Pritpal Bedi + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ + +#include "hbapi.h" +#include "hbqt.h" + +/*----------------------------------------------------------------------*/ +#if QT_VERSION >= 0x040500 +/*----------------------------------------------------------------------*/ + + +#include + + +/* + * virtual ~QPrintEngine () + */ +HB_FUNC( QT_QPRINTENGINE ) +{ + +} + +/* + * virtual bool abort () + */ +HB_FUNC( QT_QPRINTENGINE_ABORT ) +{ + hb_retl( hbqt_par_QPrintEngine( 1 )->abort() ); +} + +/* + * virtual int metric ( QPaintDevice::PaintDeviceMetric id ) const + */ +HB_FUNC( QT_QPRINTENGINE_METRIC ) +{ + hb_retni( hbqt_par_QPrintEngine( 1 )->metric( ( QPaintDevice::PaintDeviceMetric ) hb_parni( 2 ) ) ); +} + +/* + * virtual bool newPage () + */ +HB_FUNC( QT_QPRINTENGINE_NEWPAGE ) +{ + hb_retl( hbqt_par_QPrintEngine( 1 )->newPage() ); +} + +/* + * virtual QPrinter::PrinterState printerState () const + */ +HB_FUNC( QT_QPRINTENGINE_PRINTERSTATE ) +{ + hb_retni( ( QPrinter::PrinterState ) hbqt_par_QPrintEngine( 1 )->printerState() ); +} + +/* + * virtual QVariant property ( PrintEnginePropertyKey key ) const + */ +HB_FUNC( QT_QPRINTENGINE_PROPERTY ) +{ + hb_retptr( new QVariant( hbqt_par_QPrintEngine( 1 )->property( ( QPrintEngine::PrintEnginePropertyKey ) hb_parni( 2 ) ) ) ); +} + +/* + * virtual void setProperty ( PrintEnginePropertyKey key, const QVariant & value ) + */ +HB_FUNC( QT_QPRINTENGINE_SETPROPERTY ) +{ + hbqt_par_QPrintEngine( 1 )->setProperty( ( QPrintEngine::PrintEnginePropertyKey ) hb_parni( 2 ), *hbqt_par_QVariant( 3 ) ); +} + + +/*----------------------------------------------------------------------*/ +#endif /* #if QT_VERSION >= 0x040500 */ +/*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbqt/QPrinter.cpp b/harbour/contrib/hbqt/QPrinter.cpp new file mode 100644 index 0000000000..003f10c4a1 --- /dev/null +++ b/harbour/contrib/hbqt/QPrinter.cpp @@ -0,0 +1,556 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Marcos Antonio Gambeta + * Copyright 2009 Pritpal Bedi + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ + +#include "hbapi.h" +#include "hbqt.h" + +/*----------------------------------------------------------------------*/ +#if QT_VERSION >= 0x040500 +/*----------------------------------------------------------------------*/ + +/* + * Constructed[ 57/59 [ 96.61% ] ] + * + * *** Unconvered Prototypes *** + * ----------------------------- + * + * QList supportedPaperSources () const + * QList supportedResolutions () const + */ + + +#include + + +/* + * QPrinter ( PrinterMode mode = ScreenResolution ) + * QPrinter ( const QPrinterInfo & printer, PrinterMode mode = ScreenResolution ) + * ~QPrinter () + */ +HB_FUNC( QT_QPRINTER ) +{ + hb_retptr( ( QPrinter* ) new QPrinter( QPrinter::PrinterResolution ) ); +} + +/* + * bool abort () + */ +HB_FUNC( QT_QPRINTER_ABORT ) +{ + hb_retl( hbqt_par_QPrinter( 1 )->abort() ); +} + +/* + * bool collateCopies () const + */ +HB_FUNC( QT_QPRINTER_COLLATECOPIES ) +{ + hb_retl( hbqt_par_QPrinter( 1 )->collateCopies() ); +} + +/* + * ColorMode colorMode () const + */ +HB_FUNC( QT_QPRINTER_COLORMODE ) +{ + hb_retni( ( QPrinter::ColorMode ) hbqt_par_QPrinter( 1 )->colorMode() ); +} + +/* + * QString creator () const + */ +HB_FUNC( QT_QPRINTER_CREATOR ) +{ + hb_retc( hbqt_par_QPrinter( 1 )->creator().toLatin1().data() ); +} + +/* + * QString docName () const + */ +HB_FUNC( QT_QPRINTER_DOCNAME ) +{ + hb_retc( hbqt_par_QPrinter( 1 )->docName().toLatin1().data() ); +} + +/* + * bool doubleSidedPrinting () const + */ +HB_FUNC( QT_QPRINTER_DOUBLESIDEDPRINTING ) +{ + hb_retl( hbqt_par_QPrinter( 1 )->doubleSidedPrinting() ); +} + +/* + * DuplexMode duplex () const + */ +HB_FUNC( QT_QPRINTER_DUPLEX ) +{ + hb_retni( ( QPrinter::DuplexMode ) hbqt_par_QPrinter( 1 )->duplex() ); +} + +/* + * bool fontEmbeddingEnabled () const + */ +HB_FUNC( QT_QPRINTER_FONTEMBEDDINGENABLED ) +{ + hb_retl( hbqt_par_QPrinter( 1 )->fontEmbeddingEnabled() ); +} + +/* + * int fromPage () const + */ +HB_FUNC( QT_QPRINTER_FROMPAGE ) +{ + hb_retni( hbqt_par_QPrinter( 1 )->fromPage() ); +} + +/* + * bool fullPage () const + */ +HB_FUNC( QT_QPRINTER_FULLPAGE ) +{ + hb_retl( hbqt_par_QPrinter( 1 )->fullPage() ); +} + +/* + * void getPageMargins ( qreal * left, qreal * top, qreal * right, qreal * bottom, Unit unit ) const + */ +HB_FUNC( QT_QPRINTER_GETPAGEMARGINS ) +{ + qreal qrLeft = 0; + qreal qrTop = 0; + qreal qrRight = 0; + qreal qrBottom = 0; + + hbqt_par_QPrinter( 1 )->getPageMargins( &qrLeft, &qrTop, &qrRight, &qrBottom, ( QPrinter::Unit ) hb_parni( 6 ) ); + + hb_stornd( qrLeft, 2 ); + hb_stornd( qrTop, 3 ); + hb_stornd( qrRight, 4 ); + hb_stornd( qrBottom, 5 ); +} + +/* + * bool isValid () const + */ +HB_FUNC( QT_QPRINTER_ISVALID ) +{ + hb_retl( hbqt_par_QPrinter( 1 )->isValid() ); +} + +/* + * bool newPage () + */ +HB_FUNC( QT_QPRINTER_NEWPAGE ) +{ + hb_retl( hbqt_par_QPrinter( 1 )->newPage() ); +} + +/* + * int numCopies () const + */ +HB_FUNC( QT_QPRINTER_NUMCOPIES ) +{ + hb_retni( hbqt_par_QPrinter( 1 )->numCopies() ); +} + +/* + * Orientation orientation () const + */ +HB_FUNC( QT_QPRINTER_ORIENTATION ) +{ + hb_retni( ( QPrinter::Orientation ) hbqt_par_QPrinter( 1 )->orientation() ); +} + +/* + * QString outputFileName () const + */ +HB_FUNC( QT_QPRINTER_OUTPUTFILENAME ) +{ + hb_retc( hbqt_par_QPrinter( 1 )->outputFileName().toLatin1().data() ); +} + +/* + * OutputFormat outputFormat () const + */ +HB_FUNC( QT_QPRINTER_OUTPUTFORMAT ) +{ + hb_retni( ( QPrinter::OutputFormat ) hbqt_par_QPrinter( 1 )->outputFormat() ); +} + +/* + * PageOrder pageOrder () const + */ +HB_FUNC( QT_QPRINTER_PAGEORDER ) +{ + hb_retni( ( QPrinter::PageOrder ) hbqt_par_QPrinter( 1 )->pageOrder() ); +} + +/* + * QRect pageRect () const + */ +HB_FUNC( QT_QPRINTER_PAGERECT ) +{ + hb_retptr( new QRect( hbqt_par_QPrinter( 1 )->pageRect() ) ); +} + +/* + * QRectF pageRect ( Unit unit ) const + */ +HB_FUNC( QT_QPRINTER_PAGERECT_1 ) +{ + hb_retptr( new QRectF( hbqt_par_QPrinter( 1 )->pageRect( ( QPrinter::Unit ) hb_parni( 2 ) ) ) ); +} + +/* + * virtual QPaintEngine * paintEngine () const + */ +HB_FUNC( QT_QPRINTER_PAINTENGINE ) +{ + hb_retptr( ( QPaintEngine* ) hbqt_par_QPrinter( 1 )->paintEngine() ); +} + +/* + * QRect paperRect () const + */ +HB_FUNC( QT_QPRINTER_PAPERRECT ) +{ + hb_retptr( new QRect( hbqt_par_QPrinter( 1 )->paperRect() ) ); +} + +/* + * QRectF paperRect ( Unit unit ) const + */ +HB_FUNC( QT_QPRINTER_PAPERRECT_1 ) +{ + hb_retptr( new QRectF( hbqt_par_QPrinter( 1 )->paperRect( ( QPrinter::Unit ) hb_parni( 2 ) ) ) ); +} + +/* + * PaperSize paperSize () const + */ +HB_FUNC( QT_QPRINTER_PAPERSIZE ) +{ + hb_retni( ( QPrinter::PaperSize ) hbqt_par_QPrinter( 1 )->paperSize() ); +} + +/* + * QSizeF paperSize ( Unit unit ) const + */ +HB_FUNC( QT_QPRINTER_PAPERSIZE_1 ) +{ + hb_retptr( new QSizeF( hbqt_par_QPrinter( 1 )->paperSize( ( QPrinter::Unit ) hb_parni( 2 ) ) ) ); +} + +/* + * PaperSource paperSource () const + */ +HB_FUNC( QT_QPRINTER_PAPERSOURCE ) +{ + hb_retni( ( QPrinter::PaperSource ) hbqt_par_QPrinter( 1 )->paperSource() ); +} + +/* + * QPrintEngine * printEngine () const + */ +HB_FUNC( QT_QPRINTER_PRINTENGINE ) +{ + hb_retptr( ( QPrintEngine* ) hbqt_par_QPrinter( 1 )->printEngine() ); +} + +/* + * QString printProgram () const + */ +HB_FUNC( QT_QPRINTER_PRINTPROGRAM ) +{ + hb_retc( hbqt_par_QPrinter( 1 )->printProgram().toLatin1().data() ); +} + +/* + * PrintRange printRange () const + */ +HB_FUNC( QT_QPRINTER_PRINTRANGE ) +{ + hb_retni( ( QPrinter::PrintRange ) hbqt_par_QPrinter( 1 )->printRange() ); +} + +/* + * QString printerName () const + */ +HB_FUNC( QT_QPRINTER_PRINTERNAME ) +{ + hb_retc( hbqt_par_QPrinter( 1 )->printerName().toLatin1().data() ); +} + +/* + * PrinterState printerState () const + */ +HB_FUNC( QT_QPRINTER_PRINTERSTATE ) +{ + hb_retni( ( QPrinter::PrinterState ) hbqt_par_QPrinter( 1 )->printerState() ); +} + +/* + * int resolution () const + */ +HB_FUNC( QT_QPRINTER_RESOLUTION ) +{ + hb_retni( hbqt_par_QPrinter( 1 )->resolution() ); +} + +/* + * void setCollateCopies ( bool collate ) + */ +HB_FUNC( QT_QPRINTER_SETCOLLATECOPIES ) +{ + hbqt_par_QPrinter( 1 )->setCollateCopies( hb_parl( 2 ) ); +} + +/* + * void setColorMode ( ColorMode newColorMode ) + */ +HB_FUNC( QT_QPRINTER_SETCOLORMODE ) +{ + hbqt_par_QPrinter( 1 )->setColorMode( ( QPrinter::ColorMode ) hb_parni( 2 ) ); +} + +/* + * void setCreator ( const QString & creator ) + */ +HB_FUNC( QT_QPRINTER_SETCREATOR ) +{ + hbqt_par_QPrinter( 1 )->setCreator( hbqt_par_QString( 2 ) ); +} + +/* + * void setDocName ( const QString & name ) + */ +HB_FUNC( QT_QPRINTER_SETDOCNAME ) +{ + hbqt_par_QPrinter( 1 )->setDocName( hbqt_par_QString( 2 ) ); +} + +/* + * void setDoubleSidedPrinting ( bool doubleSided ) + */ +HB_FUNC( QT_QPRINTER_SETDOUBLESIDEDPRINTING ) +{ + hbqt_par_QPrinter( 1 )->setDoubleSidedPrinting( hb_parl( 2 ) ); +} + +/* + * void setDuplex ( DuplexMode duplex ) + */ +HB_FUNC( QT_QPRINTER_SETDUPLEX ) +{ + hbqt_par_QPrinter( 1 )->setDuplex( ( QPrinter::DuplexMode ) hb_parni( 2 ) ); +} + +/* + * void setFontEmbeddingEnabled ( bool enable ) + */ +HB_FUNC( QT_QPRINTER_SETFONTEMBEDDINGENABLED ) +{ + hbqt_par_QPrinter( 1 )->setFontEmbeddingEnabled( hb_parl( 2 ) ); +} + +/* + * void setFromTo ( int from, int to ) + */ +HB_FUNC( QT_QPRINTER_SETFROMTO ) +{ + hbqt_par_QPrinter( 1 )->setFromTo( hb_parni( 2 ), hb_parni( 3 ) ); +} + +/* + * void setFullPage ( bool fp ) + */ +HB_FUNC( QT_QPRINTER_SETFULLPAGE ) +{ + hbqt_par_QPrinter( 1 )->setFullPage( hb_parl( 2 ) ); +} + +/* + * void setNumCopies ( int numCopies ) + */ +HB_FUNC( QT_QPRINTER_SETNUMCOPIES ) +{ + hbqt_par_QPrinter( 1 )->setNumCopies( hb_parni( 2 ) ); +} + +/* + * void setOrientation ( Orientation orientation ) + */ +HB_FUNC( QT_QPRINTER_SETORIENTATION ) +{ + hbqt_par_QPrinter( 1 )->setOrientation( ( QPrinter::Orientation ) hb_parni( 2 ) ); +} + +/* + * void setOutputFileName ( const QString & fileName ) + */ +HB_FUNC( QT_QPRINTER_SETOUTPUTFILENAME ) +{ + hbqt_par_QPrinter( 1 )->setOutputFileName( hbqt_par_QString( 2 ) ); +} + +/* + * void setOutputFormat ( OutputFormat format ) + */ +HB_FUNC( QT_QPRINTER_SETOUTPUTFORMAT ) +{ + hbqt_par_QPrinter( 1 )->setOutputFormat( ( QPrinter::OutputFormat ) hb_parni( 2 ) ); +} + +/* + * void setPageMargins ( qreal left, qreal top, qreal right, qreal bottom, Unit unit ) + */ +HB_FUNC( QT_QPRINTER_SETPAGEMARGINS ) +{ + hbqt_par_QPrinter( 1 )->setPageMargins( hb_parnd( 2 ), hb_parnd( 3 ), hb_parnd( 4 ), hb_parnd( 5 ), ( QPrinter::Unit ) hb_parni( 6 ) ); +} + +/* + * void setPageOrder ( PageOrder pageOrder ) + */ +HB_FUNC( QT_QPRINTER_SETPAGEORDER ) +{ + hbqt_par_QPrinter( 1 )->setPageOrder( ( QPrinter::PageOrder ) hb_parni( 2 ) ); +} + +/* + * void setPaperSize ( PaperSize newPaperSize ) + */ +HB_FUNC( QT_QPRINTER_SETPAPERSIZE ) +{ + hbqt_par_QPrinter( 1 )->setPaperSize( ( QPrinter::PaperSize ) hb_parni( 2 ) ); +} + +/* + * void setPaperSize ( const QSizeF & paperSize, Unit unit ) + */ +HB_FUNC( QT_QPRINTER_SETPAPERSIZE_1 ) +{ + hbqt_par_QPrinter( 1 )->setPaperSize( *hbqt_par_QSizeF( 2 ), ( QPrinter::Unit ) hb_parni( 3 ) ); +} + +/* + * void setPaperSource ( PaperSource source ) + */ +HB_FUNC( QT_QPRINTER_SETPAPERSOURCE ) +{ + hbqt_par_QPrinter( 1 )->setPaperSource( ( QPrinter::PaperSource ) hb_parni( 2 ) ); +} + +/* + * void setPrintProgram ( const QString & printProg ) + */ +HB_FUNC( QT_QPRINTER_SETPRINTPROGRAM ) +{ + hbqt_par_QPrinter( 1 )->setPrintProgram( hbqt_par_QString( 2 ) ); +} + +/* + * void setPrintRange ( PrintRange range ) + */ +HB_FUNC( QT_QPRINTER_SETPRINTRANGE ) +{ + hbqt_par_QPrinter( 1 )->setPrintRange( ( QPrinter::PrintRange ) hb_parni( 2 ) ); +} + +/* + * void setPrinterName ( const QString & name ) + */ +HB_FUNC( QT_QPRINTER_SETPRINTERNAME ) +{ + hbqt_par_QPrinter( 1 )->setPrinterName( hbqt_par_QString( 2 ) ); +} + +/* + * void setResolution ( int dpi ) + */ +HB_FUNC( QT_QPRINTER_SETRESOLUTION ) +{ + hbqt_par_QPrinter( 1 )->setResolution( hb_parni( 2 ) ); +} + +/* + * void setWinPageSize ( int pageSize ) + */ +HB_FUNC( QT_QPRINTER_SETWINPAGESIZE ) +{ + hbqt_par_QPrinter( 1 )->setWinPageSize( hb_parni( 2 ) ); +} + +/* + * int toPage () const + */ +HB_FUNC( QT_QPRINTER_TOPAGE ) +{ + hb_retni( hbqt_par_QPrinter( 1 )->toPage() ); +} + +/* + * int winPageSize () const + */ +HB_FUNC( QT_QPRINTER_WINPAGESIZE ) +{ + hb_retni( hbqt_par_QPrinter( 1 )->winPageSize() ); +} + + +/*----------------------------------------------------------------------*/ +#endif /* #if QT_VERSION >= 0x040500 */ +/*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbqt/TQPrintEngine.prg b/harbour/contrib/hbqt/TQPrintEngine.prg new file mode 100644 index 0000000000..8f0ea5b598 --- /dev/null +++ b/harbour/contrib/hbqt/TQPrintEngine.prg @@ -0,0 +1,86 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Marcos Antonio Gambeta + * Copyright 2009 Pritpal Bedi + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ + + +#include "hbclass.ch" + + +CREATE CLASS QPrintEngine + + VAR pParent + VAR pPtr + + METHOD New() + + METHOD abort() INLINE Qt_QPrintEngine_abort( ::pPtr ) + METHOD metric( nId ) INLINE Qt_QPrintEngine_metric( ::pPtr, nId ) + METHOD newPage() INLINE Qt_QPrintEngine_newPage( ::pPtr ) + METHOD printerState() INLINE Qt_QPrintEngine_printerState( ::pPtr ) + METHOD property( nKey ) INLINE Qt_QPrintEngine_property( ::pPtr, nKey ) + METHOD setProperty( nKey, pValue ) INLINE Qt_QPrintEngine_setProperty( ::pPtr, nKey, pValue ) + + ENDCLASS + +/*----------------------------------------------------------------------*/ + +METHOD New( pParent ) CLASS QPrintEngine + + ::pParent := pParent + + ::pPtr := Qt_QPrintEngine( pParent ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbqt/TQPrinter.prg b/harbour/contrib/hbqt/TQPrinter.prg new file mode 100644 index 0000000000..42f25ae829 --- /dev/null +++ b/harbour/contrib/hbqt/TQPrinter.prg @@ -0,0 +1,137 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Marcos Antonio Gambeta + * Copyright 2009 Pritpal Bedi + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ + + +#include "hbclass.ch" + + +CREATE CLASS QPrinter INHERIT QPaintDevice + + VAR pParent + VAR pPtr + + METHOD New() + + METHOD abort() INLINE Qt_QPrinter_abort( ::pPtr ) + METHOD collateCopies() INLINE Qt_QPrinter_collateCopies( ::pPtr ) + METHOD colorMode() INLINE Qt_QPrinter_colorMode( ::pPtr ) + METHOD creator() INLINE Qt_QPrinter_creator( ::pPtr ) + METHOD docName() INLINE Qt_QPrinter_docName( ::pPtr ) + METHOD doubleSidedPrinting() INLINE Qt_QPrinter_doubleSidedPrinting( ::pPtr ) + METHOD duplex() INLINE Qt_QPrinter_duplex( ::pPtr ) + METHOD fontEmbeddingEnabled() INLINE Qt_QPrinter_fontEmbeddingEnabled( ::pPtr ) + METHOD fromPage() INLINE Qt_QPrinter_fromPage( ::pPtr ) + METHOD fullPage() INLINE Qt_QPrinter_fullPage( ::pPtr ) + METHOD getPageMargins( nLeft, nTop, nRight, nBottom, nUnit ) INLINE Qt_QPrinter_getPageMargins( ::pPtr, nLeft, nTop, nRight, nBottom, nUnit ) + METHOD isValid() INLINE Qt_QPrinter_isValid( ::pPtr ) + METHOD newPage() INLINE Qt_QPrinter_newPage( ::pPtr ) + METHOD numCopies() INLINE Qt_QPrinter_numCopies( ::pPtr ) + METHOD orientation() INLINE Qt_QPrinter_orientation( ::pPtr ) + METHOD outputFileName() INLINE Qt_QPrinter_outputFileName( ::pPtr ) + METHOD outputFormat() INLINE Qt_QPrinter_outputFormat( ::pPtr ) + METHOD pageOrder() INLINE Qt_QPrinter_pageOrder( ::pPtr ) + METHOD pageRect() INLINE Qt_QPrinter_pageRect( ::pPtr ) + METHOD pageRect_1( nUnit ) INLINE Qt_QPrinter_pageRect_1( ::pPtr, nUnit ) + METHOD paintEngine() INLINE Qt_QPrinter_paintEngine( ::pPtr ) + METHOD paperRect() INLINE Qt_QPrinter_paperRect( ::pPtr ) + METHOD paperRect_1( nUnit ) INLINE Qt_QPrinter_paperRect_1( ::pPtr, nUnit ) + METHOD paperSize() INLINE Qt_QPrinter_paperSize( ::pPtr ) + METHOD paperSize_1( nUnit ) INLINE Qt_QPrinter_paperSize_1( ::pPtr, nUnit ) + METHOD paperSource() INLINE Qt_QPrinter_paperSource( ::pPtr ) + METHOD printEngine() INLINE Qt_QPrinter_printEngine( ::pPtr ) + METHOD printProgram() INLINE Qt_QPrinter_printProgram( ::pPtr ) + METHOD printRange() INLINE Qt_QPrinter_printRange( ::pPtr ) + METHOD printerName() INLINE Qt_QPrinter_printerName( ::pPtr ) + METHOD printerState() INLINE Qt_QPrinter_printerState( ::pPtr ) + METHOD resolution() INLINE Qt_QPrinter_resolution( ::pPtr ) + METHOD setCollateCopies( lCollate ) INLINE Qt_QPrinter_setCollateCopies( ::pPtr, lCollate ) + METHOD setColorMode( nNewColorMode ) INLINE Qt_QPrinter_setColorMode( ::pPtr, nNewColorMode ) + METHOD setCreator( cCreator ) INLINE Qt_QPrinter_setCreator( ::pPtr, cCreator ) + METHOD setDocName( cName ) INLINE Qt_QPrinter_setDocName( ::pPtr, cName ) + METHOD setDoubleSidedPrinting( lDoubleSided ) INLINE Qt_QPrinter_setDoubleSidedPrinting( ::pPtr, lDoubleSided ) + METHOD setDuplex( nDuplex ) INLINE Qt_QPrinter_setDuplex( ::pPtr, nDuplex ) + METHOD setFontEmbeddingEnabled( lEnable ) INLINE Qt_QPrinter_setFontEmbeddingEnabled( ::pPtr, lEnable ) + METHOD setFromTo( nFrom, nTo ) INLINE Qt_QPrinter_setFromTo( ::pPtr, nFrom, nTo ) + METHOD setFullPage( lFp ) INLINE Qt_QPrinter_setFullPage( ::pPtr, lFp ) + METHOD setNumCopies( nNumCopies ) INLINE Qt_QPrinter_setNumCopies( ::pPtr, nNumCopies ) + METHOD setOrientation( nOrientation ) INLINE Qt_QPrinter_setOrientation( ::pPtr, nOrientation ) + METHOD setOutputFileName( cFileName ) INLINE Qt_QPrinter_setOutputFileName( ::pPtr, cFileName ) + METHOD setOutputFormat( nFormat ) INLINE Qt_QPrinter_setOutputFormat( ::pPtr, nFormat ) + METHOD setPageMargins( nLeft, nTop, nRight, nBottom, nUnit ) INLINE Qt_QPrinter_setPageMargins( ::pPtr, nLeft, nTop, nRight, nBottom, nUnit ) + METHOD setPageOrder( nPageOrder ) INLINE Qt_QPrinter_setPageOrder( ::pPtr, nPageOrder ) + METHOD setPaperSize( nNewPaperSize ) INLINE Qt_QPrinter_setPaperSize( ::pPtr, nNewPaperSize ) + METHOD setPaperSize_1( pPaperSize, nUnit ) INLINE Qt_QPrinter_setPaperSize_1( ::pPtr, pPaperSize, nUnit ) + METHOD setPaperSource( nSource ) INLINE Qt_QPrinter_setPaperSource( ::pPtr, nSource ) + METHOD setPrintProgram( cPrintProg ) INLINE Qt_QPrinter_setPrintProgram( ::pPtr, cPrintProg ) + METHOD setPrintRange( nRange ) INLINE Qt_QPrinter_setPrintRange( ::pPtr, nRange ) + METHOD setPrinterName( cName ) INLINE Qt_QPrinter_setPrinterName( ::pPtr, cName ) + METHOD setResolution( nDpi ) INLINE Qt_QPrinter_setResolution( ::pPtr, nDpi ) + METHOD setWinPageSize( nPageSize ) INLINE Qt_QPrinter_setWinPageSize( ::pPtr, nPageSize ) + METHOD toPage() INLINE Qt_QPrinter_toPage( ::pPtr ) + METHOD winPageSize() INLINE Qt_QPrinter_winPageSize( ::pPtr ) + + ENDCLASS + +/*----------------------------------------------------------------------*/ + +METHOD New( pParent ) CLASS QPrinter + + ::pParent := pParent + + ::pPtr := Qt_QPrinter( pParent ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbqt/generator/qt45.qtp b/harbour/contrib/hbqt/generator/qt45.qtp index cdddf70086..4eb8e004bf 100644 --- a/harbour/contrib/hbqt/generator/qt45.qtp +++ b/harbour/contrib/hbqt/generator/qt45.qtp @@ -111,6 +111,8 @@ QPixmap.qth QPoint.qth QPointF.qth QPrintDialog.qth +QPrintEngine.qth +QPrinter.qth QPrintPreviewDialog.qth QProgressBar.qth QProgressDialog.qth diff --git a/harbour/contrib/hbqt/hbqt.ch b/harbour/contrib/hbqt/hbqt.ch index 182ea86193..1aca1449c4 100644 --- a/harbour/contrib/hbqt/hbqt.ch +++ b/harbour/contrib/hbqt/hbqt.ch @@ -1685,45 +1685,233 @@ #define QFont_Black 87 -#define QFileDialog_AcceptOpen 0 -#define QFileDialog_AcceptSave 1 +#define QFileDialog_AcceptOpen 0 +#define QFileDialog_AcceptSave 1 // enum #define QFileDialog_DialogLabel // -#define QFileDialog_LookIn 0 -#define QFileDialog_FileName 1 -#define QFileDialog_FileType 2 -#define QFileDialog_Accept 3 -#define QFileDialog_Reject 4 +#define QFileDialog_LookIn 0 +#define QFileDialog_FileName 1 +#define QFileDialog_FileType 2 +#define QFileDialog_Accept 3 +#define QFileDialog_Reject 4 // enum #define QFileDialog_FileMode // This enum is used to indicate what the user may select in the file dialog; // i.e. what the dialog will return if the user clicks OK. // -#define QFileDialog_AnyFile 0 // The name of a file, whether it exists or not. -#define QFileDialog_ExistingFile 1 // The name of a single existing file. -#define QFileDialog_Directory 2 // The name of a directory. Both files and directories are displayed. -#define QFileDialog_ExistingFiles 3 // The names of zero or more existing files. +#define QFileDialog_AnyFile 0 // The name of a file, whether it exists or not. +#define QFileDialog_ExistingFile 1 // The name of a single existing file. +#define QFileDialog_Directory 2 // The name of a directory. Both files and directories are displayed. +#define QFileDialog_ExistingFiles 3 // The names of zero or more existing files. // The Options type is a typedef for QFlags