diff dwt/internal/cocoa/NSTextFieldCell.d @ 0:380af2bdd8e5

Upload of whole dwt tree
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Sat, 09 Aug 2008 17:00:02 +0200
parents
children 8b48be5454ce
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dwt/internal/cocoa/NSTextFieldCell.d	Sat Aug 09 17:00:02 2008 +0200
@@ -0,0 +1,133 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ * Port to the D Programming language:
+ *     Jacob Carlborg <jacob.carlborg@gmail.com>
+ *******************************************************************************/
+module dwt.internal.cocoa.NSTextFieldCell;
+
+import dwt.internal.cocoa.NSActionCell;
+import dwt.internal.cocoa.NSArray;
+import dwt.internal.cocoa.NSAttributedString;
+import dwt.internal.cocoa.NSColor;
+import dwt.internal.cocoa.NSString;
+import dwt.internal.cocoa.NSText;
+import dwt.internal.cocoa.OS;
+import objc = dwt.internal.objc.runtime;
+
+enum NSTextFieldBezelStyle
+{
+    NSTextFieldSquareBezel = 0,
+    NSTextFieldRoundedBezel = 1
+}
+
+alias NSTextFieldBezelStyle.NSTextFieldSquareBezel NSTextFieldSquareBezel;
+alias NSTextFieldBezelStyle.NSTextFieldRoundedBezel NSTextFieldRoundedBezel;
+
+public class NSTextFieldCell : NSActionCell
+{
+
+    public this ()
+    {
+        super();
+    }
+
+    public this (objc.id id)
+    {
+        super(id);
+    }
+
+    public NSArray allowedInputSourceLocales ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_allowedInputSourceLocales);
+        return result !is null ? new NSArray(result) : null;
+    }
+
+    public NSColor backgroundColor ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_backgroundColor);
+        return result !is null ? new NSColor(result) : null;
+    }
+
+    public NSTextFieldBezelStyle bezelStyle ()
+    {
+        return cast(NSTextFieldBezelStyle) OS.objc_msgSend(this.id, OS.sel_bezelStyle);
+    }
+
+    public bool drawsBackground ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_drawsBackground) !is null;
+    }
+
+    public NSAttributedString placeholderAttributedString ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_placeholderAttributedString);
+        return result !is null ? new NSAttributedString(result) : null;
+    }
+
+    public NSString placeholderString ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_placeholderString);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public void setAllowedInputSourceLocales (NSArray localeIdentifiers)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setAllowedInputSourceLocales_1, localeIdentifiers !is null ? localeIdentifiers.id : null);
+    }
+
+    public void setBackgroundColor (NSColor color)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color !is null ? color.id : null);
+    }
+
+    public void setBezelStyle (NSTextFieldBezelStyle style)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setBezelStyle_1, style);
+    }
+
+    public void setDrawsBackground (bool flag)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setDrawsBackground_1, flag);
+    }
+
+    public void setPlaceholderAttributedString (NSAttributedString string)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setPlaceholderAttributedString_1, string !is null ? string.id : null);
+    }
+
+    public void setPlaceholderString (NSString string)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setPlaceholderString_1, string !is null ? string.id : null);
+    }
+
+    public void setTextColor (NSColor color)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setTextColor_1, color !is null ? color.id : null);
+    }
+
+    public NSText setUpFieldEditorAttributes (NSText textObj)
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_setUpFieldEditorAttributes_1, textObj !is null ? textObj.id : null);
+        return result !is null ? new NSText(result) : null;
+    }
+
+    public void setWantsNotificationForMarkedText (bool flag)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setWantsNotificationForMarkedText_1, flag);
+    }
+
+    public NSColor textColor ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_textColor);
+        return result !is null ? new NSColor(result) : null;
+    }
+
+}