|
1 | 1 | /* CFUserNotification.h
|
2 |
| - Copyright (c) 2000-2018, Apple Inc. and the Swift project authors |
| 2 | + Copyright (c) 2000-2019, Apple Inc. and the Swift project authors |
3 | 3 |
|
4 |
| - Portions Copyright (c) 2014-2018, Apple Inc. and the Swift project authors |
| 4 | + Portions Copyright (c) 2014-2019, Apple Inc. and the Swift project authors |
5 | 5 | Licensed under Apache License v2.0 with Runtime Library Exception
|
6 | 6 | See http://swift.org/LICENSE.txt for license information
|
7 | 7 | See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
@@ -69,116 +69,114 @@ of the textfields. */
|
69 | 69 | typedef void (*CFUserNotificationCallBack)(CFUserNotificationRef userNotification, CFOptionFlags responseFlags);
|
70 | 70 |
|
71 | 71 | CF_EXPORT
|
72 |
| -CFTypeID CFUserNotificationGetTypeID(void); |
| 72 | +CFTypeID CFUserNotificationGetTypeID(void) API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos); |
73 | 73 |
|
74 | 74 | CF_EXPORT
|
75 |
| -CFUserNotificationRef CFUserNotificationCreate(CFAllocatorRef allocator, CFTimeInterval timeout, CFOptionFlags flags, SInt32 *error, CFDictionaryRef dictionary); |
| 75 | +CFUserNotificationRef CFUserNotificationCreate(CFAllocatorRef allocator, CFTimeInterval timeout, CFOptionFlags flags, SInt32 *error, CFDictionaryRef dictionary) API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos); |
76 | 76 |
|
77 | 77 | CF_EXPORT
|
78 |
| -SInt32 CFUserNotificationReceiveResponse(CFUserNotificationRef userNotification, CFTimeInterval timeout, CFOptionFlags *responseFlags); |
| 78 | +SInt32 CFUserNotificationReceiveResponse(CFUserNotificationRef userNotification, CFTimeInterval timeout, CFOptionFlags *responseFlags) API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos); |
79 | 79 |
|
80 | 80 | CF_EXPORT
|
81 |
| -CFStringRef CFUserNotificationGetResponseValue(CFUserNotificationRef userNotification, CFStringRef key, CFIndex idx); |
| 81 | +CFStringRef CFUserNotificationGetResponseValue(CFUserNotificationRef userNotification, CFStringRef key, CFIndex idx) API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos); |
82 | 82 |
|
83 | 83 | CF_EXPORT
|
84 |
| -CFDictionaryRef CFUserNotificationGetResponseDictionary(CFUserNotificationRef userNotification); |
| 84 | +CFDictionaryRef CFUserNotificationGetResponseDictionary(CFUserNotificationRef userNotification) API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos); |
85 | 85 |
|
86 | 86 | CF_EXPORT
|
87 |
| -SInt32 CFUserNotificationUpdate(CFUserNotificationRef userNotification, CFTimeInterval timeout, CFOptionFlags flags, CFDictionaryRef dictionary); |
| 87 | +SInt32 CFUserNotificationUpdate(CFUserNotificationRef userNotification, CFTimeInterval timeout, CFOptionFlags flags, CFDictionaryRef dictionary) API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos); |
88 | 88 |
|
89 | 89 | CF_EXPORT
|
90 |
| -SInt32 CFUserNotificationCancel(CFUserNotificationRef userNotification); |
| 90 | +SInt32 CFUserNotificationCancel(CFUserNotificationRef userNotification) API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos); |
91 | 91 |
|
92 | 92 | CF_EXPORT
|
93 |
| -CFRunLoopSourceRef CFUserNotificationCreateRunLoopSource(CFAllocatorRef allocator, CFUserNotificationRef userNotification, CFUserNotificationCallBack callout, CFIndex order); |
| 93 | +CFRunLoopSourceRef CFUserNotificationCreateRunLoopSource(CFAllocatorRef allocator, CFUserNotificationRef userNotification, CFUserNotificationCallBack callout, CFIndex order) API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos); |
94 | 94 |
|
95 | 95 | /* Convenience functions for handling the simplest and most common cases:
|
96 | 96 | a one-way notification, and a notification with up to three buttons. */
|
97 | 97 |
|
98 | 98 | CF_EXPORT
|
99 |
| -SInt32 CFUserNotificationDisplayNotice(CFTimeInterval timeout, CFOptionFlags flags, CFURLRef iconURL, CFURLRef soundURL, CFURLRef localizationURL, CFStringRef alertHeader, CFStringRef alertMessage, CFStringRef defaultButtonTitle); |
| 99 | +SInt32 CFUserNotificationDisplayNotice(CFTimeInterval timeout, CFOptionFlags flags, CFURLRef iconURL, CFURLRef soundURL, CFURLRef localizationURL, CFStringRef alertHeader, CFStringRef alertMessage, CFStringRef defaultButtonTitle) API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos); |
100 | 100 |
|
101 | 101 | CF_EXPORT
|
102 |
| -SInt32 CFUserNotificationDisplayAlert(CFTimeInterval timeout, CFOptionFlags flags, CFURLRef iconURL, CFURLRef soundURL, CFURLRef localizationURL, CFStringRef alertHeader, CFStringRef alertMessage, CFStringRef defaultButtonTitle, CFStringRef alternateButtonTitle, CFStringRef otherButtonTitle, CFOptionFlags *responseFlags); |
| 102 | +SInt32 CFUserNotificationDisplayAlert(CFTimeInterval timeout, CFOptionFlags flags, CFURLRef iconURL, CFURLRef soundURL, CFURLRef localizationURL, CFStringRef alertHeader, CFStringRef alertMessage, CFStringRef defaultButtonTitle, CFStringRef alternateButtonTitle, CFStringRef otherButtonTitle, CFOptionFlags *responseFlags) API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos); |
103 | 103 |
|
104 | 104 |
|
105 | 105 | /* Flags */
|
106 | 106 |
|
107 | 107 | CF_ENUM(CFOptionFlags) {
|
108 |
| - kCFUserNotificationStopAlertLevel = 0, |
109 |
| - kCFUserNotificationNoteAlertLevel = 1, |
110 |
| - kCFUserNotificationCautionAlertLevel = 2, |
111 |
| - kCFUserNotificationPlainAlertLevel = 3 |
| 108 | + kCFUserNotificationStopAlertLevel API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos) = 0, |
| 109 | + kCFUserNotificationNoteAlertLevel API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos) = 1, |
| 110 | + kCFUserNotificationCautionAlertLevel API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos) = 2, |
| 111 | + kCFUserNotificationPlainAlertLevel API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos) = 3 |
112 | 112 | };
|
113 | 113 |
|
114 | 114 | CF_ENUM(CFOptionFlags) {
|
115 |
| - kCFUserNotificationDefaultResponse = 0, |
116 |
| - kCFUserNotificationAlternateResponse = 1, |
117 |
| - kCFUserNotificationOtherResponse = 2, |
118 |
| - kCFUserNotificationCancelResponse = 3 |
| 115 | + kCFUserNotificationDefaultResponse API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos) = 0, |
| 116 | + kCFUserNotificationAlternateResponse API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos) = 1, |
| 117 | + kCFUserNotificationOtherResponse API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos) = 2, |
| 118 | + kCFUserNotificationCancelResponse API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos) = 3 |
119 | 119 | };
|
120 | 120 |
|
121 | 121 | CF_ENUM(CFOptionFlags) {
|
122 |
| - kCFUserNotificationNoDefaultButtonFlag = (1UL << 5), |
123 |
| - kCFUserNotificationUseRadioButtonsFlag = (1UL << 6) |
| 122 | + kCFUserNotificationNoDefaultButtonFlag API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos) = (1UL << 5), |
| 123 | + kCFUserNotificationUseRadioButtonsFlag API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos) = (1UL << 6) |
124 | 124 | };
|
125 | 125 |
|
126 |
| -CF_INLINE CFOptionFlags CFUserNotificationCheckBoxChecked(CFIndex i) {return ((CFOptionFlags)(1UL << (8 + i)));} |
127 |
| -CF_INLINE CFOptionFlags CFUserNotificationSecureTextField(CFIndex i) {return ((CFOptionFlags)(1UL << (16 + i)));} |
128 |
| -CF_INLINE CFOptionFlags CFUserNotificationPopUpSelection(CFIndex n) {return ((CFOptionFlags)(n << 24));} |
| 126 | +CF_INLINE CFOptionFlags CFUserNotificationCheckBoxChecked(CFIndex i) API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos) {return ((CFOptionFlags)(1UL << (8 + i)));} |
| 127 | +CF_INLINE CFOptionFlags CFUserNotificationSecureTextField(CFIndex i) API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos) {return ((CFOptionFlags)(1UL << (16 + i)));} |
| 128 | +CF_INLINE CFOptionFlags CFUserNotificationPopUpSelection(CFIndex n) API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos) {return ((CFOptionFlags)(n << 24));} |
129 | 129 |
|
130 | 130 |
|
131 | 131 | /* Keys */
|
132 | 132 |
|
133 | 133 | CF_EXPORT
|
134 |
| -const CFStringRef kCFUserNotificationIconURLKey; |
| 134 | +const CFStringRef kCFUserNotificationIconURLKey API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos); |
135 | 135 |
|
136 | 136 | CF_EXPORT
|
137 |
| -const CFStringRef kCFUserNotificationSoundURLKey; |
| 137 | +const CFStringRef kCFUserNotificationSoundURLKey API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos); |
138 | 138 |
|
139 | 139 | CF_EXPORT
|
140 |
| -const CFStringRef kCFUserNotificationLocalizationURLKey; |
| 140 | +const CFStringRef kCFUserNotificationLocalizationURLKey API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos); |
141 | 141 |
|
142 | 142 | CF_EXPORT
|
143 |
| -const CFStringRef kCFUserNotificationAlertHeaderKey; |
| 143 | +const CFStringRef kCFUserNotificationAlertHeaderKey API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos); |
144 | 144 |
|
145 | 145 | CF_EXPORT
|
146 |
| -const CFStringRef kCFUserNotificationAlertMessageKey; |
| 146 | +const CFStringRef kCFUserNotificationAlertMessageKey API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos); |
147 | 147 |
|
148 | 148 | CF_EXPORT
|
149 |
| -const CFStringRef kCFUserNotificationDefaultButtonTitleKey; |
| 149 | +const CFStringRef kCFUserNotificationDefaultButtonTitleKey API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos); |
150 | 150 |
|
151 | 151 | CF_EXPORT
|
152 |
| -const CFStringRef kCFUserNotificationAlternateButtonTitleKey; |
| 152 | +const CFStringRef kCFUserNotificationAlternateButtonTitleKey API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos); |
153 | 153 |
|
154 | 154 | CF_EXPORT
|
155 |
| -const CFStringRef kCFUserNotificationOtherButtonTitleKey; |
| 155 | +const CFStringRef kCFUserNotificationOtherButtonTitleKey API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos); |
156 | 156 |
|
157 | 157 | CF_EXPORT
|
158 |
| -const CFStringRef kCFUserNotificationProgressIndicatorValueKey; |
| 158 | +const CFStringRef kCFUserNotificationProgressIndicatorValueKey API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos); |
159 | 159 |
|
160 | 160 | CF_EXPORT
|
161 |
| -const CFStringRef kCFUserNotificationPopUpTitlesKey; |
| 161 | +const CFStringRef kCFUserNotificationPopUpTitlesKey API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos); |
162 | 162 |
|
163 | 163 | CF_EXPORT
|
164 |
| -const CFStringRef kCFUserNotificationTextFieldTitlesKey; |
| 164 | +const CFStringRef kCFUserNotificationTextFieldTitlesKey API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos); |
165 | 165 |
|
166 | 166 | CF_EXPORT
|
167 |
| -const CFStringRef kCFUserNotificationCheckBoxTitlesKey; |
| 167 | +const CFStringRef kCFUserNotificationCheckBoxTitlesKey API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos); |
168 | 168 |
|
169 | 169 | CF_EXPORT
|
170 |
| -const CFStringRef kCFUserNotificationTextFieldValuesKey; |
| 170 | +const CFStringRef kCFUserNotificationTextFieldValuesKey API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos); |
171 | 171 |
|
172 | 172 | CF_EXPORT
|
173 | 173 | const CFStringRef kCFUserNotificationPopUpSelectionKey API_AVAILABLE(macos(10.3)) API_UNAVAILABLE(ios, watchos, tvos);
|
174 | 174 |
|
175 |
| -#if (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE) |
176 | 175 | CF_EXPORT
|
177 |
| -const CFStringRef kCFUserNotificationAlertTopMostKey; |
| 176 | +const CFStringRef kCFUserNotificationAlertTopMostKey API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos); |
178 | 177 |
|
179 | 178 | CF_EXPORT
|
180 |
| -const CFStringRef kCFUserNotificationKeyboardTypesKey; |
181 |
| -#endif |
| 179 | +const CFStringRef kCFUserNotificationKeyboardTypesKey API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos); |
182 | 180 |
|
183 | 181 | CF_EXTERN_C_END
|
184 | 182 | CF_IMPLICIT_BRIDGING_DISABLED
|
|
0 commit comments