home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2 / Openstep-4.2-Intel-Developer.iso / NextLibrary / Frameworks / AppKit.framework / Versions / B / Headers / NSPrintInfo.h < prev    next >
Text File  |  1996-10-17  |  7KB  |  163 lines

  1. /*
  2.     NSPrintInfo.h
  3.     Application Kit
  4.     Copyright (c) 1994-1996, NeXT Software, Inc.
  5.     All rights reserved.
  6. */
  7.  
  8. /*
  9. 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.
  10. */
  11.  
  12. #import <Foundation/NSObject.h>
  13. #import <AppKit/NSGraphics.h>
  14. #import <AppKit/AppKitDefines.h>
  15.  
  16. @class NSPrinter;
  17.  
  18. typedef enum _NSPrintingOrientation {
  19.     NSPortraitOrientation        = 0,
  20.     NSLandscapeOrientation        = 1
  21. } NSPrintingOrientation;
  22.  
  23. typedef enum _NSPrintingPaginationMode {
  24.     NSAutoPagination            = 0,
  25.     NSFitPagination            = 1, // Force image to fit on one page
  26.     NSClipPagination            = 2  // Let image be clipped by page
  27. } NSPrintingPaginationMode;
  28.  
  29.  
  30. @interface NSPrintInfo : NSObject <NSCopying, NSCoding>
  31. {
  32. @private
  33.     NSMutableDictionary    *dictionary;
  34.     unsigned int _reservedPrintInfo1;
  35. }
  36.  
  37.  
  38. /* 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.
  39.  */
  40. - (void)setPaperName:(NSString *)name;
  41. - (NSString *)paperName;
  42. - (void)setPaperSize:(NSSize)aSize;
  43. - (NSSize)paperSize;
  44. - (void)setOrientation:(NSPrintingOrientation)orientation;
  45. - (NSPrintingOrientation)orientation;
  46.  
  47. /* Covers for a number of the keys on the dictionary.
  48. */
  49. - (void)setLeftMargin:(float)margin;
  50. - (void)setRightMargin:(float)margin;
  51. - (void)setTopMargin:(float)margin;
  52. - (void)setBottomMargin:(float)margin;
  53. - (float)leftMargin;
  54. - (float)rightMargin;
  55. - (float)topMargin;
  56. - (float)bottomMargin;
  57. - (void)setHorizontallyCentered:(BOOL)flag;
  58. - (BOOL)isHorizontallyCentered;
  59. - (void)setVerticallyCentered:(BOOL)flag;
  60. - (BOOL)isVerticallyCentered;
  61. - (void)setHorizontalPagination:(NSPrintingPaginationMode)mode;
  62. - (NSPrintingPaginationMode)horizontalPagination;
  63. - (void)setVerticalPagination:(NSPrintingPaginationMode)mode;
  64. - (NSPrintingPaginationMode)verticalPagination;
  65.  
  66. /* If job features are not implemented on this new printer, flush them when the printer is set. */
  67. - (void)setPrinter:(NSPrinter *)pr;
  68. - (NSPrinter *)printer;
  69.  
  70. - (void)setJobDisposition:(NSString *)disposition;
  71. - (NSString *)jobDisposition;
  72.  
  73. /* 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.
  74. */
  75. - (void)setUpPrintOperationDefaultValues;
  76.  
  77. /* The dictionary containing the key/values for this object.
  78. */
  79. - (NSMutableDictionary *)dictionary;
  80.  
  81. /* Create a PrintInfo from an existing NSDictionary.  Designated initializer.
  82. */
  83. - (id)initWithDictionary:(NSDictionary *)aDict;
  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 documents 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. APPKIT_EXTERN NSString *NSPrintPaperName;    // NSString        Paper name: Letter, Legal, etc.
  107. APPKIT_EXTERN NSString *NSPrintPaperSize;    // NSSize        Height and width of paper
  108. APPKIT_EXTERN NSString *NSPrintFormName;    // NSString
  109. APPKIT_EXTERN NSString *NSPrintMustCollate;    // BOOL
  110. APPKIT_EXTERN NSString *NSPrintOrientation;    // NSPrintingOrientation Portrait/Landscape
  111. APPKIT_EXTERN NSString *NSPrintLeftMargin;    // float        Margins, in points:
  112. APPKIT_EXTERN NSString *NSPrintRightMargin;    // float
  113. APPKIT_EXTERN NSString *NSPrintTopMargin;    // float
  114. APPKIT_EXTERN NSString *NSPrintBottomMargin;    // float
  115. APPKIT_EXTERN NSString *NSPrintHorizontallyCentered;    // BOOL            Pages are centered horizontally.
  116. APPKIT_EXTERN NSString *NSPrintVerticallyCentered;    // BOOL            Pages are centered horizontally.
  117. APPKIT_EXTERN NSString *NSPrintHorizontalPagination;// NSPrintingPaginationMode
  118. APPKIT_EXTERN NSString *NSPrintVerticalPagination;    // NSPrintingPaginationMode
  119.  
  120. APPKIT_EXTERN NSString *NSPrintScalingFactor;    // float        Scale before pagination.
  121. APPKIT_EXTERN NSString *NSPrintAllPages;    // BOOL            Include all pages in the job.
  122. APPKIT_EXTERN NSString *NSPrintReversePageOrder;// BOOL        Print last page first.
  123. APPKIT_EXTERN NSString *NSPrintFirstPage;    // int            First page to print in job.
  124. APPKIT_EXTERN NSString *NSPrintLastPage;    // int            Last page to print in job.
  125. APPKIT_EXTERN NSString *NSPrintCopies;        // int            Number of copies to spool.
  126. APPKIT_EXTERN NSString *NSPrintPagesPerSheet;    // int
  127. APPKIT_EXTERN NSString *NSPrintJobFeatures;    // NSMutableDictionary    Key = Name.  Value = Setting.
  128.                         // Feature names come from the NSPrinter/PPD info.
  129.                         // Example:  Key=@"Resolution" Value=@"600dpi"
  130. APPKIT_EXTERN NSString *NSPrintPaperFeed;    // NSString        Generally, the input slot.
  131. APPKIT_EXTERN NSString *NSPrintManualFeed;    // @"NSPrintManualFeed" refers to manual feed.
  132. APPKIT_EXTERN NSString *NSPrintPrinter;    // NSPrinter        Printer to use for print job.
  133. APPKIT_EXTERN NSString *NSPrintJobDisposition;    // NSString        What to do with the print stream:
  134. APPKIT_EXTERN NSString *NSPrintSavePath;    // NSString        Path if disposition = @"NSSave".
  135.  
  136. #ifndef STRICT_OPENSTEP
  137. #ifndef WIN32
  138. APPKIT_EXTERN NSString *NSPrintFaxReceiverNames;// NSArray of NSStrings  Names of receivers of the fax.
  139. APPKIT_EXTERN NSString *NSPrintFaxReceiverNumbers;// NSArray of NSStrings  Phone numbers of receivers.
  140.                                  // Must parallel NSFaxReceiverNames.
  141. APPKIT_EXTERN NSString *NSPrintFaxSendTime;    // NSDate        When to send the fax.
  142. APPKIT_EXTERN NSString *NSPrintFaxUseCoverSheet;// BOOL        Whether to use a cover sheet.
  143. APPKIT_EXTERN NSString *NSPrintFaxCoverSheetName;// NSString        The cover sheet to use.
  144. APPKIT_EXTERN NSString *NSPrintFaxReturnReceipt;// BOOL        Whether to send mail when fax is sent.
  145. APPKIT_EXTERN NSString *NSPrintFaxHighResolution;// BOOL        Whether to send at low resolution.
  146. APPKIT_EXTERN NSString *NSPrintFaxTrimPageEnds;// BOOL            Whether to trim page ends or send complete pages.
  147. APPKIT_EXTERN NSString *NSPrintFaxModem;    // NSPrinter        The fax modem to use.
  148. #endif /* WIN32 */
  149. #endif /* STRICT_OPENSTEP */
  150.  
  151. /* Valid values for job disposition */
  152. APPKIT_EXTERN NSString *NSPrintSpoolJob;    // @"NSPrintSpoolJob"    Normal print job.
  153.  
  154. #ifndef STRICT_OPENSTEP
  155. #ifndef WIN32
  156. APPKIT_EXTERN NSString *NSPrintFaxJob;        // @"NSPrintFaxJob"    Fax job.
  157. #endif /* WIN32 */
  158. #endif /* STRICT_OPENSTEP */
  159.  
  160. APPKIT_EXTERN NSString *NSPrintPreviewJob;    // @"NSPrintPreviewJob"    Send to Preview app.
  161. APPKIT_EXTERN NSString *NSPrintSaveJob;    // @"NSPrintSaveJob"    Save to a file.
  162. APPKIT_EXTERN NSString *NSPrintCancelJob;    // @"NSPrintCancelJob"    Save to a file.
  163.