Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSMutableParagraphStyle.d @ 45:d8635bb48c7c
Merge with SWT 3.5
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Mon, 01 Dec 2008 17:07:00 +0100 |
parents | f565d3a95c0a |
children | 62202ce0039f |
comparison
equal
deleted
inserted
replaced
44:ca5e494f2bbf | 45:d8635bb48c7c |
---|---|
1 /******************************************************************************* | 1 /******************************************************************************* |
2 * Copyright (c) 2007 IBM Corporation and others. | 2 * Copyright (c) 2000, 2008 IBM Corporation and others. |
3 * All rights reserved. This program and the accompanying materials | 3 * All rights reserved. This program and the accompanying materials |
4 * are made available under the terms of the Eclipse Public License v1.0 | 4 * are made available under the terms of the Eclipse Public License v1.0 |
5 * which accompanies this distribution, and is available at | 5 * which accompanies this distribution, and is available at |
6 * http://www.eclipse.org/legal/epl-v10.html | 6 * http://www.eclipse.org/legal/epl-v10.html |
7 * | 7 * |
8 * Contributors: | 8 * Contributors: |
9 * IBM Corporation - initial API and implementation | 9 * IBM Corporation - initial API and implementation |
10 * | 10 * |
11 * Port to the D programming language: | 11 * Port to the D programming language: |
12 * Jacob Carlborg <jacob.carlborg@gmail.com> | 12 * Jacob Carlborg <doob@me.com> |
13 *******************************************************************************/ | 13 *******************************************************************************/ |
14 module dwt.internal.cocoa.NSMutableParagraphStyle; | 14 module dwt.internal.cocoa.NSMutableParagraphStyle; |
15 | 15 |
16 import dwt.internal.cocoa.CGFloat; | 16 import dwt.dwthelper.utils; |
17 import dwt.internal.c.Carbon; | |
18 import cocoa = dwt.internal.cocoa.id; | |
17 import dwt.internal.cocoa.NSArray; | 19 import dwt.internal.cocoa.NSArray; |
18 import dwt.internal.cocoa.NSInteger; | |
19 import dwt.internal.cocoa.NSParagraphStyle; | 20 import dwt.internal.cocoa.NSParagraphStyle; |
20 import dwt.internal.cocoa.NSText : NSTextAlignment, NSWritingDirection; | 21 import dwt.internal.cocoa.NSText; |
21 import dwt.internal.cocoa.NSTextTab; | 22 import dwt.internal.cocoa.NSTextTab; |
22 import dwt.internal.cocoa.OS; | 23 import dwt.internal.cocoa.OS; |
23 import objc = dwt.internal.objc.runtime; | 24 import objc = dwt.internal.objc.runtime; |
24 | 25 |
25 enum NSLineBreakMode | 26 public class NSMutableParagraphStyle : NSParagraphStyle { |
26 { | 27 |
27 NSLineBreakByWordWrapping = 0, | 28 public this() { |
28 NSLineBreakByCharWrapping, | 29 super(); |
29 NSLineBreakByClipping, | |
30 NSLineBreakByTruncatingHead, | |
31 NSLineBreakByTruncatingTail, | |
32 NSLineBreakByTruncatingMiddle | |
33 } | 30 } |
34 | 31 |
35 alias NSLineBreakMode.NSLineBreakByWordWrapping NSLineBreakByWordWrapping; | 32 public this(objc.id id) { |
36 alias NSLineBreakMode.NSLineBreakByCharWrapping NSLineBreakByCharWrapping; | 33 super(id); |
37 alias NSLineBreakMode.NSLineBreakByClipping NSLineBreakByClipping; | 34 } |
38 alias NSLineBreakMode.NSLineBreakByTruncatingHead NSLineBreakByTruncatingHead; | |
39 alias NSLineBreakMode.NSLineBreakByTruncatingTail NSLineBreakByTruncatingTail; | |
40 alias NSLineBreakMode.NSLineBreakByTruncatingMiddle NSLineBreakByTruncatingMiddle; | |
41 | 35 |
42 public class NSMutableParagraphStyle : NSParagraphStyle | 36 public this(cocoa.id id) { |
43 { | 37 super(id); |
38 } | |
44 | 39 |
45 public this () | 40 public void addTabStop(NSTextTab anObject) { |
46 { | 41 OS.objc_msgSend(this.id, OS.sel_addTabStop_, anObject !is null ? anObject.id : null); |
47 super(); | 42 } |
48 } | |
49 | 43 |
50 public this (objc.id id) | 44 public void setAlignment(NSTextAlignment alignment) { |
51 { | 45 OS.objc_msgSend(this.id, OS.sel_setAlignment_, alignment); |
52 super(id); | 46 } |
53 } | |
54 | 47 |
55 public void addTabStop (NSTextTab anObject) | 48 public void setDefaultTabInterval(CGFloat aFloat) { |
56 { | 49 OS.objc_msgSend(this.id, OS.sel_setDefaultTabInterval_, aFloat); |
57 OS.objc_msgSend(this.id_, OS.sel_addTabStop_1, anObject !is null ? anObject.id_ : null); | 50 } |
58 } | |
59 | 51 |
60 public void removeTabStop (NSTextTab anObject) | 52 public void setFirstLineHeadIndent(CGFloat aFloat) { |
61 { | 53 OS.objc_msgSend(this.id, OS.sel_setFirstLineHeadIndent_, aFloat); |
62 OS.objc_msgSend(this.id_, OS.sel_removeTabStop_1, anObject !is null ? anObject.id_ : null); | 54 } |
63 } | |
64 | 55 |
65 public void setAlignment (NSTextAlignment alignment) | 56 public void setLineBreakMode(NSLineBreakMode mode) { |
66 { | 57 OS.objc_msgSend(this.id, OS.sel_setLineBreakMode_, mode); |
67 OS.objc_msgSend(this.id_, OS.sel_setAlignment_1, alignment); | 58 } |
68 } | |
69 | 59 |
70 public void setBaseWritingDirection (NSWritingDirection writingDirection) | 60 public void setLineSpacing(CGFloat aFloat) { |
71 { | 61 OS.objc_msgSend(this.id, OS.sel_setLineSpacing_, aFloat); |
72 OS.objc_msgSend(this.id_, OS.sel_setBaseWritingDirection_1, writingDirection); | 62 } |
73 } | |
74 | 63 |
75 public void setDefaultTabInterval (CGFloat aFloat) | 64 public void setTabStops(NSArray array) { |
76 { | 65 OS.objc_msgSend(this.id, OS.sel_setTabStops_, array !is null ? array.id : null); |
77 OS.objc_msgSend(this.id_, OS.sel_setDefaultTabInterval_1, aFloat); | 66 } |
78 } | |
79 | |
80 public void setFirstLineHeadIndent (CGFloat aFloat) | |
81 { | |
82 OS.objc_msgSend(this.id_, OS.sel_setFirstLineHeadIndent_1, aFloat); | |
83 } | |
84 | |
85 public void setHeadIndent (CGFloat aFloat) | |
86 { | |
87 OS.objc_msgSend(this.id_, OS.sel_setHeadIndent_1, aFloat); | |
88 } | |
89 | |
90 public void setHeaderLevel (NSInteger level) | |
91 { | |
92 OS.objc_msgSend(this.id_, OS.sel_setHeaderLevel_1, level); | |
93 } | |
94 | |
95 public void setHyphenationFactor (float aFactor) | |
96 { | |
97 OS.objc_msgSend(this.id_, OS.sel_setHyphenationFactor_1, aFactor); | |
98 } | |
99 | |
100 public void setLineBreakMode (NSLineBreakMode mode) | |
101 { | |
102 OS.objc_msgSend(this.id_, OS.sel_setLineBreakMode_1, mode); | |
103 } | |
104 | |
105 public void setLineHeightMultiple (CGFloat aFloat) | |
106 { | |
107 OS.objc_msgSend(this.id_, OS.sel_setLineHeightMultiple_1, aFloat); | |
108 } | |
109 | |
110 public void setLineSpacing (CGFloat aFloat) | |
111 { | |
112 OS.objc_msgSend(this.id_, OS.sel_setLineSpacing_1, aFloat); | |
113 } | |
114 | |
115 public void setMaximumLineHeight (CGFloat aFloat) | |
116 { | |
117 OS.objc_msgSend(this.id_, OS.sel_setMaximumLineHeight_1, aFloat); | |
118 } | |
119 | |
120 public void setMinimumLineHeight (CGFloat aFloat) | |
121 { | |
122 OS.objc_msgSend(this.id_, OS.sel_setMinimumLineHeight_1, aFloat); | |
123 } | |
124 | |
125 public void setParagraphSpacing (CGFloat aFloat) | |
126 { | |
127 OS.objc_msgSend(this.id_, OS.sel_setParagraphSpacing_1, aFloat); | |
128 } | |
129 | |
130 public void setParagraphSpacingBefore (CGFloat aFloat) | |
131 { | |
132 OS.objc_msgSend(this.id_, OS.sel_setParagraphSpacingBefore_1, aFloat); | |
133 } | |
134 | |
135 public void setParagraphStyle (NSParagraphStyle obj) | |
136 { | |
137 OS.objc_msgSend(this.id_, OS.sel_setParagraphStyle_1, obj !is null ? obj.id_ : null); | |
138 } | |
139 | |
140 public void setTabStops (NSArray array) | |
141 { | |
142 OS.objc_msgSend(this.id_, OS.sel_setTabStops_1, array !is null ? array.id_ : null); | |
143 } | |
144 | |
145 public void setTailIndent (CGFloat aFloat) | |
146 { | |
147 OS.objc_msgSend(this.id_, OS.sel_setTailIndent_1, aFloat); | |
148 } | |
149 | |
150 public void setTextBlocks (NSArray array) | |
151 { | |
152 OS.objc_msgSend(this.id_, OS.sel_setTextBlocks_1, array !is null ? array.id_ : null); | |
153 } | |
154 | |
155 public void setTextLists (NSArray array) | |
156 { | |
157 OS.objc_msgSend(this.id_, OS.sel_setTextLists_1, array !is null ? array.id_ : null); | |
158 } | |
159 | |
160 public void setTighteningFactorForTruncation (float aFactor) | |
161 { | |
162 OS.objc_msgSend(this.id_, OS.sel_setTighteningFactorForTruncation_1, aFactor); | |
163 } | |
164 | 67 |
165 } | 68 } |