view dstep/appkit/NSWindowController.d @ 22:f8a3b67adfcb

Removed duplicated methods
author Jacob Carlborg <doob@me.com>
date Tue, 09 Feb 2010 18:02:03 +0100
parents 19885b43130e
children b9de51448c6b
line wrap: on
line source

/**
 * Copyright: Copyright (c) 2009 Jacob Carlborg.
 * Authors: Jacob Carlborg
 * Version: Initial created: Sep 24, 2009 
 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
 */
module dstep.appkit.NSWindowController;

import dstep.appkit.NSDocument;
import dstep.appkit.NSNibDeclarations;
import dstep.appkit.NSResponder;
import dstep.appkit.NSWindow;
import dstep.foundation.NSArray;
import dstep.foundation.NSCoder;
import dstep.foundation.NSObject;
import dstep.foundation.NSString;
import dstep.objc.bridge.Bridge;
import dstep.objc.objc;

class NSWindowController : NSResponder, INSCoding
{
	mixin (ObjcWrap);
	
	this (NSCoder aDecoder)
	{
		super(typeof(this).alloc.initWithCoder(aDecoder).objcObject);
	}
	
	void encodeWithCoder (NSCoder aCoder)
	{
		return invokeObjcSelf!(void, "encodeWithCoder:", NSCoder)(aCoder);
	}
	
	typeof(this) initWithCoder (NSCoder aDecoder)
	{
		return invokeObjcSelf!(typeof(this), "initWithCoder:", NSCoder)(aDecoder);
	}

	NSWindowController initWithWindow (NSWindow window)
	{
		id result = invokeObjcSelf!(id, "initWithWindow:", NSWindow)(window);
		return result is this.objcObject ? this : (result !is null ? new NSWindowController(result) : null);
	}

	this (NSWindow window)
	{
		super(NSWindowController.alloc.initWithWindow(window).objcObject);
	}

	NSWindowController initWithWindowNibName (NSString windowNibName)
	{
		id result = invokeObjcSelf!(id, "initWithWindowNibName:", NSString)(windowNibName);
		return result is this.objcObject ? this : (result !is null ? new NSWindowController(result) : null);
	}

	this (NSString windowNibName)
	{
		super(NSWindowController.alloc.initWithWindowNibName(windowNibName).objcObject);
	}

	NSWindowController initWithWindowNibName (NSString windowNibName, Object owner)
	{
		id result = invokeObjcSelf!(id, "initWithWindowNibName:owner:", NSString, Object)(windowNibName, owner);
		return result is this.objcObject ? this : (result !is null ? new NSWindowController(result) : null);
	}

	this (NSString windowNibName, Object owner)
	{
		super(NSWindowController.alloc.initWithWindowNibName(windowNibName, owner).objcObject);
	}

	NSWindowController initWithWindowNibPath (NSString windowNibPath, Object owner)
	{
		id result = invokeObjcSelf!(id, "initWithWindowNibPath:owner:", NSString, Object)(windowNibPath, owner);
		return result is this.objcObject ? this : (result !is null ? new NSWindowController(result) : null);
	}

	NSString windowNibName ()
	{
		return invokeObjcSelf!(NSString, "windowNibName");
	}

	NSString windowNibPath ()
	{
		return invokeObjcSelf!(NSString, "windowNibPath");
	}

	Object owner ()
	{
		return invokeObjcSelf!(Object, "owner");
	}

	void setWindowFrameAutosaveName (NSString name)
	{
		return invokeObjcSelf!(void, "setWindowFrameAutosaveName:", NSString)(name);
	}

	NSString windowFrameAutosaveName ()
	{
		return invokeObjcSelf!(NSString, "windowFrameAutosaveName");
	}

	void setShouldCascadeWindows (bool flag)
	{
		return invokeObjcSelf!(void, "setShouldCascadeWindows:", bool)(flag);
	}

	bool shouldCascadeWindows ()
	{
		return invokeObjcSelf!(bool, "shouldCascadeWindows");
	}

	Object document ()
	{
		return invokeObjcSelf!(Object, "document");
	}

	void setDocument (NSDocument document)
	{
		return invokeObjcSelf!(void, "setDocument:", NSDocument)(document);
	}

	void setDocumentEdited (bool dirtyFlag)
	{
		return invokeObjcSelf!(void, "setDocumentEdited:", bool)(dirtyFlag);
	}

	void setShouldCloseDocument (bool flag)
	{
		return invokeObjcSelf!(void, "setShouldCloseDocument:", bool)(flag);
	}

	bool shouldCloseDocument ()
	{
		return invokeObjcSelf!(bool, "shouldCloseDocument");
	}

	void setWindow (NSWindow window)
	{
		return invokeObjcSelf!(void, "setWindow:", NSWindow)(window);
	}

	NSWindow window ()
	{
		return invokeObjcSelf!(NSWindow, "window");
	}

	void synchronizeWindowTitleWithDocumentName ()
	{
		return invokeObjcSelf!(void, "synchronizeWindowTitleWithDocumentName");
	}

	NSString windowTitleForDocumentDisplayName (NSString displayName)
	{
		return invokeObjcSelf!(NSString, "windowTitleForDocumentDisplayName:", NSString)(displayName);
	}

	void close ()
	{
		return invokeObjcSelf!(void, "close");
	}

	void showWindow (Object sender)
	{
		return invokeObjcSelf!(void, "showWindow:", Object)(sender);
	}

	bool isWindowLoaded ()
	{
		return invokeObjcSelf!(bool, "isWindowLoaded");
	}

	void windowWillLoad ()
	{
		return invokeObjcSelf!(void, "windowWillLoad");
	}

	void windowDidLoad ()
	{
		return invokeObjcSelf!(void, "windowDidLoad");
	}

	void loadWindow ()
	{
		return invokeObjcSelf!(void, "loadWindow");
	}

}