Function

LSSetDefaultRoleHandlerForContentType

Sets the user’s preferred default handler for the specified content type in the specified roles.

Declaration

OSStatus LSSetDefaultRoleHandlerForContentType(CFStringRef inContentType, LSRolesMask inRole, CFStringRef inHandlerBundleID);

Parameters

inContentType

The content type for which the default role handler is being set. The content type is a uniform type identifier (UTI).

inRole

The roles for which the default role handler is being set. Pass kLSRolesAll to specify all roles. For additional possible values, see LSRolesMask.

inHandlerBundleID

The application bundle identifier that is to be set as the default handler for the specified content type and roles.

Return Value

A result code; see Result Codes.

Discussion

Call LSCopyDefaultRoleHandlerForContentType to get the current setting of the user’s preferred default handler for a specified content type.

Version-Notes

Thread-safe since OS X v10.4.

See Also

Working With Role Handlers

LSCopyAllRoleHandlersForContentType

Locates an array of application bundle identifiers for applications capable of handling a specified content type with the specified roles.

LSCopyDefaultRoleHandlerForContentType

Returns the application bundle identifier of the user’s preferred default handler for the specified content type with the specified role.

LSGetHandlerOptionsForContentType

Gets the handler options for the specified content type.

Deprecated
LSSetHandlerOptionsForContentType

Sets the handler option for the specified content type.

Deprecated
LSCopyAllHandlersForURLScheme

Locates application bundle identifiers for applications capable of handling the specified URL scheme.

Deprecated
LSCopyDefaultHandlerForURLScheme

Returns the application bundle identifier of the user’s preferred default handler for the specified URL scheme.

Deprecated
LSSetDefaultHandlerForURLScheme

Sets the user’s preferred default handler for the specified URL scheme.