2 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef CONVERGENCE_CONVERGENCE_SERVICE_H__
18 #define CONVERGENCE_CONVERGENCE_SERVICE_H__
20 // TODO check includes
21 #include <d2d_conv_manager.h>
24 #include <unordered_map>
26 #include "common/tizen_result.h"
29 namespace convergence {
31 class ConvergenceInstance;
33 class 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;
48 //conv_service_e get_type() const { return type_; }
49 //conv_device_h get_device() const {return device_; }
50 picojson::value ToJson() const;
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);
59 ConvergenceInstance *convergence_plugin_;
62 protected: // TODO switch back to private:
63 conv_device_h device_; // TODO rename to device_handle_
65 mutable conv_service_h service_handle_;
66 friend class ConvergenceAppCommunicationServerService; // It is needed to register the local service
68 conv_service_connection_state_e connection_state_;
73 } // namespace convergence
74 } // namespace extension
76 #endif // CONVERGENCE_CONVERGENCE_SERVICE_H__