Debian Codegraph @

src/goaidentity/goaidentity.c

raw symbols SCIP
1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 /*
3 * Copyright © 2012 – 2017 Red Hat, Inc.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General
16 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #include "config.h"
20
21 #include <glib-object.h>
22 #include <glib/gi18n.h>
23
24 #include "goaidentity.h"
25
26 G_DEFINE_INTERFACE (GoaIdentity, goa_identity, G_TYPE_OBJECT);
27
28 static void
29 goa_identity_default_init (GoaIdentityInterface *interface)
30 {
31 g_object_interface_install_property (interface,
32 g_param_spec_string ("identifier",
33 "identifier",
34 "identifier",
35 NULL, G_PARAM_READABLE));
36 g_object_interface_install_property (interface,
37 g_param_spec_boolean ("is-signed-in",
38 "Is signed in",
39 "Whether or not identity is currently signed in",
40 FALSE,
41 G_PARAM_READABLE));
42 g_object_interface_install_property (interface,
43 g_param_spec_int64 ("start-timestamp",
44 "Start Timestamp",
45 "A timestamp of when the identities credentials first became valid",
46 -1,
47 G_MAXINT64,
48 -1, G_PARAM_READABLE));
49 g_object_interface_install_property (interface,
50 g_param_spec_int64 ("renewal-timestamp",
51 "Renewal Timestamp",
52 "A timestamp of when the identities credentials can no longer be renewed",
53 -1,
54 G_MAXINT64,
55 -1, G_PARAM_READABLE));
56 g_object_interface_install_property (interface,
57 g_param_spec_int64 ("expiration-timestamp",
58 "Expiration Timestamp",
59 "A timestamp of when the identities credentials expire",
60 -1,
61 G_MAXINT64,
62 -1, G_PARAM_READABLE));
63 }
64
65 const char *
66 goa_identity_get_identifier (GoaIdentity *self)
67 {
68 return GOA_IDENTITY_GET_IFACE (self)->get_identifier (self);
69 }
70
71 gboolean
72 goa_identity_is_signed_in (GoaIdentity *self)
73 {
74 return GOA_IDENTITY_GET_IFACE (self)->is_signed_in (self);
75 }