view dstep/corefoundation/CFUserNotification.d @ 11:07194b026fa4

Added bindings to a couple of frameworks, new license + some other things
author Jacob Carlborg <doob@me.com>
date Sat, 01 Aug 2009 15:03:28 +0200
parents
children
line wrap: on
line source

/**
 * Copyright: Copyright (c) 2009 Jacob Carlborg.
 * Authors: Jacob Carlborg
 * Version: Initial created: Jul 12, 2009 
 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
 */
module dstep.corefoundation.CFUserNotification;

import dstep.corefoundation.CFBase;
import dstep.corefoundation.CFDate;
import dstep.corefoundation.CFDictionary;
import dstep.corefoundation.CFRunLoop;
import dstep.corefoundation.CFString;
import dstep.corefoundation.CFURL;
import dstep.objc.bridge.Bridge;
import dstep.objc.objc : id;

struct __CFUserNotification;
alias __CFUserNotification* CFUserNotificationRef;

extern (C)
{
	alias void function (CFUserNotificationRef, uint) CFUserNotificationCallBack;
}

extern (C)
{
	extern
	{
		const CFStringRef kCFUserNotificationIconURLKey;
		const CFStringRef kCFUserNotificationSoundURLKey;
		const CFStringRef kCFUserNotificationLocalizationURLKey;
		const CFStringRef kCFUserNotificationAlertHeaderKey;
		const CFStringRef kCFUserNotificationAlertMessageKey;
		const CFStringRef kCFUserNotificationDefaultButtonTitleKey;
		const CFStringRef kCFUserNotificationAlternateButtonTitleKey;
		const CFStringRef kCFUserNotificationOtherButtonTitleKey;
		const CFStringRef kCFUserNotificationProgressIndicatorValueKey;
		const CFStringRef kCFUserNotificationPopUpTitlesKey;
		const CFStringRef kCFUserNotificationTextFieldTitlesKey;
		const CFStringRef kCFUserNotificationCheckBoxTitlesKey;
		const CFStringRef kCFUserNotificationTextFieldValuesKey;
		const CFStringRef kCFUserNotificationPopUpSelectionKey;
	}
}

enum
{
	kCFUserNotificationStopAlertLevel = 0,
	kCFUserNotificationNoteAlertLevel = 1,
	kCFUserNotificationCautionAlertLevel = 2,
	kCFUserNotificationPlainAlertLevel = 3
}

enum
{
	kCFUserNotificationDefaultResponse = 0,
	kCFUserNotificationAlternateResponse = 1,
	kCFUserNotificationOtherResponse = 2,
	kCFUserNotificationCancelResponse = 3
}

enum
{
	kCFUserNotificationNoDefaultButtonFlag = (1 << 5),
	kCFUserNotificationUseRadioButtonsFlag = (1 << 6)
}

extern (C)
{
	uint CFUserNotificationGetTypeID ();
	CFUserNotificationRef CFUserNotificationCreate (CFAllocatorRef allocator, double timeout, uint flags, int* error, CFDictionaryRef dictionary);
	int CFUserNotificationReceiveResponse (CFUserNotificationRef userNotification, double timeout, uint* responseFlags);
	CFStringRef CFUserNotificationGetResponseValue (CFUserNotificationRef userNotification, CFStringRef key, int idx);
	CFDictionaryRef CFUserNotificationGetResponseDictionary (CFUserNotificationRef userNotification);
	int CFUserNotificationUpdate (CFUserNotificationRef userNotification, double timeout, uint flags, CFDictionaryRef dictionary);
	int CFUserNotificationCancel (CFUserNotificationRef userNotification);
	CFRunLoopSourceRef CFUserNotificationCreateRunLoopSource (CFAllocatorRef allocator, CFUserNotificationRef userNotification, CFUserNotificationCallBack* callout, int order);
	int CFUserNotificationDisplayNotice (double timeout, uint flags, CFURLRef iconURL, CFURLRef soundURL, CFURLRef localizationURL, CFStringRef alertHeader, CFStringRef alertMessage, CFStringRef defaultButtonTitle);
	int CFUserNotificationDisplayAlert (double timeout, uint flags, CFURLRef iconURL, CFURLRef soundURL, CFURLRef localizationURL, CFStringRef alertHeader, CFStringRef alertMessage, CFStringRef defaultButtonTitle, CFStringRef alternateButtonTitle, CFStringRef otherButtonTitle, uint* responseFlags);
}