tizen 2.3 release
[framework/web/wearable/wrt-security.git] / src / daemon / dbus / security_dbus_service.h
1 /*
2  * Copyright (c) 2011 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  * @file        security_dbus_service.h
18  * @author      Tomasz Swierczek (t.swierczek@samsung.com)
19  * @author      Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
20  * @version     1.0
21  * @brief       This file contains definitions of security DBus service.
22  */
23 #ifndef WRT_SRC_RPC_SECURITY_DBUS_SERVICE_H_
24 #define WRT_SRC_RPC_SECURITY_DBUS_SERVICE_H_
25
26 #include <memory>
27 #include <vector>
28 #include <dpl/dbus/connection.h>
29 #include <dpl/dbus/object.h>
30 #include <dpl/dbus/dispatcher.h>
31 #include <dpl/dbus/dbus_interface_dispatcher.h>
32 #include <security_daemon.h>
33
34 class SecurityDBusService : public SecurityDaemon::DaemonService {
35 private:
36     virtual void initialize();
37     virtual void start();
38     virtual void stop();
39     virtual void deinitialize();
40
41 private:
42     typedef std::shared_ptr<DPL::DBus::InterfaceDispatcher> InterfaceDispatcherPtr;
43     typedef std::shared_ptr<DPL::DBus::Dispatcher> DispatcherPtr;
44
45     void addInterface(const std::string& objectPath,
46                       const InterfaceDispatcherPtr& dispatcher);
47
48     DPL::DBus::ConnectionPtr m_connection;
49     std::vector<DPL::DBus::ObjectPtr> m_objects;
50     std::vector<DispatcherPtr> m_dispatchers;
51 };
52
53 #endif // WRT_SRC_RPC_SECURITY_DBUS_SERVICE_H_