/* Copyright (c) 2008-2009 Christopher J. W. Lloyd Permission is hereby granted,free of charge,to any person obtaining a copy of this software and associated documentation files (the "Software"),to deal in the Software without restriction,including without limitation the rights to use,copy,modify,merge,publish,distribute,sublicense,and/or sell copies of the Software,and to permit persons to whom the Software is furnished to do so,subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS",WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED,INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,DAMAGES OR OTHER LIABILITY,WHETHER IN AN ACTION OF CONTRACT,TORT OR OTHERWISE,ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import #import #import #import typedef struct CFUserNotification *CFUserNotificationRef; typedef void (*CFUserNotificationCallBack)(CFUserNotificationRef userNotification,CFOptionFlags responseFlags); 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), }; COREFOUNDATION_EXPORT const CFStringRef kCFUserNotificationIconURLKey; COREFOUNDATION_EXPORT const CFStringRef kCFUserNotificationSoundURLKey; COREFOUNDATION_EXPORT const CFStringRef kCFUserNotificationLocalizationURLKey; COREFOUNDATION_EXPORT const CFStringRef kCFUserNotificationAlertHeaderKey; COREFOUNDATION_EXPORT const CFStringRef kCFUserNotificationAlertMessageKey; COREFOUNDATION_EXPORT const CFStringRef kCFUserNotificationDefaultButtonTitleKey; COREFOUNDATION_EXPORT const CFStringRef kCFUserNotificationAlternateButtonTitleKey; COREFOUNDATION_EXPORT const CFStringRef kCFUserNotificationOtherButtonTitleKey; COREFOUNDATION_EXPORT const CFStringRef kCFUserNotificationProgressIndicatorValueKey; COREFOUNDATION_EXPORT const CFStringRef kCFUserNotificationPopUpTitlesKey; COREFOUNDATION_EXPORT const CFStringRef kCFUserNotificationTextFieldTitlesKey; COREFOUNDATION_EXPORT const CFStringRef kCFUserNotificationCheckBoxTitlesKey; COREFOUNDATION_EXPORT const CFStringRef kCFUserNotificationTextFieldValuesKey; COREFOUNDATION_EXPORT const CFStringRef kCFUserNotificationPopUpSelectionKey; CFTypeID CFUserNotificationGetTypeID(void); CFOptionFlags CFUserNotificationCheckBoxChecked(CFIndex i); CFOptionFlags CFUserNotificationPopUpSelection(CFIndex n); CFOptionFlags CFUserNotificationSecureTextField(CFIndex i); CFInteger CFUserNotificationDisplayAlert(CFTimeInterval timeout,CFOptionFlags flags,CFURLRef iconURL,CFURLRef soundURL,CFURLRef localizationURL,CFStringRef alertHeader,CFStringRef alertMessage,CFStringRef defaultButtonTitle,CFStringRef alternateButtonTitle,CFStringRef otherButtonTitle,CFOptionFlags *responseFlags); CFInteger CFUserNotificationDisplayNotice(CFTimeInterval timeout,CFOptionFlags flags,CFURLRef iconURL,CFURLRef soundURL,CFURLRef localizationURL,CFStringRef alertHeader,CFStringRef alertMessage,CFStringRef defaultButtonTitle); CFUserNotificationRef CFUserNotificationCreate(CFAllocatorRef allocator,CFTimeInterval timeout,CFOptionFlags flags,CFInteger *error,CFDictionaryRef dictionary); CFInteger CFUserNotificationCancel(CFUserNotificationRef self); CFRunLoopSourceRef CFUserNotificationCreateRunLoopSource(CFAllocatorRef allocator,CFUserNotificationRef self,CFUserNotificationCallBack callback,CFIndex order); CFDictionaryRef CFUserNotificationGetResponseDictionary(CFUserNotificationRef self); CFStringRef CFUserNotificationGetResponseValue(CFUserNotificationRef self,CFStringRef key,CFIndex index); CFInteger CFUserNotificationReceiveResponse(CFUserNotificationRef self,CFTimeInterval timeout,CFOptionFlags *responseFlags); CFInteger CFUserNotificationUpdate(CFUserNotificationRef self,CFTimeInterval timeout,CFOptionFlags flags,CFDictionaryRef dictionary);