diff dwt/internal/cocoa/NSMutableAttributedString.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/NSMutableAttributedString.d	Sat Aug 09 17:00:02 2008 +0200
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * 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.NSMutableAttributedString;
+
+import dwt.internal.cocoa.NSAttributedString;
+import dwt.internal.cocoa.NSDictionary;
+import dwt.internal.cocoa.NSInteger;
+import dwt.internal.cocoa.NSMutableString;
+import dwt.internal.cocoa.NSRange;
+import dwt.internal.cocoa.NSString;
+import dwt.internal.cocoa.OS;
+import objc = dwt.internal.objc.runtime;
+
+public class NSMutableAttributedString : NSAttributedString
+{
+
+    public this ()
+    {
+        super();
+    }
+
+    public this (objc.id id)
+    {
+        super(id);
+    }
+
+    public void addAttribute (/*java int*/ /*objc NSString* */ NSString name, id value, NSRange range)
+    {
+        OS.objc_msgSend(this.id, OS.sel_addAttribute_1value_1range_1, name !is null ? name.id : null, value !is null ? value.id : null, range);
+    }
+
+    public void addAttributes (NSDictionary attrs, NSRange range)
+    {
+        OS.objc_msgSend(this.id, OS.sel_addAttributes_1range_1, attrs !is null ? attrs.id : null, range);
+    }
+
+    public void appendAttributedString (NSAttributedString attrString)
+    {
+        OS.objc_msgSend(this.id, OS.sel_appendAttributedString_1, attrString !is null ? attrString.id : null);
+    }
+
+    public void beginEditing ()
+    {
+        OS.objc_msgSend(this.id, OS.sel_beginEditing);
+    }
+
+    public void deleteCharactersInRange (NSRange range)
+    {
+        OS.objc_msgSend(this.id, OS.sel_deleteCharactersInRange_1, range);
+    }
+
+    public void endEditing ()
+    {
+        OS.objc_msgSend(this.id, OS.sel_endEditing);
+    }
+
+    public void insertAttributedString (NSAttributedString attrString, NSUInteger loc)
+    {
+        OS.objc_msgSend(this.id, OS.sel_insertAttributedString_1atIndex_1, attrString !is null ? attrString.id : null, loc);
+    }
+
+    public NSMutableString mutableString ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_mutableString);
+        return result !is null ? new NSMutableString(result) : null;
+    }
+
+    public void removeAttribute (NSString name, NSRange range)
+    {
+        OS.objc_msgSend(this.id, OS.sel_removeAttribute_1range_1, name !is null ? name.id : null, range);
+    }
+
+    public void replaceCharactersInRange_withAttributedString_ (NSRange range, NSAttributedString attrString)
+    {
+        OS.objc_msgSend(this.id, OS.sel_replaceCharactersInRange_1withAttributedString_1, range, attrString !is null ? attrString.id : null);
+    }
+
+    public void replaceCharactersInRange_withString_ (NSRange range, NSString str)
+    {
+        OS.objc_msgSend(this.id, OS.sel_replaceCharactersInRange_1withString_1, range, str !is null ? str.id : null);
+    }
+
+    public void setAttributedString (NSAttributedString attrString)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setAttributedString_1, attrString !is null ? attrString.id : null);
+    }
+
+    public void setAttributes (NSDictionary attrs, NSRange range)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setAttributes_1range_1, attrs !is null ? attrs.id : null, range);
+    }
+
+}