view dstep/foundation/NSTimer.d @ 16:19885b43130e

Huge update, the bridge actually works now
author Jacob Carlborg <doob@me.com>
date Sun, 03 Jan 2010 22:06:11 +0100
parents 7ff919f595d5
children b9de51448c6b
line wrap: on
line source

/**
 * Copyright: Copyright (c) 2009 Jacob Carlborg.
 * Authors: Jacob Carlborg
 * Version: Initial created: Aug 3, 2009 
 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
 */
module dstep.foundation.NSTimer;

import dstep.foundation.NSDate;
import dstep.foundation.NSInvocation;
import dstep.foundation.NSObject;
import dstep.objc.bridge.Bridge;
import dstep.objc.objc;

class NSTimer : NSObject
{
	mixin (ObjcWrap);
	
	this ()
	{
		super(typeof(this).alloc.init.objcObject);
	}
	
	typeof(this) init ()
	{
		return invokeObjcSelf!(typeof(this), "init");
	}

	static NSTimer timerWithTimeInterval (double ti, NSInvocation invocation, bool yesOrNo)
	{
		return invokeObjcSuperClass!(NSTimer, "timerWithTimeInterval:invocation:repeats:", double, NSInvocation, bool)(ti, invocation, yesOrNo);
	}

	static NSTimer scheduledTimerWithTimeInterval (double ti, NSInvocation invocation, bool yesOrNo)
	{
		return invokeObjcSuperClass!(NSTimer, "scheduledTimerWithTimeInterval:invocation:repeats:", double, NSInvocation, bool)(ti, invocation, yesOrNo);
	}

	static NSTimer timerWithTimeInterval (double ti, Object aTarget, SEL aSelector, Object userInfo, bool yesOrNo)
	{
		return invokeObjcSuperClass!(NSTimer, "timerWithTimeInterval:target:selector:userInfo:repeats:", double, Object, SEL, Object, bool)(ti, aTarget, aSelector, userInfo, yesOrNo);
	}

	static NSTimer scheduledTimerWithTimeInterval (double ti, Object aTarget, SEL aSelector, Object userInfo, bool yesOrNo)
	{
		return invokeObjcSuperClass!(NSTimer, "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:", double, Object, SEL, Object, bool)(ti, aTarget, aSelector, userInfo, yesOrNo);
	}

	Object initWithFireDate (NSDate date, double ti, Object t, SEL s, Object ui, bool rep)
	{
		return invokeObjcSelf!(Object, "initWithFireDate:interval:target:selector:userInfo:repeats:", NSDate, double, Object, SEL, Object, bool)(date, ti, t, s, ui, rep);
	}

	this (NSDate date, double ti, Object t, SEL s, Object ui, bool rep)
	{
		typeof(this).alloc.initWithFireDate(date, ti, t, s, ui, rep);
	}

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

	NSDate fireDate ()
	{
		return invokeObjcSelf!(NSDate, "fireDate");
	}

	void setFireDate (NSDate date)
	{
		return invokeObjcSelf!(void, "setFireDate:", NSDate)(date);
	}

	double timeInterval ()
	{
		return invokeObjcSelf!(double, "timeInterval");
	}

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

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

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