Function LSCopyDefaultApplicationURLForURL

Source
pub unsafe extern "C-unwind" fn LSCopyDefaultApplicationURLForURL(
    in_url: &CFURL,
    in_role_mask: LSRolesMask,
    out_error: *mut *mut CFError,
) -> Option<CFRetained<CFURL>>
👎Deprecated: Use -[NSWorkspace URLForApplicationToOpenURL:] instead.
Available on crate features LSInfo and LaunchServices and LSConstants only.
Expand description

Return the application used to open an item.

Consults the binding tables to return the application that would be used to open inURL if it were double-clicked in the Finder. This application will be the user-specified override if appropriate or the default otherwise.

Parameter inURL: The URL of the item for which the application is requested.

Parameter inRoleMask: Whether to return the editor or viewer for inURL. If you don’t care which, use kLSRolesAll.

Parameter outError: On failure, set to a CFError describing the problem. If you are not interested in this information, pass NULL. The caller is responsible for releasing this object.

Returns: If an acceptable application is found, its URL is returned. If the URL is a file:// URL, the application bound to the specified file or directory’s type is returned. If the URL’s scheme is something else, its default scheme handler is returned. If no application could be found, NULL is returned and outError (if not NULL) is populated. with kLSApplicationNotFoundErr. The caller is responsible for releasing this URL.