1 //******************************************************************
\r
3 // Copyright 2016 Samsung Electronics All Rights Reserved.
\r
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
\r
7 // Licensed under the Apache License, Version 2.0 (the "License");
\r
8 // you may not use this file except in compliance with the License.
\r
9 // You may obtain a copy of the License at
\r
11 // http://www.apache.org/licenses/LICENSE-2.0
\r
13 // Unless required by applicable law or agreed to in writing, software
\r
14 // distributed under the License is distributed on an "AS IS" BASIS,
\r
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 // See the License for the specific language governing permissions and
\r
17 // limitations under the License.
\r
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
\r
24 * This file contains Notification service Consumer representation.
\r
27 #ifndef _NS_CONSUMER_H_
\r
28 #define _NS_CONSUMER_H_
\r
32 #include "NSCommon.h"
\r
33 #include "NSUtils.h"
\r
34 #include "NSTopicsList.h"
\r
42 * @brief This class provides a set of Notification service Consumer representation APIs.
\r
48 * Constructor of NSConsumer.
\r
50 NSConsumer() = default;
\r
53 * Constructor of NSConsumer.
\r
55 * @param consumerId -consumerId of the Notification service Consumer.
\r
57 NSConsumer(const std::string &consumerId)
\r
58 : m_consumerId(consumerId) {}
\r
61 * Constructor of NSConsumer.
\r
63 * @param consumer - NSConsumer struct to initialize.
\r
65 NSConsumer(::NSConsumer *consumer);
\r
68 * Destructor of NSConsumer.
\r
70 ~NSConsumer() = default;
\r
73 * This method is for getting ConsumerId from the Notification service Consumer.
\r
75 * @return ConsumerId as string.
\r
77 std::string getConsumerId() const;
\r
80 * This method is for setting icon image for the Notification service media contents.
\r
82 * @param consumer - NSConsumer.
\r
83 * @param accepted - as bool.
\r
85 int acceptSubscription(NSConsumer *consumer, bool accepted);
\r
88 * Select a topic name for a consumer
\r
89 * @param[in] topicName Topic name to select
\r
90 * @return :: OK or result code of NSResult
\r
92 NSResult selectTopic(const std::string &topicName);
\r
95 * Unselect a topic from the topic list for consumer
\r
96 * @param[in] topicName Topic name to unselect
\r
97 * @return :: OK or result code of NSResult
\r
99 NSResult unselectTopic(const std::string &topicName);
\r
102 * Request topic list with selection state for the consumer
\r
103 * @return :: Topic list
\r
105 NSTopicsList *getConsumerTopics();
\r
108 ::NSConsumer *getNSConsumer();
\r
111 std::string m_consumerId;
\r
115 #endif /* _NS_CONSUMER_H_ */
\r