diff options
Diffstat (limited to 'widgets/misc/e-attachment.c')
-rw-r--r-- | widgets/misc/e-attachment.c | 92 |
1 files changed, 90 insertions, 2 deletions
diff --git a/widgets/misc/e-attachment.c b/widgets/misc/e-attachment.c index a97ea1e70f..92ebd36be4 100644 --- a/widgets/misc/e-attachment.c +++ b/widgets/misc/e-attachment.c @@ -66,8 +66,10 @@ struct _EAttachmentPrivate { gchar *disposition; gint percent; - guint loading : 1; - guint saving : 1; + guint can_show : 1; + guint loading : 1; + guint saving : 1; + guint shown : 1; camel_cipher_validity_encrypt_t encrypted; camel_cipher_validity_sign_t signed_; @@ -81,6 +83,7 @@ struct _EAttachmentPrivate { enum { PROP_0, + PROP_CAN_SHOW, PROP_DISPOSITION, PROP_ENCRYPTED, PROP_FILE, @@ -90,6 +93,7 @@ enum { PROP_PERCENT, PROP_REFERENCE, PROP_SAVING, + PROP_SHOWN, PROP_SIGNED }; @@ -445,6 +449,12 @@ attachment_set_property (GObject *object, GParamSpec *pspec) { switch (property_id) { + case PROP_CAN_SHOW: + e_attachment_set_can_show ( + E_ATTACHMENT (object), + g_value_get_boolean (value)); + return; + case PROP_DISPOSITION: e_attachment_set_disposition ( E_ATTACHMENT (object), @@ -463,6 +473,12 @@ attachment_set_property (GObject *object, g_value_get_object (value)); return; + case PROP_SHOWN: + e_attachment_set_shown ( + E_ATTACHMENT (object), + g_value_get_boolean (value)); + return; + case PROP_MIME_PART: e_attachment_set_mime_part ( E_ATTACHMENT (object), @@ -492,6 +508,12 @@ attachment_get_property (GObject *object, GParamSpec *pspec) { switch (property_id) { + case PROP_CAN_SHOW: + g_value_set_boolean ( + value, e_attachment_get_can_show ( + E_ATTACHMENT (object))); + return; + case PROP_DISPOSITION: g_value_set_string ( value, e_attachment_get_disposition ( @@ -516,6 +538,12 @@ attachment_get_property (GObject *object, E_ATTACHMENT (object))); return; + case PROP_SHOWN: + g_value_set_boolean ( + value, e_attachment_get_shown ( + E_ATTACHMENT (object))); + return; + case PROP_LOADING: g_value_set_boolean ( value, e_attachment_get_loading ( @@ -625,6 +653,17 @@ attachment_class_init (EAttachmentClass *class) g_object_class_install_property ( object_class, + PROP_CAN_SHOW, + g_param_spec_boolean ( + "can-show", + "Can Show", + NULL, + FALSE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT)); + + g_object_class_install_property ( + object_class, PROP_DISPOSITION, g_param_spec_string ( "disposition", @@ -721,6 +760,17 @@ attachment_class_init (EAttachmentClass *class) FALSE, G_PARAM_READABLE)); + g_object_class_install_property ( + object_class, + PROP_SHOWN, + g_param_spec_boolean ( + "shown", + "Shown", + NULL, + FALSE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT)); + /* FIXME Define a GEnumClass for this. */ g_object_class_install_property ( object_class, @@ -985,6 +1035,25 @@ e_attachment_cancel (EAttachment *attachment) g_cancellable_cancel (attachment->priv->cancellable); } +gboolean +e_attachment_get_can_show (EAttachment *attachment) +{ + g_return_val_if_fail (E_IS_ATTACHMENT (attachment), FALSE); + + return attachment->priv->can_show; +} + +void +e_attachment_set_can_show (EAttachment *attachment, + gboolean can_show) +{ + g_return_if_fail (E_IS_ATTACHMENT (attachment)); + + attachment->priv->can_show = can_show; + + g_object_notify (G_OBJECT (attachment), "can-show"); +} + const gchar * e_attachment_get_disposition (EAttachment *attachment) { @@ -1114,6 +1183,25 @@ e_attachment_get_saving (EAttachment *attachment) return attachment->priv->saving; } +gboolean +e_attachment_get_shown (EAttachment *attachment) +{ + g_return_val_if_fail (E_IS_ATTACHMENT (attachment), FALSE); + + return attachment->priv->shown; +} + +void +e_attachment_set_shown (EAttachment *attachment, + gboolean shown) +{ + g_return_if_fail (E_IS_ATTACHMENT (attachment)); + + attachment->priv->shown = shown; + + g_object_notify (G_OBJECT (attachment), "shown"); +} + camel_cipher_validity_encrypt_t e_attachment_get_encrypted (EAttachment *attachment) { |