comparison dstep/appkit/NSPrinter.d @ 16:19885b43130e

Huge update, the bridge actually works now
author Jacob Carlborg <doob@me.com>
date Sun, 03 Jan 2010 22:06:11 +0100
parents
children b9de51448c6b
comparison
equal deleted inserted replaced
15:7ff919f595d5 16:19885b43130e
1 /**
2 * Copyright: Copyright (c) 2009 Jacob Carlborg.
3 * Authors: Jacob Carlborg
4 * Version: Initial created: Sep 24, 2009
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
6 */
7 module dstep.appkit.NSPrinter;
8
9 import dstep.foundation.NSArray;
10 import dstep.foundation.NSCoder;
11 import dstep.foundation.NSDictionary;
12 import dstep.foundation.NSString;
13 import dstep.foundation.NSGeometry;
14 import dstep.foundation.NSObjCRuntime;
15 import dstep.foundation.NSObject;
16 import dstep.foundation.NSZone;
17 import dstep.objc.bridge.Bridge;
18 import dstep.objc.objc;
19
20 typedef NSUInteger NSPrinterTableStatus;
21
22 enum : NSUInteger
23 {
24 NSPrinterTableOK = 0,
25 NSPrinterTableNotFound = 1,
26 NSPrinterTableError = 2
27 }
28
29 class NSPrinter : NSObject, INSCopying, INSCoding
30 {
31 mixin (ObjcWrap);
32
33 this (NSCoder aDecoder)
34 {
35 super(typeof(this).alloc.initWithCoder(aDecoder).objcObject);
36 }
37
38 void encodeWithCoder (NSCoder aCoder)
39 {
40 return invokeObjcSelf!(void, "encodeWithCoder:", NSCoder)(aCoder);
41 }
42
43 typeof(this) initWithCoder (NSCoder aDecoder)
44 {
45 return invokeObjcSelf!(typeof(this), "initWithCoder:", NSCoder)(aDecoder);
46 }
47
48 typeof(this) copyWithZone (NSZone* zone)
49 {
50 return invokeObjcSelf!(typeof(this), "copyWithZone:", NSZone*)(zone);
51 }
52
53 static NSArray printerNames ()
54 {
55 return invokeObjcSelfClass!(NSArray, "printerNames");
56 }
57
58 static NSArray printerTypes ()
59 {
60 return invokeObjcSelfClass!(NSArray, "printerTypes");
61 }
62
63 static NSPrinter printerWithName (NSString name)
64 {
65 return invokeObjcSelfClass!(NSPrinter, "printerWithName:", NSString)(name);
66 }
67
68 static NSPrinter printerWithType (NSString type)
69 {
70 return invokeObjcSelfClass!(NSPrinter, "printerWithType:", NSString)(type);
71 }
72
73 NSString name ()
74 {
75 return invokeObjcSelf!(NSString, "name");
76 }
77
78 NSString type ()
79 {
80 return invokeObjcSelf!(NSString, "type");
81 }
82
83 NSInteger languageLevel ()
84 {
85 return invokeObjcSelf!(NSInteger, "languageLevel");
86 }
87
88 NSSize pageSizeForPaper (NSString paperName)
89 {
90 return invokeObjcSelf!(NSSize, "pageSizeForPaper:", NSString)(paperName);
91 }
92
93 uint statusForTable (NSString tableName)
94 {
95 return invokeObjcSelf!(uint, "statusForTable:", NSString)(tableName);
96 }
97
98 bool isKey (NSString key, NSString table)
99 {
100 return invokeObjcSelf!(bool, "isKey:inTable:", NSString, NSString)(key, table);
101 }
102
103 bool booleanForKey (NSString key, NSString table)
104 {
105 return invokeObjcSelf!(bool, "booleanForKey:inTable:", NSString, NSString)(key, table);
106 }
107
108 float floatForKey (NSString key, NSString table)
109 {
110 return invokeObjcSelf!(float, "floatForKey:inTable:", NSString, NSString)(key, table);
111 }
112
113 int intForKey (NSString key, NSString table)
114 {
115 return invokeObjcSelf!(int, "intForKey:inTable:", NSString, NSString)(key, table);
116 }
117
118 NSRect rectForKey (NSString key, NSString table)
119 {
120 return invokeObjcSelf!(NSRect, "rectForKey:inTable:", NSString, NSString)(key, table);
121 }
122
123 NSSize sizeForKey (NSString key, NSString table)
124 {
125 return invokeObjcSelf!(NSSize, "sizeForKey:inTable:", NSString, NSString)(key, table);
126 }
127
128 NSString stringForKey (NSString key, NSString table)
129 {
130 return invokeObjcSelf!(NSString, "stringForKey:inTable:", NSString, NSString)(key, table);
131 }
132
133 NSArray stringListForKey (NSString key, NSString table)
134 {
135 return invokeObjcSelf!(NSArray, "stringListForKey:inTable:", NSString, NSString)(key, table);
136 }
137
138 NSDictionary deviceDescription ()
139 {
140 return invokeObjcSelf!(NSDictionary, "deviceDescription");
141 }
142
143 }
144