Function

LSCanRefAcceptItem(_:_:_:_:_:)

Tests whether an application can accept (open) an item designated by file-system reference.

Declaration

func LSCanRefAcceptItem(_ inItemFSRef: UnsafePointer<FSRef>!, _ inTargetRef: UnsafePointer<FSRef>!, _ inRoleMask: LSRolesMask, _ inFlags: LSAcceptanceFlags, _ outAcceptsItem: UnsafeMutablePointer<DarwinBoolean>!) -> OSStatus

Parameters

inItemFSRef

A pointer to a file-system reference designating the source item (the item to test for acceptance by the target application); see the File Manager Reference in the Carbon File Management Documentation for a description of the FSRef data type.

inTargetFSRef

A pointer to a file-system reference designating the target application; see the File Manager Reference in the Carbon File Management Documentation for a description of the FSRef data type.

inRolesMask

A bit mask specifying the target application’s desired role or roles with respect to the source item; see LSRolesMask for a description of this mask. If the role is unimportant, pass kLSRolesAll.

inFlags

Flags specifying behavior to observe during the acceptance test; see LSAcceptanceFlags for a description of these flags.

outAcceptsItem

A pointer to a Boolean value that, on return, will indicate whether the target application can accept the source item with at least one of the specified roles.

Return Value

A result code; see Result Codes.

Discussion

Thread-safe since Mac OS version 10.2.

See Also

Locating an Application

func LSGetApplicationForItem(UnsafePointer<FSRef>!, LSRolesMask, UnsafeMutablePointer<FSRef>!, UnsafeMutablePointer<Unmanaged<CFURL>?>!) -> OSStatus

Locates the preferred application for opening an item designated by file-system reference.

Deprecated
func LSGetApplicationForInfo(OSType, OSType, CFString!, LSRolesMask, UnsafeMutablePointer<FSRef>!, UnsafeMutablePointer<Unmanaged<CFURL>?>!) -> OSStatus

Locates the preferred application for opening items with a specified file type, creator signature, filename extension, or any combination of these characteristics.

Deprecated
func LSCopyApplicationForMIMEType(CFString!, LSRolesMask, UnsafeMutablePointer<Unmanaged<CFURL>?>!) -> OSStatus

Locates the preferred application for opening items with a specified MIME type.

Deprecated
func LSCopyApplicationURLsForURL(CFURL, LSRolesMask) -> Unmanaged<CFArray>?

Locates all known applications suitable for opening an item designated by the specified URL.

func LSCopyApplicationURLsForBundleIdentifier(CFString, UnsafeMutablePointer<Unmanaged<CFError>?>?) -> Unmanaged<CFArray>?

Locates all URLs for applications that correspond to the specified bundle identifier.

func LSFindApplicationForInfo(OSType, CFString!, CFString!, UnsafeMutablePointer<FSRef>!, UnsafeMutablePointer<Unmanaged<CFURL>?>!) -> OSStatus

Locates an application with a specified creator signature, bundle ID, filename, or any combination of these characteristics.

Deprecated