home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / OpenStepConversion / IntermediateFrameworks4 / AppKit.framework / Headers / NSPrintInfo.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-29  |  6.3 KB  |  151 lines

  1. /*
  2.     PrintInfo.h
  3.     Application Kit, Release 2.0
  4.     Copyright (c) 1988, 1989, 1990, NeXT, Inc.  All rights reserved. 
  5. */
  6.  
  7. /*
  8. NSPrintInfo is a data container for parameters that help control the generation of PostScript output.  It is passed to the NSPrintOperation object, which makes a copy of it to use during the operation.
  9. */
  10.  
  11. #import <Foundation/NSObject.h>
  12. #import "NSGraphics.h"
  13.  
  14. @class NSPrinter;
  15.  
  16. typedef enum _NSPrintingOrientation {
  17.     NSPortraitOrientation        = 0,
  18.     NSLandscapeOrientation        = 1
  19. } NSPrintingOrientation;
  20.  
  21. typedef enum _NSPrintingPaginationMode {
  22.     NSAutoPagination            = 0,
  23.     NSFitPagination            = 1, // Force image to fit on one page
  24.     NSClipPagination            = 2  // Let image be clipped by page
  25. } NSPrintingPaginationMode;
  26.  
  27.  
  28. @interface NSPrintInfo : NSObject < NSCopying, NSCoding >
  29. {
  30. @private
  31.     NSMutableDictionary    *dictionary;
  32. }
  33.  
  34. /* Set/get the paper attributes.  The set methods in this group may change other values in the group to keep all three values (type, size, and orientation) consistent.  To avoid this behavior, set the values in the dictionary directly.
  35.  */
  36. - setPaperName:(NSString *)name;
  37. - (NSString *)paperName;
  38. - setPaperSize:(NSSize)aSize;
  39. - (NSSize)paperSize;
  40. - setOrientation:(NSPrintingOrientation)orientation;
  41. - (NSPrintingOrientation)orientation;
  42.  
  43. - (void)setLeftMargin:(float)margin;
  44. - (void)setRightMargin:(float)margin;
  45. - (void)setTopMargin:(float)margin;
  46. - (void)setBottomMargin:(float)margin;
  47. - (float)leftMargin;
  48. - (float)rightMargin;
  49. - (float)topMargin;
  50. - (float)bottomMargin;
  51. - setHorizCentered:(BOOL)flag;
  52. - (BOOL)isHorizCentered;
  53. - setVertCentered:(BOOL)flag;
  54. - (BOOL)isVertCentered;
  55. - setHorizPagination:(NSPrintingPaginationMode)mode;
  56. - (NSPrintingPaginationMode)horizPagination;
  57. - setVertPagination:(NSPrintingPaginationMode)mode;
  58. - (NSPrintingPaginationMode)vertPagination;
  59.  
  60. - (DPSContext)context;
  61.  
  62. /* If job features are not implemented on this new printer, flush them when the printer is set. */
  63. - setPrinter:(NSPrinter *)pr;
  64. - (NSPrinter *)printer;
  65.  
  66. - (void)setJobDisposition:(NSString *)disposition;
  67. - (NSString *)jobDisposition;
  68.  
  69. /* Called when a print operation is about to start.  It allows this object to set default values for any keys that are not already set.
  70. */
  71. - (void)setUpPrintOperationDefaultValues;
  72.  
  73. /* The dictionary containing the key/values for this object.
  74. */
  75. - (NSMutableDictionary *)dictionary;
  76.  
  77. /* Create a PrintInfo from an existing NSDictionary.  Designated initializer.
  78. */
  79. - (id)initWithDictionary:(NSDictionary *)aDict;
  80.  
  81. /* NOT the designated initializer.  Init with no values.
  82. */
  83.  
  84.  
  85. /* Set/get the shared PrintInfo instance.  This defines the settings for the PageLayout panel and print operations that will be used if no PrintInfo is specified for those operations.  This PrintInfo instance can be thought of as being "shared" among document in the app.  This should never be set to nil.
  86. */
  87. + (void)setSharedPrintInfo:(NSPrintInfo *)printInfo;
  88. + (NSPrintInfo *)sharedPrintInfo;
  89.  
  90.  
  91. /* Set/get the user's default printer.
  92. */
  93. + (NSPrinter *)defaultPrinter;
  94. + (void)setDefaultPrinter:(NSPrinter *)pr;
  95.  
  96. /* Get the size of a paper name */
  97. + (NSSize)sizeForPaperName:(NSString *)name;
  98.  
  99. @end
  100.  
  101.  
  102. /* The list below defines the keys in the dictionary, and the types that they are assumed to be.  Values that are not objects are stored as NSValues.
  103.  
  104.         Dictionary Key           Type            Description
  105.         --------------           ----            -----------    */
  106. extern NSString *NSPrintPaperName;    // NSString        Paper name: Letter, Legal, etc.
  107. extern NSString *NSPrintPaperSize;    // NSSize        Height and width of paper
  108. extern NSString *NSPrintOrientation;    // NSPrintingOrientation Portrait/Landscape
  109. extern NSString *NSPrintLeftMargin;    // float        Margins, in points:
  110. extern NSString *NSPrintRightMargin;    // float
  111. extern NSString *NSPrintTopMargin;    // float
  112. extern NSString *NSPrintBottomMargin;    // float
  113. extern NSString *NSPrintHorizontallyCentered;    // BOOL            Pages are centered horizontally.
  114. extern NSString *NSPrintVerticallyCentered;    // BOOL            Pages are centered horizontally.
  115. extern NSString *NSPrintHorizontalPagination;// NSPrintingPaginationMode
  116. extern NSString *NSPrintVerticalPagination;    // NSPrintingPaginationMode
  117.  
  118. extern NSString *NSPrintScalingFactor;    // float        Scale before pagination.
  119. extern NSString *NSPrintAllPages;    // BOOL            Include all pages in the job.
  120. extern NSString *NSPrintReversePageOrder;// BOOL        Print last page first.
  121. extern NSString *NSPrintFirstPage;    // int            First page to print in job.
  122. extern NSString *NSPrintLastPage;    // int            Last page to print in job.
  123. extern NSString *NSPrintCopies;        // int            Number of copies to spool.
  124. extern NSString *NSPrintPagesPerSheet;    // int
  125. extern NSString *NSPrintJobFeatures;    // NSMutableDictionary    Key = Name.  Value = Setting.
  126.                         // Feature names come from the NSPrinter/PPD info.
  127.                         // Example:  Key=@"Resolution" Value=@"600dpi"
  128. extern NSString *NSPrintPaperFeed;    // NSString        Generally, the input slot.
  129. extern NSString     *NSPrintManualFeed;    // @"NSPrintManualFeed" refers to manual feed.
  130. extern NSString *NSPrintPrinter;    // NSPrinter        Printer to use for print job.
  131. extern NSString *NSPrintJobDisposition;    // NSString        What to do with the print stream:
  132. extern NSString *NSPrintSavePath;    // NSString        Path if disposition = @"NSSave".
  133.  
  134. extern NSString *NSPrintFaxReceiverNames;// NSArray of NSStrings  Names of receivers of the fax.
  135. extern NSString *NSPrintFaxReceiverNumbers;// NSArray of NSStrings  Phone numbers of receivers.
  136.                                  // Must parallel NSFaxReceiverNames.
  137. extern NSString *NSPrintFaxSendTime;    // NSDate        When to send the fax.
  138. extern NSString *NSPrintFaxUseCoverSheet;// BOOL        Whether to use a cover sheet.
  139. extern NSString *NSPrintFaxCoverSheetName;// NSString        The cover sheet to use.
  140. extern NSString *NSPrintFaxReturnReceipt;// BOOL        Whether to send mail when fax is sent.
  141. extern NSString *NSPrintFaxHighResolution;// BOOL        Whether to send at low resolution.
  142. extern NSString *NSPrintFaxTrimPageEnds;// BOOL            Whether to trim page ends or send complete pages.
  143. extern NSString *NSPrintFaxModem;    // NSPrinter        The fax modem to use.
  144.  
  145. /* Valid values for job disposition */
  146. extern NSString *NSPrintSpoolJob;    // @"NSPrintSpoolJob"    Normal print job.
  147. extern NSString *NSPrintFaxJob;        // @"NSPrintFaxJob"    Fax job.
  148. extern NSString *NSPrintPreviewJob;    // @"NSPrintPreviewJob"    Send to Preview app.
  149. extern NSString *NSPrintSaveJob;    // @"NSPrintSaveJob"    Save to a file.
  150. extern NSString *NSPrintCancelJob;    // @"NSPrintCancelJob"    Save to a file.
  151.