Merge "Revert "[SystemInfo] Replace deprecated native wifi API with wifi-manager...
[platform/core/api/webapi-plugins.git] / src / convergence / convergence_service.h
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *    Licensed under the Apache License, Version 2.0 (the "License");
5  *    you may not use this file except in compliance with the License.
6  *    You may obtain a copy of the License at
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *    Unless required by applicable law or agreed to in writing, software
11  *    distributed under the License is distributed on an "AS IS" BASIS,
12  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *    See the License for the specific language governing permissions and
14  *    limitations under the License.
15  */
16
17 #ifndef CONVERGENCE_CONVERGENCE_SERVICE_H__
18 #define CONVERGENCE_CONVERGENCE_SERVICE_H__
19
20 // TODO check includes
21 #include <d2d_conv_manager.h>
22
23 #include <string>
24 #include <unordered_map>
25
26 #include "common/tizen_result.h"
27
28 namespace extension {
29 namespace convergence {
30
31 class ConvergenceInstance;
32
33 class ConvergenceService {
34
35  public:
36   ConvergenceService();
37   ConvergenceService(conv_device_h device, conv_service_e type, ConvergenceInstance *convergence_plugin);
38   virtual ~ConvergenceService();
39   ConvergenceService(const ConvergenceService&) = delete;
40   ConvergenceService(ConvergenceService&&) = delete;
41   ConvergenceService& operator=(const ConvergenceService&) = delete;
42   ConvergenceService& operator=(ConvergenceService&&) = delete;
43
44  public:
45   void Refresh();
46
47  public:
48   //conv_service_e get_type() const { return type_; }
49   //conv_device_h get_device() const {return device_; }
50   picojson::value ToJson() const;
51
52  protected:
53   conv_service_h FindServiceHandle() const;
54   static void ForEachServiceCb(conv_service_h service_handle, void* user_data);
55   std::string ExtractServicePropery(conv_service_h service_handle,
56    const char *property);
57
58  protected:
59   ConvergenceInstance *convergence_plugin_;
60
61  //private:
62  protected: // TODO switch back to private:
63   conv_device_h device_; // TODO rename to device_handle_
64   conv_service_e type_;
65   mutable conv_service_h service_handle_;
66   friend class ConvergenceAppCommunicationServerService; // It is needed to register the local service
67  private:
68   conv_service_connection_state_e connection_state_;
69   std::string id_;
70   std::string version_;
71 };
72
73 } // namespace convergence
74 } // namespace extension
75
76 #endif // CONVERGENCE_CONVERGENCE_SERVICE_H__