summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLNotificationDispatcher.h
blob: f820ddc915807e5878950997b3f64afef17b285e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//
//  SDLnotificationDispatcher.h
//  SmartDeviceLink-iOS
//
//  Created by Joel Fischer on 7/7/16.
//  Copyright © 2016 smartdevicelink. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "SDLProxyListener.h"

@class SDLRPCRequest;
@class SDLRPCResponse;
@class SDLRPCNotification;


NS_ASSUME_NONNULL_BEGIN

/**
 *  The SDLNotificationDispatcher subscribes to SDLProxy notifications through SDLProxyListener and sends out actual NSNotifications with those contents. It can also be told to send out other types of notifications.
 */
@interface SDLNotificationDispatcher : NSObject <SDLProxyListener>

/**
 *  Posts a notification with a specified name and object.
 *
 *  @param name     The name of the notification to be dispatched.
 *  @param info     The notification object to be sent in the `userInfo` dictionary.
 */
- (void)postNotificationName:(NSString *)name infoObject:(nullable id)info;

/**
 *  Posts a request from Core with a specified name and request object
 *
 *  @param name     The name of the request to be dispatched
 *  @param request  The request object to be sent in the `userInfo` dictionary
 */
- (void)postRPCRequestNotification:(NSString *)name request:(__kindof SDLRPCRequest *)request;

/**
 *  Posts a response from Core with a specified name and response object
 *
 *  @param name     The name of the response to be dispatched
 *  @param response The response object to be sent in the `userInfo` dictionary
 */
- (void)postRPCResponseNotification:(NSString *)name response:(__kindof SDLRPCResponse *)response;

/**
 *  Posts a notification from Core with a specified name and notification object
 *
 *  @param name             The name of the notification to be dispatched
 *  @param rpcNotification  The notification object to be sent in the `userInfo` dictionary
 */
- (void)postRPCNotificationNotification:(NSString *)name notification:(__kindof SDLRPCNotification *)rpcNotification;

@end

NS_ASSUME_NONNULL_END