tizen: release 0.0.4
[platform/core/system/tlm.git] / src / sessiond / tlm-auth-session.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) 2013-2014 Intel Corporation.
7  *
8  * Contact: Amarnath Valluri <amarnath.valluri@linux.intel.com>
9  *          Jussi Laako <jussi.laako@linux.intel.com>
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with this library; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
24  * 02110-1301 USA
25  */
26
27 #ifndef _TLM_AUTH_SESSION_H
28 #define _TLM_AUTH_SESSION_H
29
30 #include <glib-object.h>
31
32 G_BEGIN_DECLS
33
34 #define TLM_TYPE_AUTH_SESSION       (tlm_auth_session_get_type())
35 #define TLM_AUTH_SESSION(obj)       (G_TYPE_CHECK_INSTANCE_CAST((obj), \
36                               TLM_TYPE_AUTH_SESSION, TlmAuthSession))
37 #define TLM_IS_AUTH_SESSION(obj)    (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
38                              TLM_TYPE_AUTH_SESSION))
39 #define TLM_AUTH_SESSION_CLASS(kls) (G_TYPE_CHECK_CLASS_CAST((kls), \
40                              TLM_TYPE_AUTH_SESSION))
41 #define TLM_AUTH_SESSION_IS_CLASS(kls)  (G_TYPE_CHECK_CLASS_TYPE((kls), \
42                                  TLM_TYPE_AUTH_SESSION))
43
44 typedef struct _TlmAuthSession TlmAuthSession;
45 typedef struct _TlmAuthSessionClass TlmAuthSessionClass;
46 typedef struct _TlmAuthSessionPrivate TlmAuthSessionPrivate;
47
48 struct _TlmAuthSession
49 {
50     GObject parent;
51     /* Private */
52     TlmAuthSessionPrivate *priv;
53 };
54
55 struct _TlmAuthSessionClass
56 {
57     GObjectClass parent_class;
58 };
59
60 GType tlm_auth_session_get_type(void);
61
62 TlmAuthSession *
63 tlm_auth_session_new (const gchar *service,
64                       const gchar *username,
65                       const gchar *password);
66
67 gboolean
68 tlm_auth_session_putenv (TlmAuthSession *auth_session,
69                          const gchar *var,
70                          const gchar *value);
71
72 gboolean
73 tlm_auth_session_authenticate (TlmAuthSession *auth_session, GError **error);
74
75 gboolean
76 tlm_auth_session_open (TlmAuthSession *auth_session, GError **error);
77
78 const gchar *
79 tlm_auth_session_get_username (TlmAuthSession *auth_session);
80
81 const gchar *
82 tlm_auth_session_get_sessionid (TlmAuthSession *auth_session);
83
84 gchar **
85 tlm_auth_session_get_envlist (TlmAuthSession *auth_session);
86
87 void
88 tlm_auth_session_set_env (TlmAuthSession *auth_session, const gchar *key,
89                           const gchar *value);
90
91 G_END_DECLS
92
93 #endif /* _TLM_AUTH_SESSION_H */