2003-07-31 23:52:10 +00:00
|
|
|
/** <title>NSPrintOperation</title>
|
|
|
|
|
|
|
|
<abstract>Controls generation of EPS, PDF or PS print jobs.</abstract>
|
|
|
|
|
2004-07-10 10:19:34 +00:00
|
|
|
Copyright (C) 1996,2001,2004 Free Software Foundation, Inc.
|
2003-07-31 23:52:10 +00:00
|
|
|
|
|
|
|
Author: Scott Christley <scottc@net-community.com>
|
|
|
|
Date: 1996
|
|
|
|
Author: Fred Kiefer <FredKiefer@gmx.de>
|
|
|
|
Date: November 2000
|
|
|
|
Updated to new specification
|
|
|
|
Author: Adam Fedor <fedor@gnu.org>
|
|
|
|
Date: Oct 2001
|
2004-07-10 10:19:34 +00:00
|
|
|
Modified for Printing Backend Support
|
|
|
|
Author: Chad Hardin <cehardin@mac.com>
|
|
|
|
Date: June 2004
|
2003-07-31 23:52:10 +00:00
|
|
|
|
|
|
|
This file is part of the GNUstep GUI Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library 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
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
|
|
License along with this library; see the file COPYING.LIB.
|
|
|
|
If not, write to the Free Software Foundation,
|
2005-05-26 02:52:46 +00:00
|
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2003-07-31 23:52:10 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _GNUstep_H_NSPrintOperation
|
|
|
|
#define _GNUstep_H_NSPrintOperation
|
|
|
|
|
|
|
|
#include <Foundation/NSObject.h>
|
|
|
|
#include <Foundation/NSGeometry.h>
|
|
|
|
|
|
|
|
@class NSString;
|
|
|
|
@class NSData;
|
|
|
|
@class NSMutableData;
|
|
|
|
|
|
|
|
@class NSView;
|
2004-02-11 16:34:17 +00:00
|
|
|
@class NSWindow;
|
2003-07-31 23:52:10 +00:00
|
|
|
@class NSPrintInfo;
|
|
|
|
@class NSPrintPanel;
|
|
|
|
@class NSGraphicsContext;
|
|
|
|
|
|
|
|
typedef enum _NSPrintingPageOrder {
|
|
|
|
NSDescendingPageOrder,
|
|
|
|
NSSpecialPageOrder,
|
|
|
|
NSAscendingPageOrder,
|
|
|
|
NSUnknownPageOrder
|
|
|
|
} NSPrintingPageOrder;
|
|
|
|
|
|
|
|
@interface NSPrintOperation : NSObject
|
|
|
|
{
|
|
|
|
// Attributes
|
|
|
|
NSPrintInfo *_printInfo;
|
|
|
|
NSView *_view;
|
|
|
|
NSRect _rect;
|
|
|
|
NSMutableData *_data;
|
|
|
|
NSString *_path;
|
|
|
|
NSGraphicsContext *_context;
|
|
|
|
NSPrintPanel *_printPanel;
|
|
|
|
NSView *_accessoryView;
|
|
|
|
NSPrintingPageOrder _pageOrder;
|
|
|
|
BOOL _showPanels;
|
2004-07-10 10:19:34 +00:00
|
|
|
//BOOL _pathSet; removed, just test _path for nil
|
2003-07-31 23:52:10 +00:00
|
|
|
int _currentPage;
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Creating and Initializing an NSPrintOperation Object
|
|
|
|
//
|
|
|
|
+ (NSPrintOperation *)EPSOperationWithView:(NSView *)aView
|
2004-07-22 04:59:09 +00:00
|
|
|
insideRect:(NSRect)rect
|
|
|
|
toData:(NSMutableData *)data;
|
2003-07-31 23:52:10 +00:00
|
|
|
+ (NSPrintOperation *)EPSOperationWithView:(NSView *)aView
|
2004-07-22 04:59:09 +00:00
|
|
|
insideRect:(NSRect)rect
|
|
|
|
toData:(NSMutableData *)data
|
|
|
|
printInfo:(NSPrintInfo *)aPrintInfo;
|
2003-07-31 23:52:10 +00:00
|
|
|
+ (NSPrintOperation *)EPSOperationWithView:(NSView *)aView
|
2004-07-22 04:59:09 +00:00
|
|
|
insideRect:(NSRect)rect
|
|
|
|
toPath:(NSString *)path
|
|
|
|
printInfo:(NSPrintInfo *)aPrintInfo;
|
2003-07-31 23:52:10 +00:00
|
|
|
|
|
|
|
+ (NSPrintOperation *)printOperationWithView:(NSView *)aView;
|
|
|
|
+ (NSPrintOperation *)printOperationWithView:(NSView *)aView
|
2004-07-22 04:59:09 +00:00
|
|
|
printInfo:(NSPrintInfo *)aPrintInfo;
|
2003-07-31 23:52:10 +00:00
|
|
|
|
|
|
|
#ifndef STRICT_OPENSTEP
|
|
|
|
+ (NSPrintOperation *)PDFOperationWithView:(NSView *)aView
|
2004-07-22 04:59:09 +00:00
|
|
|
insideRect:(NSRect)rect
|
|
|
|
toData:(NSMutableData *)data;
|
2003-07-31 23:52:10 +00:00
|
|
|
+ (NSPrintOperation *)PDFOperationWithView:(NSView *)aView
|
2004-07-22 04:59:09 +00:00
|
|
|
insideRect:(NSRect)rect
|
|
|
|
toData:(NSMutableData *)data
|
|
|
|
printInfo:(NSPrintInfo*)aPrintInfo;
|
2003-07-31 23:52:10 +00:00
|
|
|
+ (NSPrintOperation *)PDFOperationWithView:(NSView *)aView
|
2004-07-22 04:59:09 +00:00
|
|
|
insideRect:(NSRect)rect
|
|
|
|
toPath:(NSString *)path
|
|
|
|
printInfo:(NSPrintInfo*)aPrintInfo;
|
2003-07-31 23:52:10 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
- (id)initEPSOperationWithView:(NSView *)aView
|
2004-07-22 04:59:09 +00:00
|
|
|
insideRect:(NSRect)rect
|
|
|
|
toData:(NSMutableData *)data
|
|
|
|
printInfo:(NSPrintInfo *)aPrintInfo;
|
2003-07-31 23:52:10 +00:00
|
|
|
- (id)initWithView:(NSView *)aView
|
2004-07-22 04:59:09 +00:00
|
|
|
printInfo:(NSPrintInfo *)aPrintInfo;
|
2003-07-31 23:52:10 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Setting the Print Operation
|
|
|
|
//
|
|
|
|
+ (NSPrintOperation *)currentOperation;
|
|
|
|
+ (void)setCurrentOperation:(NSPrintOperation *)operation;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Determining the Type of Operation
|
|
|
|
//
|
|
|
|
- (BOOL)isEPSOperation;
|
|
|
|
|
|
|
|
#ifndef STRICT_OPENSTEP
|
|
|
|
- (BOOL)isCopyingOperation;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//
|
|
|
|
// Controlling the User Interface
|
|
|
|
//
|
|
|
|
- (NSPrintPanel *)printPanel;
|
|
|
|
- (BOOL)showPanels;
|
|
|
|
- (void)setPrintPanel:(NSPrintPanel *)panel;
|
|
|
|
- (void)setShowPanels:(BOOL)flag;
|
|
|
|
|
|
|
|
#ifndef STRICT_OPENSTEP
|
|
|
|
- (NSView *)accessoryView;
|
|
|
|
- (void)setAccessoryView:(NSView *)aView;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//
|
|
|
|
// Managing the DPS Context
|
|
|
|
//
|
|
|
|
- (NSGraphicsContext *)createContext;
|
|
|
|
- (NSGraphicsContext *)context;
|
|
|
|
- (void)destroyContext;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Page Information
|
|
|
|
//
|
|
|
|
- (int)currentPage;
|
|
|
|
- (NSPrintingPageOrder)pageOrder;
|
|
|
|
- (void)setPageOrder:(NSPrintingPageOrder)order;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Running a Print Operation
|
|
|
|
//
|
|
|
|
- (void)cleanUpOperation;
|
|
|
|
- (BOOL)deliverResult;
|
|
|
|
- (BOOL)runOperation;
|
|
|
|
#ifndef STRICT_OPENSTEP
|
|
|
|
- (void)runOperationModalForWindow: (NSWindow *)docWindow
|
2004-07-22 04:59:09 +00:00
|
|
|
delegate: (id)delegate
|
|
|
|
didRunSelector: (SEL)didRunSelector
|
|
|
|
contextInfo:(void *)contextInfo;
|
2003-07-31 23:52:10 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
//
|
|
|
|
// Getting the NSPrintInfo Object
|
|
|
|
//
|
|
|
|
- (NSPrintInfo *)printInfo;
|
|
|
|
- (void)setPrintInfo:(NSPrintInfo *)aPrintInfo;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Getting the NSView Object
|
|
|
|
//
|
|
|
|
- (NSView *)view;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
2004-07-10 10:19:34 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Private method used by the NSPrintOperation subclasses
|
|
|
|
// such as GSEPSPrintOperation, GSPDFPrintOperation. This
|
|
|
|
// also includes GSPrintOperation, which is used in the printing
|
|
|
|
// backend system. Printing bundles subclass GSPrintOperation
|
|
|
|
// and use that to interface with the native printing system.
|
|
|
|
//
|
|
|
|
@interface NSPrintOperation (Private)
|
|
|
|
|
|
|
|
- (id) initWithView:(NSView *)aView
|
2004-07-22 04:59:09 +00:00
|
|
|
insideRect:(NSRect)rect
|
|
|
|
toData:(NSMutableData *)data
|
|
|
|
printInfo:(NSPrintInfo *)aPrintInfo;
|
2004-07-10 10:19:34 +00:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
2003-07-31 23:52:10 +00:00
|
|
|
#endif // _GNUstep_H_NSPrintOperation
|