diff dwt/internal/cocoa/NSBrowser.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/NSBrowser.d	Sat Aug 09 17:00:02 2008 +0200
@@ -0,0 +1,552 @@
+/*******************************************************************************
+ * 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.NSBrowser;
+
+import dwt.internal.cocoa.id;
+import dwt.internal.cocoa.CGFloat;
+import dwt.internal.cocoa.NSArray;
+import dwt.internal.cocoa.NSCell;
+import dwt.internal.cocoa.NSColor;
+import dwt.internal.cocoa.NSControl;
+import dwt.internal.cocoa.NSEvent;
+import dwt.internal.cocoa.NSImage;
+import dwt.internal.cocoa.NSIndexSet;
+import dwt.internal.cocoa.NSInteger;
+import dwt.internal.cocoa.NSMatrix;
+import dwt.internal.cocoa.NSPoint : NSPointPointer;
+import dwt.internal.cocoa.NSRect;
+import dwt.internal.cocoa.NSScroller;
+import dwt.internal.cocoa.NSString;
+import dwt.internal.cocoa.OS;
+import objc = dwt.internal.objc.runtime;
+
+public class NSBrowser : NSControl
+{
+    public this ()
+    {
+        super();
+    }
+
+    public this (objc.id id)
+    {
+        super(id);
+    }
+
+    public bool acceptsArrowKeys ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_acceptsArrowKeys) !is null;
+    }
+
+    public void addColumn ()
+    {
+        OS.objc_msgSend(this.id, OS.sel_addColumn);
+    }
+
+    public bool allowsBranchSelection ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_allowsBranchSelection) !is null;
+    }
+
+    public bool allowsEmptySelection ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_allowsEmptySelection) !is null;
+    }
+
+    public bool allowsMultipleSelection ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_allowsMultipleSelection) !is null;
+    }
+
+    public bool allowsTypeSelect ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_allowsTypeSelect) !is null;
+    }
+
+    public NSColor backgroundColor ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_backgroundColor);
+        return result !is null ? new NSColor(result) : null;
+    }
+
+    public bool canDragRowsWithIndexes (NSIndexSet rowIndexes, NSInteger column, NSEvent event)
+    {
+        return OS.objc_msgSend(this.id, OS.sel_canDragRowsWithIndexes_1inColumn_1withEvent_1, rowIndexes !is null ? rowIndexes.id : null, column,
+                event !is null ? event.id : null) !is null;
+    }
+
+    public static objc.Class cellClass ()
+    {
+        return OS.objc_msgSend(OS.class_NSBrowser, OS.sel_cellClass);
+    }
+
+    public id cellPrototype ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_cellPrototype);
+        return result !is null ? new id(result) : null;
+    }
+
+    public CGFloat columnContentWidthForColumnWidth (CGFloat columnWidth)
+    {
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_columnContentWidthForColumnWidth_1, columnWidth);
+    }
+
+    public NSInteger columnOfMatrix (NSMatrix matrix)
+    {
+        return OS.objc_msgSend(this.id, OS.sel_columnOfMatrix_1, matrix !is null ? matrix.id : null);
+    }
+
+    public objc.id columnResizingType ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_columnResizingType);
+    }
+
+    public CGFloat columnWidthForColumnContentWidth (CGFloat columnContentWidth)
+    {
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_columnWidthForColumnContentWidth_1, columnContentWidth);
+    }
+
+    public NSString columnsAutosaveName ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_columnsAutosaveName);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public id delegatee ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_delegate);
+        return result !is null ? new id(result) : null;
+    }
+
+    public void displayAllColumns ()
+    {
+        OS.objc_msgSend(this.id, OS.sel_displayAllColumns);
+    }
+
+    public void displayColumn (NSInteger column)
+    {
+        OS.objc_msgSend(this.id, OS.sel_displayColumn_1, column);
+    }
+
+    public void doClick (id sender)
+    {
+        OS.objc_msgSend(this.id, OS.sel_doClick_1, sender !is null ? sender.id : null);
+    }
+
+    public void doDoubleClick (id sender)
+    {
+        OS.objc_msgSend(this.id, OS.sel_doDoubleClick_1, sender !is null ? sender.id : null);
+    }
+
+    public SEL doubleAction ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_doubleAction);
+    }
+
+    public NSImage draggingImageForRowsWithIndexes (NSIndexSet rowIndexes, NSInteger column, NSEvent event, NSPointPointer dragImageOffset)
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_draggingImageForRowsWithIndexes_1inColumn_1withEvent_1offset_1,
+                rowIndexes !is null ? rowIndexes.id : null, column, event !is null ? event.id : null, dragImageOffset);
+        return result !is null ? new NSImage(result) : null;
+    }
+
+    public void drawTitleOfColumn (NSInteger column, NSRect aRect)
+    {
+        OS.objc_msgSend(this.id, OS.sel_drawTitleOfColumn_1inRect_1, column, aRect);
+    }
+
+    public NSInteger firstVisibleColumn ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_firstVisibleColumn);
+    }
+
+    public NSRect frameOfColumn (NSInteger column)
+    {
+        NSRect result;
+        OS.objc_msgSend_stret(result, this.id, OS.sel_frameOfColumn_1, column);
+        return result;
+    }
+
+    public NSRect frameOfInsideOfColumn (NSInteger column)
+    {
+        NSRect result;
+        OS.objc_msgSend_stret(result, this.id, OS.sel_frameOfInsideOfColumn_1, column);
+        return result;
+    }
+
+    public bool hasHorizontalScroller ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_hasHorizontalScroller) !is null;
+    }
+
+    public bool isLoaded ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_isLoaded) !is null;
+    }
+
+    public bool isTitled ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_isTitled) !is null;
+    }
+
+    public NSInteger lastColumn ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_lastColumn);
+    }
+
+    public NSInteger lastVisibleColumn ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_lastVisibleColumn);
+    }
+
+    public void loadColumnZero ()
+    {
+        OS.objc_msgSend(this.id, OS.sel_loadColumnZero);
+    }
+
+    public id loadedCellAtRow (NSInteger row, NSInteger col)
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_loadedCellAtRow_1column_1, row, col);
+        return result !is null ? new id(result) : null;
+    }
+
+    public objc.Class matrixClass ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_matrixClass);
+    }
+
+    public NSMatrix matrixInColumn (NSInteger column)
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_matrixInColumn_1, column);
+        return result !is null ? new NSMatrix(result) : null;
+    }
+
+    public NSInteger maxVisibleColumns ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_maxVisibleColumns);
+    }
+
+    public CGFloat minColumnWidth ()
+    {
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_minColumnWidth);
+    }
+
+    public NSInteger numberOfVisibleColumns ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_numberOfVisibleColumns);
+    }
+
+    public NSString path ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_path);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public NSString pathSeparator ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_pathSeparator);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public NSString pathToColumn (NSInteger column)
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_pathToColumn_1, column);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public bool prefersAllColumnUserResizing ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_prefersAllColumnUserResizing) !is null;
+    }
+
+    public void reloadColumn (NSInteger column)
+    {
+        OS.objc_msgSend(this.id, OS.sel_reloadColumn_1, column);
+    }
+
+    public static void removeSavedColumnsWithAutosaveName (NSString name)
+    {
+        OS.objc_msgSend(OS.class_NSBrowser, OS.sel_removeSavedColumnsWithAutosaveName_1, name !is null ? name.id : null);
+    }
+
+    public bool reusesColumns ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_reusesColumns) !is null;
+    }
+
+    public void scrollColumnToVisible (NSInteger column)
+    {
+        OS.objc_msgSend(this.id, OS.sel_scrollColumnToVisible_1, column);
+    }
+
+    public void scrollColumnsLeftBy (NSInteger shiftAmount)
+    {
+        OS.objc_msgSend(this.id, OS.sel_scrollColumnsLeftBy_1, shiftAmount);
+    }
+
+    public void scrollColumnsRightBy (NSInteger shiftAmount)
+    {
+        OS.objc_msgSend(this.id, OS.sel_scrollColumnsRightBy_1, shiftAmount);
+    }
+
+    public void scrollViaScroller (NSScroller sender)
+    {
+        OS.objc_msgSend(this.id, OS.sel_scrollViaScroller_1, sender !is null ? sender.id : null);
+    }
+
+    public void selectAll (id sender)
+    {
+        OS.objc_msgSend(this.id, OS.sel_selectAll_1, sender !is null ? sender.id : null);
+    }
+
+    public void selectRow (NSInteger row, NSInteger column)
+    {
+        OS.objc_msgSend(this.id, OS.sel_selectRow_1inColumn_1, row, column);
+    }
+
+    public void selectRowIndexes (NSIndexSet indexes, NSInteger column)
+    {
+        OS.objc_msgSend(this.id, OS.sel_selectRowIndexes_1inColumn_1, indexes !is null ? indexes.id : null, column);
+    }
+
+    public id selectedCell ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_selectedCell);
+        return result !is null ? new id(result) : null;
+    }
+
+    public id selectedCellInColumn (NSInteger column)
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_selectedCellInColumn_1, column);
+        return result !is null ? new id(result) : null;
+    }
+
+    public NSArray selectedCells ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_selectedCells);
+        return result !is null ? new NSArray(result) : null;
+    }
+
+    public NSInteger selectedColumn ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_selectedColumn);
+    }
+
+    public NSInteger selectedRowInColumn (NSInteger column)
+    {
+        return OS.objc_msgSend(this.id, OS.sel_selectedRowInColumn_1, column);
+    }
+
+    public NSIndexSet selectedRowIndexesInColumn (NSInteger column)
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_selectedRowIndexesInColumn_1, column);
+        return result !is null ? new NSIndexSet(result) : null;
+    }
+
+    public bool sendAction ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_sendAction) !is null;
+    }
+
+    public bool sendsActionOnArrowKeys ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_sendsActionOnArrowKeys) !is null;
+    }
+
+    public bool separatesColumns ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_separatesColumns) !is null;
+    }
+
+    public void setAcceptsArrowKeys (bool flag)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setAcceptsArrowKeys_1, flag);
+    }
+
+    public void setAllowsBranchSelection (bool flag)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setAllowsBranchSelection_1, flag);
+    }
+
+    public void setAllowsEmptySelection (bool flag)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setAllowsEmptySelection_1, flag);
+    }
+
+    public void setAllowsMultipleSelection (bool flag)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setAllowsMultipleSelection_1, flag);
+    }
+
+    public void setAllowsTypeSelect (bool value)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setAllowsTypeSelect_1, value);
+    }
+
+    public void setBackgroundColor (NSColor color)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color !is null ? color.id : null);
+    }
+
+    //public void setCellClass(Class factoryId) {
+    //  OS.objc_msgSend(this.id, OS.sel_setCellClass_1, factoryId);
+    //}
+
+    public void setCellPrototype (NSCell aCell)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setCellPrototype_1, aCell !is null ? aCell.id : null);
+    }
+
+    public void setColumnResizingType (objc.id columnResizingType)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setColumnResizingType_1, columnResizingType);
+    }
+
+    public void setColumnsAutosaveName (NSString name)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setColumnsAutosaveName_1, name !is null ? name.id : null);
+    }
+
+    public void setDelegate (id anObject)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setDelegate_1, anObject !is null ? anObject.id : null);
+    }
+
+    public void setDoubleAction (objc.SEL aSelector)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setDoubleAction_1, aSelector);
+    }
+
+    public void setDraggingSourceOperationMask (objc.id mask, bool isLocal)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setDraggingSourceOperationMask_1forLocal_1, mask, isLocal);
+    }
+
+    public void setHasHorizontalScroller (bool flag)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setHasHorizontalScroller_1, flag);
+    }
+
+    public void setLastColumn (NSInteger column)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setLastColumn_1, column);
+    }
+
+    public void setMatrixClass (Class factoryId)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setMatrixClass_1, factoryId);
+    }
+
+    public void setMaxVisibleColumns (NSInteger columnCount)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setMaxVisibleColumns_1, columnCount);
+    }
+
+    public void setMinColumnWidth (CGFloat columnWidth)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setMinColumnWidth_1, columnWidth);
+    }
+
+    public bool setPath (NSString path)
+    {
+        return OS.objc_msgSend(this.id, OS.sel_setPath_1, path !is null ? path.id : null) !is null;
+    }
+
+    public void setPathSeparator (NSString newString)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setPathSeparator_1, newString !is null ? newString.id : null);
+    }
+
+    public void setPrefersAllColumnUserResizing (bool prefersAllColumnResizing)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setPrefersAllColumnUserResizing_1, prefersAllColumnResizing);
+    }
+
+    public void setReusesColumns (bool flag)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setReusesColumns_1, flag);
+    }
+
+    public void setSendsActionOnArrowKeys (bool flag)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setSendsActionOnArrowKeys_1, flag);
+    }
+
+    public void setSeparatesColumns (bool flag)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setSeparatesColumns_1, flag);
+    }
+
+    public void setTakesTitleFromPreviousColumn (bool flag)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setTakesTitleFromPreviousColumn_1, flag);
+    }
+
+    public void setTitle (NSString aString, NSInteger column)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setTitle_1ofColumn_1, aString !is null ? aString.id : null, column);
+    }
+
+    public void setTitled (bool flag)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setTitled_1, flag);
+    }
+
+    public void setWidth (CGFloat columnWidth, NSInteger columnIndex)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setWidth_1ofColumn_1, columnWidth, columnIndex);
+    }
+
+    public bool takesTitleFromPreviousColumn ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_takesTitleFromPreviousColumn) !is null;
+    }
+
+    public void tile ()
+    {
+        OS.objc_msgSend(this.id, OS.sel_tile);
+    }
+
+    public NSRect titleFrameOfColumn (NSInteger column)
+    {
+        NSRect result;
+        OS.objc_msgSend_stret(result, this.id, OS.sel_titleFrameOfColumn_1, column);
+        return result;
+    }
+
+    public CGFloat titleHeight ()
+    {
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_titleHeight);
+    }
+
+    public NSString titleOfColumn (NSInteger column)
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_titleOfColumn_1, column);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public void updateScroller ()
+    {
+        OS.objc_msgSend(this.id, OS.sel_updateScroller);
+    }
+
+    public void validateVisibleColumns ()
+    {
+        OS.objc_msgSend(this.id, OS.sel_validateVisibleColumns);
+    }
+
+    public CGFloat widthOfColumn (NSInteger column)
+    {
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_widthOfColumn_1, column);
+    }
+}