1/* 2 * Copyright (c) 1998-2013 Apple Inc. All rights reserved. 3 * 4 * @APPLE_LICENSE_HEADER_START@ 5 * 6 * This file contains Original Code and/or Modifications of Original Code 7 * as defined in and that are subject to the Apple Public Source License 8 * Version 2.0 (the 'License'). You may not use this file except in 9 * compliance with the License. Please obtain a copy of the License at 10 * http://www.opensource.apple.com/apsl/ and read it before using this 11 * file. 12 * 13 * The Original Code and all software distributed under the License are 14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 * Please see the License for the specific language governing rights and 19 * limitations under the License. 20 * 21 * @APPLE_LICENSE_HEADER_END@ 22 */ 23 24#ifndef __DISKARBITRATION_DASESSION__ 25#define __DISKARBITRATION_DASESSION__ 26 27#include <CoreFoundation/CoreFoundation.h> 28 29#ifdef __cplusplus 30extern "C" { 31#endif /* __cplusplus */ 32 33#ifndef __DISKARBITRATIOND__ 34 35/*! 36 * @typedef DASessionRef 37 * Type of a reference to DASession instances. 38 */ 39 40typedef struct __DASession * DASessionRef; 41 42/*! 43 * @function DASessionGetTypeID 44 * @abstract Returns the type identifier of all DASession instances. 45 */ 46 47extern CFTypeID DASessionGetTypeID( void ); 48 49/*! 50 * @function DASessionCreate 51 * @abstract Creates a new session. 52 * @result A reference to a new DASession. 53 * @discussion 54 * The caller of this function receives a reference to the returned object. The 55 * caller also implicitly retains the object and is responsible for releasing it. 56 */ 57 58extern DASessionRef DASessionCreate( CFAllocatorRef allocator ); 59 60/*! 61 * @function DASessionScheduleWithRunLoop 62 * @abstract Schedules the session on a run loop. 63 * @param session The session which is being scheduled. 64 * @param runLoop The run loop on which the session should be scheduled. 65 * @param runLoopMode The run loop mode in which the session should be scheduled. 66 */ 67 68extern void DASessionScheduleWithRunLoop( DASessionRef session, CFRunLoopRef runLoop, CFStringRef runLoopMode ); 69 70/*! 71 * @function DASessionUnscheduleFromRunLoop 72 * @abstract Unschedules the session from a run loop. 73 * @param session The session which is being unscheduled. 74 * @param runLoop The run loop on which the session is scheduled. 75 * @param runLoopMode The run loop mode in which the session is scheduled. 76 */ 77 78extern void DASessionUnscheduleFromRunLoop( DASessionRef session, CFRunLoopRef runLoop, CFStringRef runLoopMode ); 79 80/*! 81 * @function DASessionSetDispatchQueue 82 * @abstract Schedules the session on a dispatch queue. 83 * @param session The session which is being scheduled. 84 * @param queue The dispatch queue on which the session should be scheduled. Pass NULL to unschedule. 85 */ 86 87extern void DASessionSetDispatchQueue( DASessionRef session, dispatch_queue_t queue ); 88 89/* 90 * @typedef DAApprovalSessionRef 91 * Type of a reference to DAApprovalSession instances. 92 */ 93 94typedef struct __DASession * DAApprovalSessionRef; 95 96/* 97 * @function DAApprovalSessionGetTypeID 98 * @abstract Returns the type identifier of all DAApprovalSession instances. 99 */ 100 101extern CFTypeID DAApprovalSessionGetTypeID( void ); 102 103/* 104 * @function DAApprovalSessionCreate 105 * @abstract Creates a new approval session. 106 * @result A reference to a new DAApprovalSession. 107 * @discussion 108 * The caller of this function receives a reference to the returned object. The 109 * caller also implicitly retains the object and is responsible for releasing it. 110 */ 111 112extern DAApprovalSessionRef DAApprovalSessionCreate( CFAllocatorRef allocator ); 113 114/* 115 * @function DAApprovalSessionScheduleWithRunLoop 116 * @abstract Schedules the approval session on a run loop. 117 * @param session The approval session which is being scheduled. 118 * @param runLoop The run loop on which the approval session should be scheduled. 119 * @param runLoopMode The run loop mode in which the approval session should be scheduled. 120 */ 121 122extern void DAApprovalSessionScheduleWithRunLoop( DAApprovalSessionRef session, CFRunLoopRef runLoop, CFStringRef runLoopMode ); 123 124/* 125 * @function DAApprovalSessionUnscheduleFromRunLoop 126 * @abstract Unschedules the approval session from a run loop. 127 * @param session The approval session which is being unscheduled. 128 * @param runLoop The run loop on which the approval session is scheduled. 129 * @param runLoopMode The run loop mode in which the approval session is scheduled. 130 */ 131 132extern void DAApprovalSessionUnscheduleFromRunLoop( DAApprovalSessionRef session, CFRunLoopRef runLoop, CFStringRef runLoopMode ); 133 134#endif /* !__DISKARBITRATIOND__ */ 135 136#ifdef __cplusplus 137} 138#endif /* __cplusplus */ 139 140#endif /* !__DISKARBITRATION_DASESSION__ */ 141