Merge branch 'master' into notification-service
[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 #include "oic_string.h"\r
33 #include "string.h"\r
34 \r
35 namespace OIC\r
36 {\r
37     namespace Service\r
38     {\r
39         /**\r
40          * @class   NSSyncInfo\r
41          * @brief   This class provides a set of APIs for Notification service SyncInfo .\r
42          */\r
43         class NSSyncInfo\r
44         {\r
45             public:\r
46                 /** NSSyncType - enumeration for Notification service SyncType*/\r
47                 enum class NSSyncType\r
48                 {\r
49                     NS_SYNC_UNREAD = 0,\r
50                     NS_SYNC_READ = 1,\r
51                     NS_SYNC_DELETED = 2,\r
52                 };\r
53 \r
54                 /**\r
55                         * Constructor of NSSyncInfo.\r
56                         */\r
57                 NSSyncInfo() = default;\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                         * Destructor of NSSyncInfo.\r
80                         */\r
81                 ~NSSyncInfo() = default;\r
82 \r
83                 /**\r
84                      * This method is for getting Message Id from the Notification service sync info.\r
85                      *\r
86                      * @return Id as uint64_t.\r
87                      */\r
88                 uint64_t getMessageId() const;\r
89 \r
90                 /**\r
91                      * This method is for getting Provider Id from the Notification service sync info.\r
92                      *\r
93                      * @return Id as string.\r
94                      */\r
95                 std::string getProviderId() const;\r
96 \r
97                 /**\r
98                      * This method is for getting state from the Notification service sync info.\r
99                      *\r
100                      * @return state as NSSyncType.\r
101                      */\r
102                 NSSyncType getState() const;\r
103 \r
104             private:\r
105                 uint64_t m_messageId;\r
106                 std::string m_providerId;\r
107                 NSSyncType m_state;\r
108         };\r
109     }\r
110 }\r
111 #endif /* _NS_SYNC_INFO_H_ */\r