summaryrefslogtreecommitdiff
path: root/src/accounts.h
blob: e6bf4e472e7a6c0129c09855c56f1c62383925cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* -*- Mode: C; indent-tabs-mode: nil; tab-width: 4 -*-
 *
 * Copyright (C) 2010-2011 Robert Ancell.
 * Author: Robert Ancell <robert.ancell@canonical.com>
 *
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version. See http://www.gnu.org/copyleft/gpl.html the full text of the
 * license.
 */

#ifndef USER_H_
#define USER_H_

#include <glib-object.h>
#include <gio/gio.h>

G_BEGIN_DECLS

#define USER_TYPE (user_get_type())
#define USER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), USER_TYPE, User));

typedef struct UserPrivate UserPrivate;

typedef struct
{
    GObject      parent_instance;
    UserPrivate *priv;
} User;

typedef struct
{
    GObjectClass parent_class;
} UserClass;

G_DEFINE_AUTOPTR_CLEANUP_FUNC (User, g_object_unref)

User *accounts_get_user_by_name (const gchar *username);

User *accounts_get_current_user (void);

GType user_get_type (void);

const gchar *user_get_name (User *user);

uid_t user_get_uid (User *user);

gid_t user_get_gid (User *user);

const gchar *user_get_home_directory (User *user);

const gchar *user_get_shell (User *user);

const gchar *user_get_xsession (User *user);

void user_set_xsession (User *user, const gchar *session);

const gchar *user_get_language (User *user);

void user_set_language (User *user, const gchar *language);

G_END_DECLS

#endif /* USER_H_ */