95290740b6625598f38158e50782e9a51f8ff13a
[platform/core/system/tlm.git] / src / daemon / tlm-dbus-observer.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 (Tizen 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_OBSERVER_H
27 #define _TLM_DBUS_OBSERVER_H
28
29 #include <glib-object.h>
30
31 #include "tlm-types.h"
32
33 G_BEGIN_DECLS
34
35 #define TLM_TYPE_DBUS_OBSERVER       (tlm_dbus_observer_get_type())
36 #define TLM_DBUS_OBSERVER(obj)       (G_TYPE_CHECK_INSTANCE_CAST((obj), \
37             TLM_TYPE_DBUS_OBSERVER, TlmDbusObserver))
38 #define TLM_IS_DBUS_OBSERVER(obj)    (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
39             TLM_TYPE_DBUS_OBSERVER))
40 #define TLM_DBUS_OBSERVER_CLASS(kls) (G_TYPE_CHECK_CLASS_CAST((kls), \
41             TLM_TYPE_DBUS_OBSERVER))
42 #define TLM_DBUS_OBSERVER_IS_CLASS(kls)  (G_TYPE_CHECK_CLASS_TYPE((kls), \
43             TLM_TYPE_DBUS_OBSERVER))
44
45 typedef struct _TlmDbusObserver TlmDbusObserver;
46 typedef struct _TlmDbusObserverClass TlmDbusObserverClass;
47 typedef struct _TlmDbusObserverPrivate TlmDbusObserverPrivate;
48
49 struct _TlmDbusObserver
50 {
51     GObject parent;
52     /* Private */
53     TlmDbusObserverPrivate *priv;
54 };
55
56 struct _TlmDbusObserverClass
57 {
58     GObjectClass parent_class;
59 };
60
61 typedef enum {
62     DBUS_OBSERVER_ENABLE_LOGIN_USER = 0x01,
63     DBUS_OBSERVER_ENABLE_LOGOUT_USER = 0x02,
64     DBUS_OBSERVER_ENABLE_SWITCH_USER = 0x04,
65     DBUS_OBSERVER_ENABLE_ALL = 0x0F,
66 } DbusObserverEnableFlags;
67
68 GType tlm_dbus_observer_get_type(void);
69
70 TlmDbusObserver *
71 tlm_dbus_observer_new (
72         TlmManager *manager,
73         TlmSeat *seat,
74         const gchar *address,
75         uid_t uid,
76         DbusObserverEnableFlags enable_flags);
77
78 G_END_DECLS
79
80 #endif /* _TLM_DBUS_OBSERVER_H */