tizen 2.3 release
[framework/web/wearable/wrt-security.git] / src / services / popup / dbus / popup_response_dbus_interface.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    popup_response_dbus_interface.h
18  * @author  Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
19  * @author  Tomasz Swierczek (t.swierczek@samsung.com)
20  * @version 1.0
21  * @brief
22  */
23
24 #ifndef WRT_SRC_RPC_DAEMON_POPUP_RESPONSE_DBUS_INTERFACE_H
25 #define WRT_SRC_RPC_DAEMON_POPUP_RESPONSE_DBUS_INTERFACE_H
26
27 #include <dpl/dbus/dbus_interface_dispatcher.h>
28 #include "popup_response_server_api.h"
29
30 namespace RPC {
31
32 class PopupResponseDBusInterface : public DPL::DBus::InterfaceDispatcher
33 {
34 public:
35     PopupResponseDBusInterface():
36             DPL::DBus::InterfaceDispatcher(
37                     WrtSecurity::PopupServerApi::INTERFACE_NAME())
38     {
39         using namespace WrtSecurity;
40
41         setXmlSignature("<node>"
42                  "  <interface name='" +
43                          PopupServerApi::INTERFACE_NAME() + "'>"
44                  "    <method name='" +
45                          PopupServerApi::VALIDATION_METHOD() + "'>"
46                          // popup answer data
47                  "      <arg type='b' name='allowed' direction='in'/>"
48                  "      <arg type='i' name='valid' direction='in'/>"
49                          // this is copied from ace_server_dbus_interface
50                  "      <arg type='i' name='handle' direction='in'/>"
51                  "      <arg type='s' name='subject' direction='in'/>"
52                  "      <arg type='s' name='resource' direction='in'/>"
53                  "      <arg type='as' name='parameter names' direction='in'/>"
54                  "      <arg type='as' name='parameter values' direction='in'/>"
55                  "      <arg type='s' name='sessionId' direction='in'/>"
56                  "      <arg type='b' name='response' direction='out'/>"
57                  "    </method>"
58                  "  </interface>"
59                  "</node>");
60
61     }
62
63     virtual ~PopupResponseDBusInterface()
64     {}
65
66     virtual void onMethodCall(const gchar* methodName,
67                               GVariant* parameters,
68                               GDBusMethodInvocation* invocation);
69 };
70
71 }
72
73 #endif // WRT_SRC_RPC_DAEMON_POPUP_RESPONSE_DBUS_INTERFACE_H