Initialize Tizen 2.3
[framework/web/wrt-commons.git] / modules_mobile / 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 class Dispatcher
31 {
32   public:
33     virtual ~Dispatcher() = 0;
34
35     /**
36      * Called on method invocation.
37      *
38      * @param connection
39      * @param sender
40      * @param objectPath
41      * @param interfaceName
42      * @param methodName
43      * @param parameters
44      * @param invocation
45      *
46      * @see GLib DBus documentation.
47      */
48     virtual void onMethodCall(GDBusConnection* connection,
49                               const gchar* sender,
50                               const gchar* objectPath,
51                               const gchar* interfaceName,
52                               const gchar* methodName,
53                               GVariant* parameters,
54                               GDBusMethodInvocation* invocation) = 0;
55
56     /**
57      * Called on property get.
58      *
59      * @param connection
60      * @param sender
61      * @param objectPath
62      * @param interfaceName
63      * @param propertyName
64      * @return Porperty value.
65      *
66      * @see GLib DBus documentation.
67      */
68     virtual GVariant* onPropertyGet(GDBusConnection* connection,
69                                     const gchar* sender,
70                                     const gchar* objectPath,
71                                     const gchar* interfaceName,
72                                     const gchar* propertyName,
73                                     GError** error);
74
75     /**
76      * Called on property set.
77      *
78      * @param connection
79      * @param sender
80      * @param objectPath
81      * @param interfaceName
82      * @param propertyName
83      * @param value
84      * @return TRUE if successfully set, FALSE otherwise.
85      *
86      * @see GLib DBus documentation.
87      */
88     virtual gboolean onPropertySet(GDBusConnection* connection,
89                                    const gchar* sender,
90                                    const gchar* objectPath,
91                                    const gchar* interfaceName,
92                                    const gchar* propertyName,
93                                    GVariant* value,
94                                    GError** error);
95 };
96 }
97 }
98
99 #endif // DPL_DBUS_DISPATCHER_H