1 //******************************************************************
3 // Copyright 2016 Samsung Electronics All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
24 * This file provides APIs of Notification Service for Consumer.
27 #ifndef _NS_CONSUMER_INTERFACE_H_
28 #define _NS_CONSUMER_INTERFACE_H_
38 * Provider and consumer use this callback function to receive the status of the message
40 * @param[in] provider Provider who requests synchronization with the status
41 * @param[in] sync Synchronization information of the notification message
43 typedef void (*NSSyncCallback)(NSProvider *, NSSyncInfo *);
46 * Consumer uses this callback function to receive the discovered providers
47 * @param[in] provider Provider who has the notification resource
49 typedef void (*NSProviderDiscoveredCallback)(NSProvider *);
52 * Consumer use this callback function to receive notification message from provider
54 * @param[in] provider Provider who sends notification message
55 * @param[in] message Notification message
57 typedef void (*NSNotificationReceivedCallback)(NSProvider *, NSMessage *);
60 * Initialize notification service for consumer
61 * @param[in] providerDiscoveredCallback Callback function to discover notification providers
62 * @param[in] notificationReceivedCallback Callback function to receive notification messages
63 * @param[in] syncCallback Callback function to receive synchronization status of notification
64 * @return ::NS_OK or result code of NSResult
66 NSResult NSStartConsumer(NSProviderDiscoveredCallback discoverCb,
67 NSNotificationReceivedCallback postCb, NSSyncCallback syncCb);
70 * Terminate notification service for consumer
71 * @return ::NS_OK or result code of NSResult
73 NSResult NSStopConsumer();
76 * Request discovery manually
77 * @return ::NS_OK or result code of NSResult
79 NSResult NSRescanProvider();
82 * Request to subscribe notification message resource of provider
83 * @param[in] provider Provider who send the notification message
84 * @return ::NS_OK or result code of NSResult
86 NSResult NSSubscribe(NSProvider *provider);
89 * Request to unsubscribe in order not to receive notification message from provider
90 * @param[in] provider Provider who send the notification message
91 * @return ::NS_OK or result code of NSResult
93 NSResult NSUnsubscribe(NSProvider *provider);
95 NSResult NSConsumerReadCheck(NSMessage *);
97 NSResult NSConsumerDismissCheck(NSMessage *);
99 //** Remove below functions **//
100 NSResult NSDropNSObject(NSMessage *);
101 //** end of functions to be removed **//
105 #endif // __cplusplus
107 #endif // _NS_CONSUMER_INTERFACE_H_