Move the tlm dbus interface under org.01
[platform/core/system/tlm.git] / src / common / dbus / tlm-dbus-utils.h
1 /* vi: set et sw=4 ts=4 cino=t0,(0: */
2 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 /*
4  * This file is part of tlm (Tiny Login Manager)
5  *
6  * Copyright (C) 2014 Intel Corporation.
7  *
8  * Contact: Imran Zaman <imran.zaman@intel.com>
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
23  * 02110-1301 USA
24  */
25
26 #ifndef _TLM_DBUS_UTILS_H
27 #define _TLM_DBUS_UTILS_H
28
29 #include <glib.h>
30 #include <gio/gio.h>
31
32 G_BEGIN_DECLS
33
34 typedef enum
35 {
36     TLM_DBUS_REQUEST_TYPE_LOGIN_USER,
37     TLM_DBUS_REQUEST_TYPE_LOGOUT_USER,
38     TLM_DBUS_REQUEST_TYPE_SWITCH_USER
39 } TlmDbusRequestType;
40
41 typedef struct
42 {
43     TlmDbusRequestType type;
44     GObject* dbus_adapter;
45     GDBusMethodInvocation *invocation;
46     gchar *seat_id;
47     gchar *username;
48     gchar *password;
49     GHashTable *environment;
50 } TlmDbusRequest;
51
52 TlmDbusRequest *
53 tlm_dbus_utils_create_request (
54         GObject *object,
55         GDBusMethodInvocation *invocation,
56         TlmDbusRequestType type,
57         const gchar *seat_id,
58         const gchar *username,
59         const gchar *password,
60         GVariant *environment);
61
62 void
63 tlm_dbus_utils_dispose_request (
64         TlmDbusRequest *request);
65
66 GVariant *
67 tlm_dbus_utils_hash_table_to_variant (GHashTable *dict);
68
69 GHashTable *
70 tlm_dbus_utils_hash_table_from_variant (GVariant *variant);
71
72 G_END_DECLS
73
74 #endif /* _TLM_DBUS_UTILS_H */