2007-04-11 17:03:48 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-11 06:50:13 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2007-04-11 17:03:48 +00:00
|
|
|
*
|
2008-04-11 06:50:13 +00:00
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2007-04-11 17:03:48 +00:00
|
|
|
*
|
2008-04-11 06:50:13 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2007-04-11 17:03:48 +00:00
|
|
|
*
|
2008-04-11 06:50:13 +00:00
|
|
|
* $RCSfile: print.hxx,v $
|
2008-10-01 13:31:44 +00:00
|
|
|
* $Revision: 1.6.86.1 $
|
2007-04-11 17:03:48 +00:00
|
|
|
*
|
2008-04-11 06:50:13 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2007-04-11 17:03:48 +00:00
|
|
|
*
|
2008-04-11 06:50:13 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2007-04-11 17:03:48 +00:00
|
|
|
*
|
2008-04-11 06:50:13 +00:00
|
|
|
* OpenOffice.org 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 Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2007-04-11 17:03:48 +00:00
|
|
|
*
|
2008-04-11 06:50:13 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2007-04-11 17:03:48 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _SV_PRINT_HXX
|
|
|
|
#define _SV_PRINT_HXX
|
|
|
|
|
2008-10-01 18:22:22 +00:00
|
|
|
#include "tools/errcode.hxx"
|
|
|
|
#include "vcl/sv.h"
|
|
|
|
#include "vcl/dllapi.h"
|
|
|
|
#include "vcl/outdev.hxx"
|
|
|
|
#include "vcl/prntypes.hxx"
|
|
|
|
#include "vcl/jobset.hxx"
|
|
|
|
#include "vcl/gdimtf.hxx"
|
|
|
|
#include "tools/stream.hxx"
|
|
|
|
#include "tools/multisel.hxx"
|
|
|
|
|
2008-10-30 14:31:29 +00:00
|
|
|
#include "com/sun/star/beans/PropertyValue.hpp"
|
2008-10-01 18:22:22 +00:00
|
|
|
|
|
|
|
#include <boost/shared_ptr.hpp>
|
2007-04-11 17:03:48 +00:00
|
|
|
|
|
|
|
struct SalPrinterInfoQueue;
|
|
|
|
class SalInfoPrinter;
|
|
|
|
struct SalPrinterQueueInfo;
|
|
|
|
class SalPrinter;
|
|
|
|
class VirtualDevice;
|
|
|
|
class Window;
|
|
|
|
class ImplQPrinter;
|
2007-12-12 14:03:58 +00:00
|
|
|
struct ImplPrivatePrinterData;
|
2007-04-11 17:03:48 +00:00
|
|
|
|
2008-10-01 18:22:22 +00:00
|
|
|
namespace vcl {
|
|
|
|
class PrinterListener;
|
|
|
|
class PrintDialog;
|
|
|
|
}
|
2007-04-11 17:03:48 +00:00
|
|
|
|
|
|
|
// -----------------
|
|
|
|
// - Printer-Types -
|
|
|
|
// -----------------
|
|
|
|
|
|
|
|
#define PAGEQUEUE_ALLPAGES 0xFFFF
|
|
|
|
|
|
|
|
enum PrinterSupport { SUPPORT_SET_ORIENTATION, SUPPORT_SET_PAPERBIN,
|
|
|
|
SUPPORT_SET_PAPERSIZE, SUPPORT_SET_PAPER,
|
|
|
|
SUPPORT_COPY, SUPPORT_COLLATECOPY,
|
|
|
|
SUPPORT_SETUPDIALOG, SUPPORT_FAX, SUPPORT_PDF };
|
|
|
|
|
|
|
|
// ---------------
|
|
|
|
// - PrinterPage -
|
|
|
|
// ---------------
|
|
|
|
|
|
|
|
class VCL_DLLPUBLIC PrinterPage
|
|
|
|
{
|
|
|
|
GDIMetaFile* mpMtf;
|
|
|
|
JobSetup maJobSetup;
|
|
|
|
UINT16 mbNewJobSetup;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
PrinterPage() : mpMtf( new GDIMetaFile() ) {}
|
|
|
|
PrinterPage( GDIMetaFile* pMtf, BOOL bNewJobSetup, const JobSetup& rSetup ) :
|
|
|
|
mpMtf( pMtf ), maJobSetup( rSetup ), mbNewJobSetup( bNewJobSetup ) {}
|
|
|
|
~PrinterPage() { delete mpMtf; }
|
|
|
|
|
|
|
|
GDIMetaFile* GetGDIMetaFile() const { return mpMtf; }
|
|
|
|
const JobSetup& GetJobSetup() const { return maJobSetup; }
|
|
|
|
BOOL IsNewJobSetup() const { return (mbNewJobSetup != 0); }
|
|
|
|
|
|
|
|
friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const PrinterPage& rPage )
|
|
|
|
{ rOStm << rPage.mbNewJobSetup; rOStm << rPage.maJobSetup; rPage.mpMtf->Write( rOStm ); return rOStm; }
|
|
|
|
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, PrinterPage& rPage )
|
|
|
|
{ return rIStm >> rPage.mbNewJobSetup >> rPage.maJobSetup >> *rPage.mpMtf; }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// -------------
|
|
|
|
// - QueueInfo -
|
|
|
|
// -------------
|
|
|
|
|
|
|
|
class VCL_DLLPUBLIC QueueInfo
|
|
|
|
{
|
|
|
|
friend class Printer;
|
|
|
|
|
|
|
|
private:
|
|
|
|
XubString maPrinterName;
|
|
|
|
XubString maDriver;
|
|
|
|
XubString maLocation;
|
|
|
|
XubString maComment;
|
|
|
|
sal_uInt32 mnStatus;
|
|
|
|
sal_uInt32 mnJobs;
|
|
|
|
|
|
|
|
public:
|
|
|
|
QueueInfo();
|
|
|
|
QueueInfo( const QueueInfo& rInfo );
|
|
|
|
~QueueInfo();
|
|
|
|
|
|
|
|
const XubString& GetPrinterName() const { return maPrinterName; }
|
|
|
|
const XubString& GetDriver() const { return maDriver; }
|
|
|
|
const XubString& GetLocation() const { return maLocation; }
|
|
|
|
const XubString& GetComment() const { return maComment; }
|
|
|
|
sal_uInt32 GetStatus() const { return mnStatus; }
|
|
|
|
sal_uInt32 GetJobs() const { return mnJobs; }
|
|
|
|
|
|
|
|
bool operator==( const QueueInfo& rInfo ) const;
|
|
|
|
|
|
|
|
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStream, QueueInfo& rInfo );
|
|
|
|
friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStream, const QueueInfo& rInfo );
|
|
|
|
};
|
|
|
|
|
|
|
|
// ------------------
|
|
|
|
// - PrinterOptions -
|
|
|
|
// ------------------
|
|
|
|
|
|
|
|
enum PrinterTransparencyMode
|
|
|
|
{
|
|
|
|
PRINTER_TRANSPARENCY_AUTO = 0,
|
|
|
|
PRINTER_TRANSPARENCY_NONE = 1
|
|
|
|
};
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
enum PrinterGradientMode
|
|
|
|
{
|
|
|
|
PRINTER_GRADIENT_STRIPES = 0,
|
|
|
|
PRINTER_GRADIENT_COLOR = 1
|
|
|
|
};
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
enum PrinterBitmapMode
|
|
|
|
{
|
|
|
|
PRINTER_BITMAP_OPTIMAL = 0,
|
|
|
|
PRINTER_BITMAP_NORMAL = 1,
|
|
|
|
PRINTER_BITMAP_RESOLUTION = 2
|
|
|
|
};
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class VCL_DLLPUBLIC PrinterOptions
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
|
|
|
|
BOOL mbReduceTransparency;
|
|
|
|
PrinterTransparencyMode meReducedTransparencyMode;
|
|
|
|
BOOL mbReduceGradients;
|
|
|
|
PrinterGradientMode meReducedGradientsMode;
|
|
|
|
USHORT mnReducedGradientStepCount;
|
|
|
|
BOOL mbReduceBitmaps;
|
|
|
|
PrinterBitmapMode meReducedBitmapMode;
|
|
|
|
USHORT mnReducedBitmapResolution;
|
|
|
|
BOOL mbReducedBitmapsIncludeTransparency;
|
|
|
|
BOOL mbConvertToGreyscales;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
PrinterOptions();
|
|
|
|
~PrinterOptions();
|
|
|
|
|
|
|
|
BOOL IsReduceTransparency() const { return mbReduceTransparency; }
|
|
|
|
void SetReduceTransparency( BOOL bSet ) { mbReduceTransparency = bSet; }
|
|
|
|
|
|
|
|
PrinterTransparencyMode GetReducedTransparencyMode() const { return meReducedTransparencyMode; }
|
|
|
|
void SetReducedTransparencyMode( PrinterTransparencyMode eMode ) { meReducedTransparencyMode = eMode; }
|
|
|
|
|
|
|
|
BOOL IsReduceGradients() const { return mbReduceGradients; }
|
|
|
|
void SetReduceGradients( BOOL bSet ) { mbReduceGradients = bSet; }
|
|
|
|
|
|
|
|
PrinterGradientMode GetReducedGradientMode() const { return meReducedGradientsMode; }
|
|
|
|
void SetReducedGradientMode( PrinterGradientMode eMode ) { meReducedGradientsMode = eMode; }
|
|
|
|
|
|
|
|
USHORT GetReducedGradientStepCount() const { return mnReducedGradientStepCount; }
|
|
|
|
void SetReducedGradientStepCount( USHORT nStepCount ) { mnReducedGradientStepCount = nStepCount; }
|
|
|
|
|
|
|
|
BOOL IsReduceBitmaps() const { return mbReduceBitmaps; }
|
|
|
|
void SetReduceBitmaps( BOOL bSet ) { mbReduceBitmaps = bSet; }
|
|
|
|
|
|
|
|
PrinterBitmapMode GetReducedBitmapMode() const { return meReducedBitmapMode; }
|
|
|
|
void SetReducedBitmapMode( PrinterBitmapMode eMode ) { meReducedBitmapMode = eMode; }
|
|
|
|
|
|
|
|
USHORT GetReducedBitmapResolution() const { return mnReducedBitmapResolution; }
|
|
|
|
void SetReducedBitmapResolution( USHORT nResolution ) { mnReducedBitmapResolution = nResolution; }
|
|
|
|
|
|
|
|
BOOL IsReducedBitmapIncludesTransparency() const { return mbReducedBitmapsIncludeTransparency; }
|
|
|
|
void SetReducedBitmapIncludesTransparency( BOOL bSet ) { mbReducedBitmapsIncludeTransparency = bSet; }
|
|
|
|
|
|
|
|
BOOL IsConvertToGreyscales() const { return mbConvertToGreyscales; }
|
|
|
|
void SetConvertToGreyscales( BOOL bSet ) { mbConvertToGreyscales = bSet; }
|
|
|
|
};
|
|
|
|
|
|
|
|
// -----------
|
|
|
|
// - Printer -
|
|
|
|
// -----------
|
|
|
|
|
|
|
|
class VCL_DLLPUBLIC Printer : public OutputDevice
|
|
|
|
{
|
|
|
|
friend class OutputDevice;
|
|
|
|
friend class ImplQPrinter;
|
|
|
|
|
|
|
|
private:
|
2007-12-12 14:03:58 +00:00
|
|
|
ImplPrivatePrinterData* mpPrinterData;
|
2007-04-11 17:03:48 +00:00
|
|
|
SalInfoPrinter* mpInfoPrinter;
|
|
|
|
SalPrinter* mpPrinter;
|
|
|
|
Printer* mpJobPrinter;
|
|
|
|
SalGraphics* mpJobGraphics;
|
|
|
|
Printer* mpPrev;
|
|
|
|
Printer* mpNext;
|
|
|
|
VirtualDevice* mpDisplayDev;
|
|
|
|
ImplQPrinter* mpQPrinter;
|
|
|
|
GDIMetaFile* mpQMtf;
|
|
|
|
PrinterOptions* mpPrinterOptions;
|
|
|
|
XubString maPrinterName;
|
|
|
|
XubString maDriver;
|
|
|
|
XubString maPrintFile;
|
|
|
|
XubString maJobName;
|
|
|
|
JobSetup maJobSetup;
|
|
|
|
Point maPageOffset;
|
|
|
|
Size maPaperSize;
|
|
|
|
ULONG mnError;
|
|
|
|
USHORT mnCurPage;
|
|
|
|
USHORT mnCurPrintPage;
|
|
|
|
USHORT mnPageQueueSize;
|
|
|
|
USHORT mnCopyCount;
|
|
|
|
BOOL mbDefPrinter;
|
|
|
|
BOOL mbPrinting;
|
|
|
|
BOOL mbJobActive;
|
|
|
|
BOOL mbCollateCopy;
|
|
|
|
BOOL mbPrintFile;
|
|
|
|
BOOL mbInPrintPage;
|
|
|
|
BOOL mbNewJobSetup;
|
|
|
|
BOOL mbIsQueuePrinter;
|
|
|
|
BOOL mbUserSetupCompleted;
|
|
|
|
BOOL mbUserSetupResult;
|
|
|
|
Link maErrorHdl;
|
|
|
|
Link maStartPrintHdl;
|
|
|
|
Link maEndPrintHdl;
|
|
|
|
Link maPrintPageHdl;
|
|
|
|
|
|
|
|
SAL_DLLPRIVATE void ImplInitData();
|
|
|
|
SAL_DLLPRIVATE void ImplInit( SalPrinterQueueInfo* pInfo );
|
|
|
|
SAL_DLLPRIVATE void ImplInitDisplay( const Window* pWindow );
|
|
|
|
SAL_DLLPRIVATE static SalPrinterQueueInfo* ImplGetQueueInfo( const XubString& rPrinterName,
|
|
|
|
const XubString* pDriver );
|
|
|
|
SAL_DLLPRIVATE void ImplUpdatePageData();
|
|
|
|
SAL_DLLPRIVATE void ImplUpdateFontList();
|
|
|
|
SAL_DLLPRIVATE void ImplFindPaperFormatForUserSize( JobSetup& );
|
|
|
|
DECL_DLLPRIVATE_LINK( ImplDestroyPrinterAsync, void* );
|
2008-10-01 18:22:22 +00:00
|
|
|
|
|
|
|
SAL_DLLPRIVATE bool StartJob( const XubString& rJobName, boost::shared_ptr<vcl::PrinterListener>& );
|
|
|
|
|
|
|
|
static SAL_DLLPRIVATE ULONG ImplSalPrinterErrorCodeToVCL( ULONG nError );
|
|
|
|
|
2007-04-11 17:03:48 +00:00
|
|
|
public:
|
|
|
|
SAL_DLLPRIVATE void ImplEndPrint();
|
2007-12-12 14:03:58 +00:00
|
|
|
SAL_DLLPRIVATE void ImplUpdateQuickStatus();
|
2007-04-11 17:03:48 +00:00
|
|
|
private:
|
|
|
|
SAL_DLLPRIVATE Printer( const Printer& rPrinter );
|
|
|
|
SAL_DLLPRIVATE Printer& operator =( const Printer& rPrinter );
|
|
|
|
|
|
|
|
#ifdef _SPOOLPRINTER_EXT
|
|
|
|
public:
|
|
|
|
void DrawGradientEx( OutputDevice* pOut, const Rectangle& rRect, const Gradient& rGradient );
|
|
|
|
void DrawGradientEx( OutputDevice* pOut, const PolyPolygon& rPolyPoly, const Gradient& rGradient );
|
|
|
|
|
|
|
|
#endif // _SPOOLPRINTER_EXT
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
void SetSelfAsQueuePrinter( BOOL bQueuePrinter ) { mbIsQueuePrinter = bQueuePrinter; }
|
|
|
|
BOOL IsQueuePrinter() const { return mbIsQueuePrinter; }
|
|
|
|
|
|
|
|
public:
|
|
|
|
Printer();
|
|
|
|
Printer( const Window* pWindow );
|
|
|
|
Printer( const JobSetup& rJobSetup );
|
|
|
|
Printer( const QueueInfo& rQueueInfo );
|
|
|
|
Printer( const XubString& rPrinterName );
|
|
|
|
virtual ~Printer();
|
|
|
|
|
|
|
|
static const std::vector< rtl::OUString >& GetPrinterQueues();
|
|
|
|
static const QueueInfo* GetQueueInfo( const String& rPrinterName, bool bStatusUpdate );
|
|
|
|
static XubString GetDefaultPrinterName();
|
|
|
|
|
|
|
|
virtual void Error();
|
|
|
|
virtual void StartPrint();
|
|
|
|
virtual void EndPrint();
|
|
|
|
virtual void PrintPage();
|
|
|
|
|
|
|
|
const XubString& GetName() const { return maPrinterName; }
|
|
|
|
const XubString& GetDriverName() const { return maDriver; }
|
|
|
|
BOOL IsDefPrinter() const { return mbDefPrinter; }
|
|
|
|
BOOL IsDisplayPrinter() const { return mpDisplayDev != NULL; }
|
|
|
|
BOOL IsValid() const { return !IsDisplayPrinter(); }
|
|
|
|
|
|
|
|
ULONG GetCapabilities( USHORT nType ) const;
|
|
|
|
BOOL HasSupport( PrinterSupport eFeature ) const;
|
|
|
|
|
|
|
|
BOOL SetJobSetup( const JobSetup& rSetup );
|
|
|
|
const JobSetup& GetJobSetup() const { return maJobSetup; }
|
|
|
|
String GetJobValue( const String& rKey ) const { return maJobSetup.GetValue( rKey ); }
|
|
|
|
void SetJobValue( const String& rKey, const String& rValue ) { maJobSetup.SetValue( rKey, rValue ); }
|
|
|
|
|
|
|
|
BOOL Setup( Window* pWindow = NULL );
|
|
|
|
BOOL SetPrinterProps( const Printer* pPrinter );
|
|
|
|
|
|
|
|
void SetPrinterOptions( const PrinterOptions& rOptions ) { *mpPrinterOptions = rOptions; }
|
|
|
|
const PrinterOptions& GetPrinterOptions() const { return( *mpPrinterOptions ); }
|
|
|
|
|
|
|
|
BOOL SetOrientation( Orientation eOrient );
|
|
|
|
Orientation GetOrientation() const;
|
|
|
|
DuplexMode GetDuplexMode() const;
|
|
|
|
// returns the angle that a landscape page will be turned counterclockwise
|
|
|
|
// wrt to portrait. The return value may be only valid for
|
|
|
|
// the current paper
|
|
|
|
int GetLandscapeAngle() const;
|
|
|
|
BOOL SetPaperBin( USHORT nPaperBin );
|
|
|
|
USHORT GetPaperBin() const;
|
|
|
|
BOOL SetPaper( Paper ePaper );
|
|
|
|
BOOL SetPaperSizeUser( const Size& rSize );
|
|
|
|
Paper GetPaper() const;
|
|
|
|
|
|
|
|
// returns number of available paper formats
|
|
|
|
int GetPaperInfoCount() const;
|
|
|
|
// returns info about paper format nPaper
|
|
|
|
const vcl::PaperInfo& GetPaperInfo( int nPaper ) const;
|
|
|
|
// sets current paper to format contained in rInfo
|
|
|
|
BOOL SetPaperFromInfo( const vcl::PaperInfo& rInfo );
|
|
|
|
// gets info about paper fromat best matching current paper
|
|
|
|
const vcl::PaperInfo& GetCurrentPaperInfo() const;
|
|
|
|
|
|
|
|
USHORT GetPaperBinCount() const;
|
|
|
|
XubString GetPaperBinName( USHORT nPaperBin ) const;
|
|
|
|
|
|
|
|
const Size& GetPaperSizePixel() const { return maPaperSize; }
|
|
|
|
Size GetPaperSize() const { return PixelToLogic( maPaperSize ); }
|
|
|
|
const Point& GetPageOffsetPixel() const { return maPageOffset; }
|
|
|
|
Point GetPageOffset() const { return PixelToLogic( maPageOffset ); }
|
|
|
|
|
|
|
|
BOOL SetCopyCount( USHORT nCopy, BOOL bCollate = FALSE );
|
|
|
|
USHORT GetCopyCount() const { return mnCopyCount; }
|
|
|
|
BOOL IsCollateCopy() const { return mbCollateCopy; }
|
|
|
|
|
|
|
|
USHORT GetCurPrintPage() const { return mnCurPrintPage; }
|
|
|
|
BOOL IsPrinting() const { return mbPrinting; }
|
|
|
|
|
|
|
|
void SetPrintFile( const XubString& rFileName ) { maPrintFile = rFileName; }
|
|
|
|
const XubString& GetPrintFile() const { return maPrintFile; }
|
|
|
|
void EnablePrintFile( BOOL bEnable ) { mbPrintFile = bEnable; }
|
|
|
|
BOOL IsPrintFileEnabled() const { return mbPrintFile; }
|
|
|
|
BOOL StartJob( const XubString& rJobName );
|
|
|
|
BOOL EndJob();
|
|
|
|
BOOL AbortJob();
|
|
|
|
const XubString& GetCurJobName() const { return maJobName; }
|
|
|
|
USHORT GetCurPage() const { return mnCurPage; }
|
|
|
|
BOOL IsJobActive() const { return mbJobActive; }
|
|
|
|
BOOL StartPage();
|
|
|
|
BOOL EndPage();
|
|
|
|
|
|
|
|
void SetPageQueueSize( USHORT nPages ) { mnPageQueueSize = nPages; }
|
|
|
|
USHORT GetPageQueueSize() const { return mnPageQueueSize; }
|
|
|
|
|
|
|
|
ULONG GetError() const { return ERRCODE_TOERROR(mnError); }
|
|
|
|
ULONG GetErrorCode() const { return mnError; }
|
|
|
|
|
|
|
|
void SetErrorHdl( const Link& rLink ) { maErrorHdl = rLink; }
|
|
|
|
const Link& GetErrorHdl() const { return maErrorHdl; }
|
|
|
|
void SetStartPrintHdl( const Link& rLink ) { maStartPrintHdl = rLink; }
|
|
|
|
const Link& GetStartPrintHdl() const { return maStartPrintHdl; }
|
|
|
|
void SetEndPrintHdl( const Link& rLink ) { maEndPrintHdl = rLink; }
|
|
|
|
const Link& GetEndPrintHdl() const { return maEndPrintHdl; }
|
|
|
|
void SetPrintPageHdl( const Link& rLink ) { maPrintPageHdl = rLink; }
|
|
|
|
const Link& GetPrintPageHdl() const { return maPrintPageHdl; }
|
|
|
|
|
2007-06-20 09:13:13 +00:00
|
|
|
void Compat_OldPrinterMetrics( bool bSet );
|
|
|
|
|
2007-12-12 14:03:58 +00:00
|
|
|
/** Notify that the next StartJob belongs to a UI less "direct print" job
|
|
|
|
*
|
|
|
|
* deprecated: the canonical way to notify a UI less job is to set the
|
|
|
|
* JobSetup value "IsQuickJob" to "true". If set at all, the "IsQuickJob" value
|
|
|
|
* on JobSetup will be preferred. However if no "IsQuickJob" value is set,
|
|
|
|
* setting SetNextJobIsQuick will cause the following StartJob to set this value
|
|
|
|
* to "true" in the current JobSetup.
|
2009-02-11 10:53:35 +00:00
|
|
|
*
|
|
|
|
* the paramter can be set to "false" again in case a job was not started and the
|
|
|
|
* printer is to be reused.
|
2007-12-12 14:03:58 +00:00
|
|
|
*/
|
2009-02-11 10:53:35 +00:00
|
|
|
void SetNextJobIsQuick( bool bQuick = true );
|
2007-12-12 14:03:58 +00:00
|
|
|
|
2007-04-11 17:03:48 +00:00
|
|
|
/** checks the printer list and updates it necessary
|
|
|
|
*
|
|
|
|
* sends a DataChanged event of type DATACHANGED_PRINTER
|
|
|
|
* if the printer list changed
|
|
|
|
*/
|
|
|
|
static void updatePrinters();
|
2008-10-01 18:22:22 +00:00
|
|
|
|
|
|
|
/** execute a print job
|
|
|
|
|
|
|
|
starts a print job asynchronously (that is will return
|
|
|
|
|
|
|
|
*/
|
|
|
|
static void PrintJob( const boost::shared_ptr<vcl::PrinterListener>& i_pListener,
|
2008-10-30 14:31:29 +00:00
|
|
|
const JobSetup& i_rInitSetup
|
2008-10-01 18:22:22 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
// implementation detail of PrintJob being asynchronous
|
|
|
|
// not exported, not usable outside vcl
|
|
|
|
static void SAL_DLLPRIVATE ImplPrintJob( const boost::shared_ptr<vcl::PrinterListener>& i_pListener,
|
2008-10-30 14:31:29 +00:00
|
|
|
const JobSetup& i_rInitSetup
|
2008-10-01 18:22:22 +00:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
namespace vcl
|
|
|
|
{
|
|
|
|
class ImplPrinterListenerData;
|
|
|
|
|
|
|
|
class VCL_DLLPUBLIC PrinterListener
|
|
|
|
{
|
|
|
|
ImplPrinterListenerData* mpImplData;
|
|
|
|
public:
|
|
|
|
PrinterListener();
|
|
|
|
virtual ~PrinterListener();
|
|
|
|
|
|
|
|
const boost::shared_ptr<Printer>& getPrinter() const;
|
2008-10-30 14:31:29 +00:00
|
|
|
/* for implementations: get current job properties as changed by e.g. print dialog
|
|
|
|
this gets the current set of properties initially told to Printer::PrintJob
|
|
|
|
|
|
|
|
For convenience a second sequence will be merged in to get a combined sequence.
|
|
|
|
In case of duplicate property names, the value of i_MergeList wins.
|
|
|
|
*/
|
|
|
|
com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >
|
|
|
|
getJobProperties( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& i_rMergeList ) const;
|
|
|
|
|
|
|
|
/* get the PorpertyValue of a Property
|
|
|
|
*/
|
|
|
|
com::sun::star::beans::PropertyValue* getValue( const rtl::OUString& rPropertyName );
|
2009-03-16 15:13:59 +00:00
|
|
|
const com::sun::star::beans::PropertyValue* getValue( const rtl::OUString& rPropertyName ) const;
|
2008-10-30 14:31:29 +00:00
|
|
|
|
|
|
|
/* return the currently active UI options. These are the same passed to setUIOptions.
|
|
|
|
*/
|
|
|
|
const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& getUIOptions() const;
|
|
|
|
/* set possible UI options. should only be done once before passing the PrinterListener
|
|
|
|
to Printer::PrintJob
|
|
|
|
*/
|
|
|
|
void setUIOptions( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& );
|
|
|
|
/* enable/disable an option; this can be used to implement dialog logic.
|
|
|
|
*/
|
|
|
|
void enableUIOption( const rtl::OUString& rPropName, bool bEnable );
|
|
|
|
bool isUIOptionEnabled( const rtl::OUString& rPropName ) const;
|
|
|
|
|
2008-10-01 18:22:22 +00:00
|
|
|
virtual int getPageCount() const = 0; // must be overloaded by the app
|
|
|
|
/* get the page parameters, namely the jobsetup that should be active for the page
|
|
|
|
(describing among others the physical page size) and the "page size". In writer
|
|
|
|
case this would probably be the same as the JobSetup since writer sets the page size
|
|
|
|
draw/impress for example print their page on the paper set on the printer,
|
|
|
|
possibly adjusting the page size to fit. That means the page size can be different from
|
|
|
|
the paper size.
|
|
|
|
*/
|
2008-10-30 14:31:29 +00:00
|
|
|
// must be overloaded by the app, return page size in 1/100th mm
|
|
|
|
virtual com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > getPageParameters( int i_nPage ) const = 0;
|
2008-10-01 18:22:22 +00:00
|
|
|
virtual void printPage( int i_nPage ) const = 0; // must be overloaded by the app
|
|
|
|
virtual void jobFinished(); // optionally release resources bound to the job
|
|
|
|
|
2009-03-18 14:46:10 +00:00
|
|
|
// implementation details, not usable outside vcl
|
2009-03-27 12:57:53 +00:00
|
|
|
int SAL_DLLPRIVATE getFilteredPageCount();
|
|
|
|
Size SAL_DLLPRIVATE getPageFile( int i_inUnfilteredPage, GDIMetaFile& rMtf );
|
|
|
|
Size SAL_DLLPRIVATE getFilteredPageFile( int i_nFilteredPage, GDIMetaFile& o_rMtf );
|
2009-03-18 14:46:10 +00:00
|
|
|
void SAL_DLLPRIVATE printFilteredPage( int i_nPage );
|
2008-10-01 18:22:22 +00:00
|
|
|
void SAL_DLLPRIVATE setPrinter( const boost::shared_ptr<Printer>& );
|
2008-10-30 14:31:29 +00:00
|
|
|
void SAL_DLLPRIVATE setOptionChangeHdl( const Link& );
|
2009-03-18 14:46:10 +00:00
|
|
|
void SAL_DLLPRIVATE createProgressDialog();
|
2009-03-24 13:59:11 +00:00
|
|
|
void SAL_DLLPRIVATE setPrintSelection( const rtl::OUString& );
|
2009-03-28 08:52:14 +00:00
|
|
|
void SAL_DLLPRIVATE setMultipage( int nRows, int nColumns, const Size& rPaperSize );
|
2007-04-11 17:03:48 +00:00
|
|
|
};
|
|
|
|
|
2008-10-01 18:22:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-04-11 17:03:48 +00:00
|
|
|
#endif // _SV_PRINT_HXX
|