Imported Upstream version 0.9.1
[platform/upstream/iotivity.git] / resource / include / IClientWrapper.h
1 //******************************************************************
2 //
3 // Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
4 //
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 //
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 //      http://www.apache.org/licenses/LICENSE-2.0
12 //
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 //
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20
21 #ifndef _I_CLIENT_WRAPPER_H_
22 #define _I_CLIENT_WRAPPER_H_
23
24 #include <memory>
25 #include <string>
26
27 #include <OCApi.h>
28
29 namespace OC
30 {
31     class OCPlatform_impl;
32
33     class IClientWrapper : public std::enable_shared_from_this<IClientWrapper>
34     {
35     protected:
36
37     public:
38         typedef std::shared_ptr<IClientWrapper> Ptr;
39
40         IClientWrapper()
41         {}
42
43         virtual OCStackResult ListenForResource(const std::string& serviceUrl,
44                         const std::string& resourceType, OCConnectivityType connectivityType,
45                         FindCallback& callback,
46                         QualityOfService QoS) = 0;
47
48         virtual OCStackResult ListenForDevice(const std::string& serviceUrl,
49                         const std::string& deviceURI, OCConnectivityType connectivityType,
50                         FindDeviceCallback& callback,
51                         QualityOfService QoS) = 0;
52
53         virtual OCStackResult GetResourceRepresentation(const std::string& host,
54                         const std::string& uri, OCConnectivityType connectivityType,
55                         const QueryParamsMap& queryParams,
56                         const HeaderOptions& headerOptions,
57                         GetCallback& callback, QualityOfService QoS)=0;
58
59         virtual OCStackResult PutResourceRepresentation(const std::string& host,
60                         const std::string& uri, OCConnectivityType connectivityType,
61                         const OCRepresentation& rep, const QueryParamsMap& queryParams,
62                         const HeaderOptions& headerOptions,
63                         PutCallback& callback, QualityOfService QoS) = 0;
64
65         virtual OCStackResult PostResourceRepresentation(const std::string& host,
66                         const std::string& uri, OCConnectivityType connectivityType,
67                         const OCRepresentation& rep, const QueryParamsMap& queryParams,
68                         const HeaderOptions& headerOptions,
69                         PostCallback& callback, QualityOfService QoS) = 0;
70
71         virtual OCStackResult DeleteResource(const std::string& host, const std::string& uri,
72                         OCConnectivityType connectivityType, const HeaderOptions& headerOptions,
73                         DeleteCallback& callback, QualityOfService QoS) = 0;
74
75         virtual OCStackResult ObserveResource(ObserveType observeType, OCDoHandle* handle,
76                         const std::string& host, const std::string& uri,
77                         OCConnectivityType connectivityType, const QueryParamsMap& queryParams,
78                         const HeaderOptions& headerOptions, ObserveCallback& callback,
79                         QualityOfService QoS)=0;
80
81         virtual OCStackResult CancelObserveResource(OCDoHandle handle, const std::string& host,
82             const std::string& uri, const HeaderOptions& headerOptions, QualityOfService QoS)=0;
83
84         virtual OCStackResult SubscribePresence(OCDoHandle* handle, const std::string& host,
85                         const std::string& resourceType, OCConnectivityType connectivityType,
86                         SubscribeCallback& presenceHandler)=0;
87
88         virtual OCStackResult UnsubscribePresence(OCDoHandle handle) =0;
89
90         virtual OCStackResult GetDefaultQos(QualityOfService& qos) = 0;
91
92         virtual ~IClientWrapper(){}
93     };
94 }
95
96 #endif
97