Added SVACE Fixes for C++ wrapper Unit TCs
[platform/upstream/iotivity.git] / service / notification / cpp-wrapper / provider / inc / NSConsumer.h
1 //******************************************************************\r
2 //\r
3 // Copyright 2016 Samsung Electronics All Rights Reserved.\r
4 //\r
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
6 //\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
10 //\r
11 //      http://www.apache.org/licenses/LICENSE-2.0\r
12 //\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
18 //\r
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
20 \r
21 /**\r
22  * @file\r
23  *\r
24  * This file contains Notification service Consumer representation.\r
25  */\r
26 \r
27 #ifndef _NS_CONSUMER_H_\r
28 #define _NS_CONSUMER_H_\r
29 \r
30 \r
31 #include <string>\r
32 #include "NSCommon.h"\r
33 #include "NSUtils.h"\r
34 #include "NSTopicsList.h"\r
35 \r
36 namespace OIC\r
37 {\r
38     namespace Service\r
39     {\r
40         /**\r
41          * @class   NSConsumer\r
42          * @brief   This class provides a set of Notification service Consumer representation APIs.\r
43          */\r
44         class NSConsumer\r
45         {\r
46             public:\r
47                 /**\r
48                       * Constructor of NSConsumer.\r
49                       */\r
50                 NSConsumer() = default;\r
51 \r
52                 /**\r
53                       * Constructor of NSConsumer.\r
54                       *\r
55                       * @param consumerId -consumerId of the Notification service Consumer.\r
56                       */\r
57                 NSConsumer(const std::string &consumerId)\r
58                     : m_consumerId(consumerId)\r
59                 {\r
60                 }\r
61 \r
62                 /**\r
63                       * Constructor of NSConsumer.\r
64                       *\r
65                       * @param consumer - NSConsumer struct to initialize.\r
66                       */\r
67                 NSConsumer(::NSConsumer *consumer);\r
68 \r
69                 /**\r
70                       * Destructor of NSConsumer.\r
71                       */\r
72                 ~NSConsumer() = default;\r
73 \r
74                 /**\r
75                       * This method is for getting ConsumerId from the Notification service Consumer.\r
76                       *\r
77                       * @return ConsumerId as string.\r
78                       */\r
79                 std::string getConsumerId() const;\r
80 \r
81                 /**\r
82                       * This method is for setting icon image for the Notification service media contents.\r
83                       * This function is valid only when subControllability is set true.\r
84                       * @param accepted - as bool.\r
85                       */\r
86                 int acceptSubscription(bool accepted);\r
87 \r
88                 /**\r
89                      * Select a topic name for a consumer\r
90                      * @param[in]  topicName Topic name to select\r
91                      * @return :: OK or result code of NSResult\r
92                      */\r
93                 NSResult setTopic(const std::string &topicName);\r
94 \r
95                 /**\r
96                      * Unselect a topic from the topic list for consumer\r
97                      * @param[in]  topicName Topic name to unselect\r
98                      * @return :: OK or result code of NSResult\r
99                      */\r
100                 NSResult unsetTopic(const std::string &topicName);\r
101 \r
102                 /**\r
103                      * Request topic list with selection state for the consumer\r
104                      * @return :: Topic list\r
105                      */\r
106                 NSTopicsList *getConsumerTopicList();\r
107 \r
108             private:\r
109                 ::NSConsumer *getNSConsumer();\r
110 \r
111             private:\r
112                 std::string m_consumerId;\r
113         };\r
114     }\r
115 }\r
116 #endif /* _NS_CONSUMER_H_ */\r