diff dwt/internal/cocoa/NSTreeController.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/NSTreeController.d	Sat Aug 09 17:00:02 2008 +0200
@@ -0,0 +1,279 @@
+/*******************************************************************************
+ * 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.NSTreeController;
+
+import dwt.internal.cocoa.id;
+import dwt.internal.cocoa.NSArray;
+import dwt.internal.cocoa.NSIndexPath;
+import dwt.internal.cocoa.NSObjectController;
+import dwt.internal.cocoa.NSString;
+import dwt.internal.cocoa.NSTreeNode;
+import dwt.internal.cocoa.OS;
+import objc = dwt.internal.objc.runtime;
+
+public class NSTreeController : NSObjectController
+{
+
+    public this ()
+    {
+        super();
+    }
+
+    public this (objc.id id)
+    {
+        super(id);
+    }
+
+    public void add (id sender)
+    {
+        OS.objc_msgSend(this.id, OS.sel_add_1, sender !is null ? sender.id : null);
+    }
+
+    public void addChild (id sender)
+    {
+        OS.objc_msgSend(this.id, OS.sel_addChild_1, sender !is null ? sender.id : null);
+    }
+
+    public bool addSelectionIndexPaths (NSArray indexPaths)
+    {
+        return OS.objc_msgSend(this.id, OS.sel_addSelectionIndexPaths_1, indexPaths !is null ? indexPaths.id : null) !is null;
+    }
+
+    public bool alwaysUsesMultipleValuesMarker ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_alwaysUsesMultipleValuesMarker) !is null;
+    }
+
+    public id arrangedObjects ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_arrangedObjects);
+        return result !is null ? new id(result) : null;
+    }
+
+    public bool avoidsEmptySelection ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_avoidsEmptySelection) !is null;
+    }
+
+    public bool canAddChild ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_canAddChild) !is null;
+    }
+
+    public bool canInsert ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_canInsert) !is null;
+    }
+
+    public bool canInsertChild ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_canInsertChild) !is null;
+    }
+
+    public NSString childrenKeyPath ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_childrenKeyPath);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public NSString childrenKeyPathForNode (NSTreeNode node)
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_childrenKeyPathForNode_1, node !is null ? node.id : null);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public id content ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_content);
+        return result !is null ? new id(result) : null;
+    }
+
+    public NSString countKeyPath ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_countKeyPath);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public NSString countKeyPathForNode (NSTreeNode node)
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_countKeyPathForNode_1, node !is null ? node.id : null);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public void insert (id sender)
+    {
+        OS.objc_msgSend(this.id, OS.sel_insert_1, sender !is null ? sender.id : null);
+    }
+
+    public void insertChild (id sender)
+    {
+        OS.objc_msgSend(this.id, OS.sel_insertChild_1, sender !is null ? sender.id : null);
+    }
+
+    public void insertObject (id object, NSIndexPath indexPath)
+    {
+        OS.objc_msgSend(this.id, OS.sel_insertObject_1atArrangedObjectIndexPath_1, object !is null ? object.id : null,
+                indexPath !is null ? indexPath.id : null);
+    }
+
+    public void insertObjects (NSArray objects, NSArray indexPaths)
+    {
+        OS.objc_msgSend(this.id, OS.sel_insertObjects_1atArrangedObjectIndexPaths_1, objects !is null ? objects.id : null,
+                indexPaths !is null ? indexPaths.id : null);
+    }
+
+    public NSString leafKeyPath ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_leafKeyPath);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public NSString leafKeyPathForNode (NSTreeNode node)
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_leafKeyPathForNode_1, node !is null ? node.id : null);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public void moveNode (NSTreeNode node, NSIndexPath indexPath)
+    {
+        OS.objc_msgSend(this.id, OS.sel_moveNode_1toIndexPath_1, node !is null ? node.id : null, indexPath !is null ? indexPath.id : null);
+    }
+
+    public void moveNodes (NSArray nodes, NSIndexPath startingIndexPath)
+    {
+        OS.objc_msgSend(this.id, OS.sel_moveNodes_1toIndexPath_1, nodes !is null ? nodes.id : null,
+                startingIndexPath !is null ? startingIndexPath.id : null);
+    }
+
+    public bool preservesSelection ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_preservesSelection) !is null;
+    }
+
+    public void rearrangeObjects ()
+    {
+        OS.objc_msgSend(this.id, OS.sel_rearrangeObjects);
+    }
+
+    public void remove (id sender)
+    {
+        OS.objc_msgSend(this.id, OS.sel_remove_1, sender !is null ? sender.id : null);
+    }
+
+    public void removeObjectAtArrangedObjectIndexPath (NSIndexPath indexPath)
+    {
+        OS.objc_msgSend(this.id, OS.sel_removeObjectAtArrangedObjectIndexPath_1, indexPath !is null ? indexPath.id : null);
+    }
+
+    public void removeObjectsAtArrangedObjectIndexPaths (NSArray indexPaths)
+    {
+        OS.objc_msgSend(this.id, OS.sel_removeObjectsAtArrangedObjectIndexPaths_1, indexPaths !is null ? indexPaths.id : null);
+    }
+
+    public bool removeSelectionIndexPaths (NSArray indexPaths)
+    {
+        return OS.objc_msgSend(this.id, OS.sel_removeSelectionIndexPaths_1, indexPaths !is null ? indexPaths.id : null) !is null;
+    }
+
+    public NSArray selectedNodes ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_selectedNodes);
+        return result !is null ? new NSArray(result) : null;
+    }
+
+    public NSArray selectedObjects ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_selectedObjects);
+        return result !is null ? new NSArray(result) : null;
+    }
+
+    public NSIndexPath selectionIndexPath ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_selectionIndexPath);
+        return result !is null ? new NSIndexPath(result) : null;
+    }
+
+    public NSArray selectionIndexPaths ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_selectionIndexPaths);
+        return result !is null ? new NSArray(result) : null;
+    }
+
+    public bool selectsInsertedObjects ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_selectsInsertedObjects) !is null;
+    }
+
+    public void setAlwaysUsesMultipleValuesMarker (bool flag)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setAlwaysUsesMultipleValuesMarker_1, flag);
+    }
+
+    public void setAvoidsEmptySelection (bool flag)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setAvoidsEmptySelection_1, flag);
+    }
+
+    public void setChildrenKeyPath (NSString keyPath)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setChildrenKeyPath_1, keyPath !is null ? keyPath.id : null);
+    }
+
+    public void setContent (id content)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setContent_1, content !is null ? content.id : null);
+    }
+
+    public void setCountKeyPath (NSString keyPath)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setCountKeyPath_1, keyPath !is null ? keyPath.id : null);
+    }
+
+    public void setLeafKeyPath (NSString keyPath)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setLeafKeyPath_1, keyPath !is null ? keyPath.id : null);
+    }
+
+    public void setPreservesSelection (bool flag)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setPreservesSelection_1, flag);
+    }
+
+    public bool setSelectionIndexPath (NSIndexPath indexPath)
+    {
+        return OS.objc_msgSend(this.id, OS.sel_setSelectionIndexPath_1, indexPath !is null ? indexPath.id : null) !is null;
+    }
+
+    public bool setSelectionIndexPaths (NSArray indexPaths)
+    {
+        return OS.objc_msgSend(this.id, OS.sel_setSelectionIndexPaths_1, indexPaths !is null ? indexPaths.id : null) !is null;
+    }
+
+    public void setSelectsInsertedObjects (bool flag)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setSelectsInsertedObjects_1, flag);
+    }
+
+    public void setSortDescriptors (NSArray sortDescriptors)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setSortDescriptors_1, sortDescriptors !is null ? sortDescriptors.id : null);
+    }
+
+    public NSArray sortDescriptors ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_sortDescriptors);
+        return result !is null ? new NSArray(result) : null;
+    }
+
+}