// // SDLPermissionsConstants.h // SmartDeviceLink-iOS // // Created by Joel Fischer on 11/18/15. // Copyright © 2015 smartdevicelink. All rights reserved. // #import #import "NSNumber+NumberType.h" #import "SDLRPCFunctionNames.h" #import "SDLPermissionElement.h" #import "SDLRPCPermissionStatus.h" NS_ASSUME_NONNULL_BEGIN /// NSString typedef /// /// SDLPermissionRPCName: The name of the permission typedef NSString *SDLPermissionRPCName __deprecated_msg("Use SDLRPCFunctionName instead"); /// NSUUID typedef /// /// SDLPermissionObserverIdentifier: A unique identifier typedef NSUUID *SDLPermissionObserverIdentifier; /** * A permission group type which will be used to tell the system what type of changes you want to be notified about for the group. */ typedef NS_ENUM(NSUInteger, SDLPermissionGroupType) { /** * Be notified when all of the RPC in the group are allowed, or, when they all stop being allowed in some sense, that is, when they were all allowed, and now they are not. */ SDLPermissionGroupTypeAllAllowed, /** * Be notified when any change in availability occurs among the group. */ SDLPermissionGroupTypeAny }; /** * The status of the group of RPCs permissions. */ typedef NS_ENUM(NSUInteger, SDLPermissionGroupStatus) { /** * Every RPC in the group is currently allowed. */ SDLPermissionGroupStatusAllowed, /** * Every RPC in the group is currently disallowed. */ SDLPermissionGroupStatusDisallowed, /** * Some RPCs in the group are allowed and some disallowed. */ SDLPermissionGroupStatusMixed, /** * The current status of the group is unknown. */ SDLPermissionGroupStatusUnknown }; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" /** * This is a block that is passed in to some methods that will be stored and called when specified permissions change. * * @param updatedPermissionStatuses A dictionary of the new current status of all subscription items; containing * @param status The unified group status of the RPCs in the updatedPermissionStatuses dictionary. Allowed, if all RPCs are now allowed, Disallowed if all RPCs are now disallowed, or Mixed if some are allowed, and some are disallowed */ typedef void (^SDLPermissionsChangedHandler)(NSDictionary *_Nonnull updatedPermissionStatuses, SDLPermissionGroupStatus status) __deprecated_msg("Use SDLRPCPermissionStatusChangedHandler instead"); #pragma clang diagnostic pop /** * A block that will be called when specified permissions change. It will return whether each RPC and its parameters are allowed as well as the permission group status of all the RPCs. * * @param updatedPermissionStatuses A dictionary of the new current status of all subscription items; containing * @param status The unified group status of the RPCs in the updatedPermissionStatuses dictionary. Allowed, if all RPCs are now allowed, Disallowed if all RPCs are now disallowed, or Mixed if some are allowed, and some are disallowed */ typedef void (^SDLRPCPermissionStatusChangedHandler)(NSDictionary *_Nonnull updatedPermissionStatuses, SDLPermissionGroupStatus status); NS_ASSUME_NONNULL_END