1 /* vi:set et ai sw=2 sts=2 ts=2: */
3 * Copyright (c) 2012 GENIVI.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
14 #include <glib/gi18n.h>
15 #include <glib-object.h>
17 #include <common/nsm-enum-types.h>
22 nsm_shutdown_type_get_type (void)
24 GType type = G_TYPE_INVALID;
26 if (G_UNLIKELY (type == G_TYPE_INVALID))
28 static const GFlagsValue values[] =
30 { NSM_SHUTDOWN_TYPE_NOT, "NSM_SHUTDOWN_TYPE_NOT", N_ ("No shutdown"), },
31 { NSM_SHUTDOWN_TYPE_NORMAL, "NSM_SHUTDOWN_TYPE_NORMAL", N_ ("Normal shutdown"), },
32 { NSM_SHUTDOWN_TYPE_FAST, "NSM_SHUTDOWN_TYPE_FAST", N_ ("Fast shutdown"), },
33 { NSM_SHUTDOWN_TYPE_RUNUP, "NSM_SHUTDOWN_TYPE_RUNUP", N_ ("Shutdown cancelled"), },
37 type = g_flags_register_static ("NSMShutdownType", values);
45 nsm_error_status_get_type (void)
47 GType type = G_TYPE_INVALID;
49 if (G_UNLIKELY (type == G_TYPE_INVALID))
51 static const GEnumValue values[] =
53 { NSM_ERROR_STATUS_NOT_SET, "NSM_ERROR_STATUS_NOT_SET", N_ ("Error not set"), },
54 { NSM_ERROR_STATUS_OK, "NSM_ERROR_STATUS_OK", N_ ("No error"), },
55 { NSM_ERROR_STATUS_ERROR, "NSM_ERROR_STATUS_ERROR", N_ ("Non-specific error"), },
56 { NSM_ERROR_STATUS_DBUS, "NSM_ERROR_STATUS_DBUS", N_ ("Dbus comunication error"), },
57 { NSM_ERROR_STATUS_INTERNAL, "NSM_ERROR_STATUS_INTERNAL", N_ ("Internal error"), },
58 { NSM_ERROR_STATUS_PARAMETER, "NSM_ERROR_STATUS_PARAMETER", N_ ("Parameter wrong"), },
59 { NSM_ERROR_STATUS_WRONG_SESSION, "NSM_ERROR_STATUS_WRONG_SESSION", N_ ("Unknown session"), },
60 { NSM_ERROR_STATUS_RESPONSE_PENDING, "NSM_ERROR_STATUS_RESPONSE_PENDING", N_ ("Reponse pending"), },
61 { NSM_ERROR_STATUS_LAST, "NSM_ERROR_STATUS_LAST", N_ ("Last error"), },
65 type = g_enum_register_static ("NSMErrorStatus", values);
73 nsm_node_state_get_type (void)
75 GType type = G_TYPE_INVALID;
77 if (G_UNLIKELY (type == G_TYPE_INVALID))
79 static const GEnumValue values[] =
81 { NSM_NODE_STATE_NOT_SET, "NSM_NODE_STATE_NOT_SET", N_ ("Node sate not set"), },
82 { NSM_NODE_STATE_START_UP, "NSM_NODE_STATE_START_UP", N_ ("Start basic system"), },
83 { NSM_NODE_STATE_BASE_RUNNING, "NSM_NODE_STATE_BASE_RUNNING", N_ ("Basic components started"), },
84 { NSM_NODE_STATE_LUC_RUNNING, "NSM_NODE_STATE_LUC_RUNNING", N_ ("LUC components started"), },
85 { NSM_NODE_STATE_FULLY_RUNNING, "NSM_NODE_STATE_FULLY_RUNNING", N_ ("Foreground components started"), },
86 { NSM_NODE_STATE_FULLY_OPERATIONAL, "NSM_NODE_STATE_FULLY_OPERATIONAL", N_ ("All components started"), },
87 { NSM_NODE_STATE_SHUTTING_DOWN, "NSM_NODE_STATE_SHUTTING_DOWN", N_ ("Shutdown the system"), },
88 { NSM_NODE_STATE_FAST_SHUTDOWN, "NSM_NODE_STATE_FAST_SHUTDOWN", N_ ("Fast shutdown active"), },
89 { NSM_NODE_STATE_DEGRADED_POWER, "NSM_NODE_STATE_DEGRADED_POWER", N_ ("Power state node degraded"), },
90 { NSM_NODE_STATE_SHUTDOWN, "NSM_NODE_STATE_SHUTDOWN", N_ ("Node shut down"), },
91 { NSM_NODE_STATE_LAST, "NSM_NODE_STATE_LAST", N_ ("Last node state"), },
95 type = g_enum_register_static ("NSMNodeState", values);