68e439737d3f69c007794da2e41a3f1fcc502ca0
[platform/framework/web/wrt-commons.git] / modules / dbus / include / dpl / dbus / dispatcher.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    dispatcher.h
18  * @author  Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
19  * @version 1.0
20  * @brief
21  */
22
23 #ifndef DPL_DBUS_DISPATCHER_H
24 #define DPL_DBUS_DISPATCHER_H
25
26 #include <gio/gio.h>
27
28 namespace DPL {
29 namespace DBus {
30
31 class Dispatcher
32 {
33 public:
34     virtual ~Dispatcher() =0;
35
36     /**
37      * Called on method invocation.
38      *
39      * @param connection
40      * @param sender
41      * @param objectPath
42      * @param interfaceName
43      * @param methodName
44      * @param parameters
45      * @param invocation
46      *
47      * @see GLib DBus documentation.
48      */
49     virtual void onMethodCall(GDBusConnection* connection,
50                               const gchar* sender,
51                               const gchar* objectPath,
52                               const gchar* interfaceName,
53                               const gchar* methodName,
54                               GVariant* parameters,
55                               GDBusMethodInvocation* invocation) =0;
56
57     /**
58      * Called on property get.
59      *
60      * @param connection
61      * @param sender
62      * @param objectPath
63      * @param interfaceName
64      * @param propertyName
65      * @return Porperty value.
66      *
67      * @see GLib DBus documentation.
68      */
69     virtual GVariant* onPropertyGet(GDBusConnection* connection,
70                                     const gchar* sender,
71                                     const gchar* objectPath,
72                                     const gchar* interfaceName,
73                                     const gchar* propertyName,
74                                     GError** error);
75
76     /**
77      * Called on property set.
78      *
79      * @param connection
80      * @param sender
81      * @param objectPath
82      * @param interfaceName
83      * @param propertyName
84      * @param value
85      * @return TRUE if successfully set, FALSE otherwise.
86      *
87      * @see GLib DBus documentation.
88      */
89     virtual gboolean onPropertySet(GDBusConnection* connection,
90                                    const gchar* sender,
91                                    const gchar* objectPath,
92                                    const gchar* interfaceName,
93                                    const gchar* propertyName,
94                                    GVariant* value,
95                                    GError** error);
96 };
97
98 }
99 }
100
101 #endif // DPL_DBUS_DISPATCHER_H