/usr/include/GNUstep/AppKit/NSPrinter.h is in libgnustep-gui-dev 0.24.0-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | /*
NSPrinter.h
Class representing a printer's capabilities.
Copyright (C) 1996, 1997, 2004 Free Software Foundation, Inc.
Authors: Simon Frankau <sgf@frankau.demon.co.uk>
Date: June 1997
Modified for Printing Backend Support
Author: Chad Hardin <cehardin@mac.com>
Date: July 2004
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 Lesser 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef _GNUstep_H_NSPrinter
#define _GNUstep_H_NSPrinter
#import <Foundation/NSObject.h>
#import <Foundation/NSGeometry.h>
@class NSString;
@class NSArray;
@class NSDictionary;
@class NSMutableDictionary;
typedef enum _NSPrinterTableStatus {
NSPrinterTableOK,
NSPrinterTableNotFound,
NSPrinterTableError
} NSPrinterTableStatus;
@interface NSPrinter : NSObject <NSCoding>
{
NSString *_printerHost;
NSString *_printerName;
NSString *_printerNote;
NSString *_printerType;
//The way openstep handled NSPrinter was odd, it had a concept of "real"
//printers and
//not real printers. Printers that were not real were simply parsed PPDs,
//whether the printer was actually available or not was irrevelatn. This is
//is where the all the -types and +types methods come from. Apple's
//adoption of CUPS forced them to change this behavior, now, their types
//methods only search for the types of printers that are actually avaiable,
//it has nothing to do with the PPDs that happen to be avaiable on the file
//system. I think this is also the behavior we should adopt. Not simply
//because it is what Apple does but because it facilitates a generic printing
//backend system, especially one that will likely be using CUPS itself.
//This is why the following ivar is removed and the behavior of this class
//and the GSLPR Bundle has been changed. Doing this has also allowed me
//to put a lot of generic code in ths class that would have otherwise had
//to have been handles by each bundle. See +printerWithType: in NSPrinter.m
//BOOL _isRealPrinter;
NSMutableDictionary *_tables; //maps the tables, which are
//NSMutableDictionaries, to their names
//(such as PPD, PPDOptionTranslation, etc)
}
//
// Finding an NSPrinter
//
+ (NSPrinter*) printerWithName: (NSString*) name;
+ (NSPrinter*) printerWithType: (NSString*) type;
+ (NSArray*) printerNames;
+ (NSArray*) printerTypes;
//
// Printer Attributes
//
- (NSString*) host;
- (NSString*) name;
- (NSString*) note;
- (NSString*) type;
//
// Retrieving Specific Information
//
- (BOOL) acceptsBinary;
- (NSRect) imageRectForPaper: (NSString*) paperName;
- (NSSize) pageSizeForPaper: (NSString*) paperName;
- (BOOL) isColor;
- (BOOL) isFontAvailable: (NSString*) fontName;
- (int) languageLevel;
- (BOOL) isOutputStackInReverseOrder;
//
// Querying the NSPrinter Tables
//
- (BOOL) booleanForKey: (NSString*) key
inTable: (NSString*) table;
- (NSDictionary*) deviceDescription;
- (float) floatForKey: (NSString*) key
inTable: (NSString*) table;
- (int) intForKey: (NSString*) key
inTable: (NSString*) table;
- (NSRect) rectForKey: (NSString*) key
inTable: (NSString*) table;
- (NSSize) sizeForKey: (NSString*) key
inTable: (NSString*) table;
- (NSString*) stringForKey: (NSString*) key
inTable: (NSString*) table;
- (NSArray*) stringListForKey: (NSString*) key
inTable: (NSString*) table;
- (NSPrinterTableStatus) statusForTable: (NSString*) table;
- (BOOL) isKey: (NSString*) key
inTable: (NSString*) table;
//
// NSCoding protocol
//
- (void) encodeWithCoder: (NSCoder*) aCoder;
- (id)initWithCoder: (NSCoder*) aDecoder;
@end
//
// Private methods that will be usefull for the
// printing backend bundles that subclass NSPrinter
//
@interface NSPrinter (Private)
//
// Initialisation method used by backend bundles
//
-(id) initWithName: (NSString*) name
withType: (NSString*) type
withHost: (NSString*) host
withNote: (NSString*) note;
@end
//
// Have the NSPrinter parse a PPD and put it into its
// tables. Used by the printing backend bundles.
//
@interface NSPrinter (PPDParsing)
-(BOOL) parsePPDAtPath: (NSString*) ppdPath;
@end
#endif // _GNUstep_H_NSPrinter
|