Merge remote-tracking branch 'origin/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 \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() = default;\r
56 \r
57                 /**\r
58                         * Constructor of NSSyncInfo.\r
59                         *\r
60                         * @param syncInfo - pointer to NSSyncInfo struct to initialize.\r
61                         */\r
62                 NSSyncInfo(::NSSyncInfo *syncInfo);\r
63 \r
64 \r
65                 /**\r
66                         * Constructor of NSSyncInfo.\r
67                         *\r
68                         * @param messageId - messageId of the Notification SyncInfo.\r
69                         * @param providerId - providerId of the Notification SyncInfo.\r
70                         * @param state - state of the Notification SyncInfo.\r
71                         */\r
72                 NSSyncInfo(const uint64_t &messageId, const std::string &providerId,\r
73                            const NSSyncType &state)\r
74                     : m_messageId(messageId), m_providerId(providerId), m_state(state) {}\r
75 \r
76                 /**\r
77                         * Destructor of NSSyncInfo.\r
78                         */\r
79                 ~NSSyncInfo() = default;\r
80 \r
81                 /**\r
82                      * This method is for getting Message Id from the Notification service sync info.\r
83                      *\r
84                      * @return Id as uint64_t.\r
85                      */\r
86                 uint64_t getMessageId() const;\r
87 \r
88                 /**\r
89                      * This method is for getting Provider Id from the Notification service sync info.\r
90                      *\r
91                      * @return Id as string.\r
92                      */\r
93                 std::string getProviderId() const;\r
94 \r
95                 /**\r
96                      * This method is for getting state from the Notification service sync info.\r
97                      *\r
98                      * @return state as NSSyncType.\r
99                      */\r
100                 NSSyncType getState() const;\r
101 \r
102             private:\r
103                 uint64_t m_messageId;\r
104                 std::string m_providerId;\r
105                 NSSyncType m_state;\r
106         };\r
107     }\r
108 }\r
109 #endif /* _NS_SYNC_INFO_H_ */\r