Commit e5b0c460 authored by Christian Kellner's avatar Christian Kellner
Browse files

device: new store, policy, key enum properties

parent 66f116d5
......@@ -53,6 +53,11 @@ struct _BoltDevice
/* when device is attached */
char *syspath;
BoltSecurity security;
/* when device is stored */
BoltPolicy policy;
guint store; /* currently: 0,no / 1,yes */
guint key; /* currently 0,no / 1,yes */
};
......@@ -63,9 +68,14 @@ enum {
PROP_NAME,
PROP_VENDOR,
PROP_STATUS,
PROP_SYSFS,
PROP_SECURITY,
PROP_STORED,
PROP_POLICY,
PROP_HAVE_KEY,
PROP_LAST
};
......@@ -130,6 +140,18 @@ bolt_device_get_property (GObject *object,
g_value_set_uint (value, dev->security);
break;
case PROP_STORED:
g_value_set_uint (value, dev->store);
break;
case PROP_POLICY:
g_value_set_uint (value, dev->policy);
break;
case PROP_HAVE_KEY:
g_value_set_uint (value, dev->key);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
......@@ -165,6 +187,18 @@ bolt_device_set_property (GObject *object,
dev->syspath = g_value_dup_string (value);
break;
case PROP_STORED:
dev->store = g_value_get_uint (value);
break;
case PROP_POLICY:
dev->policy = g_value_get_uint (value);
break;
case PROP_HAVE_KEY:
dev->key = g_value_get_uint (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
......@@ -205,6 +239,18 @@ bolt_device_class_init (BoltDeviceClass *klass)
PROP_SECURITY,
"security");
g_object_class_override_property (gobject_class,
PROP_STORED,
"store");
g_object_class_override_property (gobject_class,
PROP_POLICY,
"policy");
g_object_class_override_property (gobject_class,
PROP_HAVE_KEY,
"key");
}
/* internal methods */
......@@ -591,6 +637,12 @@ bolt_device_unexport (BoltDevice *device)
g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON (device));
}
guint
bolt_device_get_key (BoltDevice *dev)
{
return dev->key;
}
const char *
bolt_device_get_name (BoltDevice *dev)
{
......@@ -615,6 +667,12 @@ bolt_device_get_object_path (BoltDevice *device)
return device->dbus_path;
}
BoltPolicy
bolt_device_get_policy (BoltDevice *dev)
{
return dev->policy;
}
const char *
bolt_device_get_uid (BoltDevice *dev)
{
......@@ -627,6 +685,12 @@ bolt_device_get_security (BoltDevice *dev)
return dev->security;
}
guint
bolt_device_get_store (BoltDevice *dev)
{
return dev->store;
}
const char *
bolt_device_get_syspath (BoltDevice *dev)
{
......
......@@ -43,14 +43,20 @@ const char * bolt_device_export (BoltDevice *device,
void bolt_device_unexport (BoltDevice *device);
guint bolt_device_get_key (BoltDevice *dev);
const char * bolt_device_get_name (BoltDevice *dev);
const char * bolt_device_get_object_path (BoltDevice *device);
BoltPolicy bolt_device_get_policy (BoltDevice *dev);
const char * bolt_device_get_uid (BoltDevice *dev);
BoltSecurity bolt_device_get_security (BoltDevice *dev);
guint bolt_device_get_store (BoltDevice *dev);
const char * bolt_device_get_syspath (BoltDevice *dev);
const char * bolt_device_get_vendor (BoltDevice *dev);
......
......@@ -107,6 +107,24 @@
</doc:para></doc:description></doc:doc>
</property>
<property name="Store" type="u" access="read">
<doc:doc><doc:description><doc:para>
Indication if the device is stored.
</doc:para></doc:description></doc:doc>
</property>
<property name="Policy" type="u" access="read">
<doc:doc><doc:description><doc:para>
The authorization policy of the device.
</doc:para></doc:description></doc:doc>
</property>
<property name="Key" type="u" access="read">
<doc:doc><doc:description><doc:para>
If a key is associated with the device.
</doc:para></doc:description></doc:doc>
</property>
<!-- methods -->
<method name="Authorize">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment