Imported Upstream version 1.2.0
[platform/upstream/iotivity.git] / service / notification / cpp-wrapper / common / NSSyncInfo.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 SyncInfo representation.\r
25  */\r
26 \r
27 #ifndef _NS_SYNC_INFO_H_\r
28 #define _NS_SYNC_INFO_H_\r
29 \r
30 #include <string>\r
31 #include "NSCommon.h"\r
32 \r
33 namespace OIC\r
34 {\r
35     namespace Service\r
36     {\r
37         /**\r
38          * @class   NSSyncInfo\r
39          * @brief   This class provides a set of APIs for Notification service SyncInfo .\r
40          */\r
41         class NSSyncInfo\r
42         {\r
43             public:\r
44                 /** NSSyncType - enumeration for Notification service SyncType*/\r
45                 enum class NSSyncType\r
46                 {\r
47                     NS_SYNC_UNREAD = 0,\r
48                     NS_SYNC_READ = 1,\r
49                     NS_SYNC_DELETED = 2,\r
50                 };\r
51 \r
52                 /**\r
53                         * Constructor of NSSyncInfo.\r
54                         */\r
55                 NSSyncInfo(): m_messageId(0), m_state(NSSyncType::NS_SYNC_UNREAD)\r
56                 {\r
57                 }\r
58 \r
59                 /**\r
60                         * Constructor of NSSyncInfo.\r
61                         *\r
62                         * @param syncInfo - pointer to NSSyncInfo struct to initialize.\r
63                         */\r
64                 NSSyncInfo(::NSSyncInfo *syncInfo);\r
65 \r
66 \r
67                 /**\r
68                         * Constructor of NSSyncInfo.\r
69                         *\r
70                         * @param messageId - messageId of the Notification SyncInfo.\r
71                         * @param providerId - providerId of the Notification SyncInfo.\r
72                         * @param state - state of the Notification SyncInfo.\r
73                         */\r
74                 NSSyncInfo(const uint64_t &messageId, const std::string &providerId,\r
75                            const NSSyncType &state)\r
76                     : m_messageId(messageId), m_providerId(providerId), m_state(state)\r
77                 {\r
78                 }\r
79 \r
80                 /**\r
81                         * Destructor of NSSyncInfo.\r
82                         */\r
83                 ~NSSyncInfo() = default;\r
84 \r
85                 /**\r
86                      * This method is for getting Message Id from the Notification service sync info.\r
87                      *\r
88                      * @return Id as uint64_t.\r
89                      */\r
90                 uint64_t getMessageId() const;\r
91 \r
92                 /**\r
93                      * This method is for getting Provider Id from the Notification service sync info.\r
94                      *\r
95                      * @return Id as string.\r
96                      */\r
97                 std::string getProviderId() const;\r
98 \r
99                 /**\r
100                      * This method is for getting state from the Notification service sync info.\r
101                      *\r
102                      * @return state as NSSyncType.\r
103                      */\r
104                 NSSyncType getState() const;\r
105 \r
106             private:\r
107                 uint64_t m_messageId;\r
108                 std::string m_providerId;\r
109                 NSSyncType m_state;\r
110         };\r
111     }\r
112 }\r
113 #endif /* _NS_SYNC_INFO_H_ */\r