dbus: replace old dbus api with GVariant support api
[platform/core/system/libsvi.git] / src / dbus.h
1 /*
2  * feedback
3  *
4  * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the License);
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19
20 #ifndef __DBUS_H__
21 #define __DBUS_H__
22
23 #include <gio/gio.h>
24 #include <glib.h>
25
26 /*
27  * Device daemon
28  */
29 #define DEVICED_BUS_NAME                    "org.tizen.system.deviced"
30 #define DEVICED_OBJECT_PATH                 "/Org/Tizen/System/DeviceD"
31 #define DEVICED_INTERFACE_NAME              DEVICED_BUS_NAME
32 /* Led service: play/stop led operations about led */
33 #define DEVICED_PATH_LED                    DEVICED_OBJECT_PATH"/Led"
34 #define DEVICED_INTERFACE_LED               DEVICED_INTERFACE_NAME".Led"
35 /* Haptic service: operatioins about haptic */
36 #define VIBRATOR_BUS_NAME                    "org.tizen.system.vibrator"
37 #define VIBRATOR_OBJECT_PATH                 "/Org/Tizen/System/Vibrator"
38 #define VIBRATOR_INTERFACE_NAME              VIBRATOR_BUS_NAME
39 #define VIBRATOR_PATH_HAPTIC                 VIBRATOR_OBJECT_PATH"/Haptic"
40 #define VIBRATOR_INTERFACE_HAPTIC            VIBRATOR_INTERFACE_NAME".haptic"
41
42 struct dbus_byte {
43         const unsigned char *data;
44         int size;
45 };
46
47 int dbus_method_sync_var(const char *dest, const char *path,
48                 const char *interface, const char *method, GVariant *param);
49 int dbus_method_sync(const char *dest, const char *path,
50                 const char *interface, const char *method,
51                 const char *sig, const char *param[]);
52
53 /**
54  * If result is NULL, err is set.
55  * Do not invoke g_variant_unref() with result.
56  */
57 typedef void (*dbus_pending_cb)(void *data, GVariant *result, GError *err);
58
59 typedef int (*feedback_restart_cb)();
60 int register_signal_handler(feedback_restart_cb func);
61 int unregister_signal_handler(feedback_restart_cb func);
62 #endif