Branch data Line data Source code
1 : : /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
2 : : *
3 : : * Copyright 2025 GNOME Foundation, Inc.
4 : : *
5 : : * SPDX-License-Identifier: LGPL-2.1-or-later
6 : : *
7 : : * This library is free software; you can redistribute it and/or
8 : : * modify it under the terms of the GNU Lesser General Public
9 : : * License as published by the Free Software Foundation; either
10 : : * version 2.1 of the License, or (at your option) any later version.
11 : : *
12 : : * This library is distributed in the hope that it will be useful,
13 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 : : * Lesser General Public License for more details.
16 : : *
17 : : * You should have received a copy of the GNU Lesser General Public
18 : : * License along with this library; if not, write to the Free Software
19 : : * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 : : *
21 : : * Authors:
22 : : * - Philip Withnall <pwithnall@gnome.org>
23 : : */
24 : :
25 : : #pragma once
26 : :
27 : : #include <gio/gio.h>
28 : : #include <glib.h>
29 : : #include <glib-object.h>
30 : : #include <stdint.h>
31 : :
32 : : G_BEGIN_DECLS
33 : :
34 : : /**
35 : : * MctUserType:
36 : : * @MCT_USER_TYPE_UNKNOWN: Unknown user account
37 : : * @MCT_USER_TYPE_SYSTEM: System user (such as for running a daemon)
38 : : * @MCT_USER_TYPE_CHILD: Child user (i.e. a non-administrator)
39 : : * @MCT_USER_TYPE_PARENT: Parent user (i.e. an administrator)
40 : : *
41 : : * Type of a user account.
42 : : *
43 : : * Since: 0.14.0
44 : : */
45 : : typedef enum
46 : : {
47 : : MCT_USER_TYPE_UNKNOWN = 0,
48 : : MCT_USER_TYPE_SYSTEM,
49 : : MCT_USER_TYPE_CHILD,
50 : : MCT_USER_TYPE_PARENT,
51 : : } MctUserType;
52 : :
53 : : #define MCT_TYPE_USER mct_user_get_type ()
54 [ # # ][ # # : 0 : G_DECLARE_FINAL_TYPE (MctUser, mct_user, MCT, USER, GObject)
# # # # ]
55 : :
56 : : uid_t mct_user_get_uid (MctUser *self);
57 : : const char *mct_user_get_username (MctUser *self);
58 : : const char *mct_user_get_real_name (MctUser *self);
59 : : const char *mct_user_get_display_name (MctUser *self);
60 : : MctUserType mct_user_get_user_type (MctUser *self);
61 : : const char *mct_user_get_icon_path (MctUser *self);
62 : : uint64_t mct_user_get_login_time (MctUser *self);
63 : : const char *mct_user_get_locale (MctUser *self);
64 : :
65 : : gboolean mct_user_equal (MctUser *a,
66 : : MctUser *b);
67 : :
68 : : gboolean mct_user_is_in_same_family (MctUser *self,
69 : : MctUser *other);
70 : :
71 : : gboolean mct_user_is_parent_of (MctUser *self,
72 : : MctUser *other);
73 : :
74 : : G_END_DECLS
|