summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2007-10-09 14:17:32 +0000
committerKurt Zenker <kz@openoffice.org>2007-10-09 14:17:32 +0000
commit637f19dfea2c3c1ef580b911e1df846fc5d27392 (patch)
tree6aaa0cb8ad81c8a67db416272e799cbfb15d40fa /vcl
parent7c36a21c8e1a285007a80048189c49605aec3bc3 (diff)
INTEGRATION: CWS aquavcl03 (1.2.12); FILE MERGED
2007/09/14 14:18:41 pl 1.2.12.1: #i81585# cocoa printing
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/vcl/impprn.hxx52
1 files changed, 44 insertions, 8 deletions
diff --git a/vcl/inc/vcl/impprn.hxx b/vcl/inc/vcl/impprn.hxx
index 1bd5d3464f9a..f57e30248dfb 100644
--- a/vcl/inc/vcl/impprn.hxx
+++ b/vcl/inc/vcl/impprn.hxx
@@ -4,9 +4,9 @@
*
* $RCSfile: impprn.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: rt $ $Date: 2007-07-24 10:00:31 $
+ * last change: $Author: kz $ $Date: 2007-10-09 15:17:32 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -53,16 +53,39 @@ struct QueuePage;
// - ImplQPrinter -
// ----------------
+/*
+ ImplQPrinter is on most systems a simple buffer that allows a potential
+ lengthy print job to be printed in the background. For this it saves all
+ normal drawing operations for each printed page to a metafile, then spooling
+ the metafiles timer based to a normal printer. The application can act in the meantime
+ including changing the original document without influencing the print job.
+
+ On some systems (currently Mac/Aqua Cocoa) ImplQPrinter has the additional
+ purpose of adapting to the print system: here theprint systems starts a
+ job and will not return from that function until it has ended; to do so
+ it queries for each consecutive page to be printed. Also the Cocoa print system
+ needs to know the number of pages BEFORE starting a print job. Since our Printer
+ does not know that, we need to do the completing spooling to ImplQPrinter before
+ we can actually print to the real print system. Let's call this the pull model
+ instead of the push model (because the systems pulls the pages).
+*/
+
class ImplQPrinter : public Printer, public vcl::DeletionNotifier
{
private:
Printer* mpParent;
Queue* mpQueue;
AutoTimer maTimer;
- BOOL mbAborted;
- BOOL mbUserCopy;
- BOOL mbDestroyAllowed;
- BOOL mbDestroyed;
+ bool mbAborted;
+ bool mbUserCopy;
+ bool mbDestroyAllowed;
+ bool mbDestroyed;
+
+ GDIMetaFile maCurPageMetaFile;
+ long mnMaxBmpDPIX;
+ long mnMaxBmpDPIY;
+ ULONG mnRestoreDrawMode;
+ int mnCurCopyCount;
DECL_LINK( ImplPrintHdl, Timer* );
@@ -73,6 +96,9 @@ private:
ImplQPrinter( const ImplQPrinter& rPrinter );
Printer& operator =( const ImplQPrinter& rPrinter );
+ void PrePrintPage( QueuePage* );
+ void PostPrintPage();
+
public:
ImplQPrinter( Printer* pParent );
@@ -83,8 +109,18 @@ public:
void AbortQueuePrint();
void AddQueuePage( GDIMetaFile* pPage, USHORT nPage, BOOL bNewJobSetup );
- BOOL IsUserCopy() const { return mbUserCopy; }
- void SetUserCopy( BOOL bSet ) { mbUserCopy = bSet; }
+ bool IsUserCopy() const { return mbUserCopy; }
+ void SetUserCopy( bool bSet ) { mbUserCopy = bSet; }
+
+ /**
+ used by pull implementation to emit the next page
+ */
+ void PrintNextPage();
+ /**
+ used by pull implementation to get the number of physical pages
+ (that is how often PrintNextPage should be called)
+ */
+ ULONG GetPrintPageCount();
};
#endif // _SV_IMPPRN_HXX