aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimo.cecchi@collabora.co.uk>2009-05-23 22:32:42 +0800
committerCosimo Cecchi <cosimoc@gnome.org>2009-06-01 23:53:23 +0800
commitda1129424fd0d5a2809e0a9f077100cbc10fb046 (patch)
treefafa233e2b077fddbcb9fed12bf32aeac2ba72ff
parent55a8adfe1d7856c5736cefc860e050223795a48d (diff)
downloadgsoc2013-empathy-da1129424fd0d5a2809e0a9f077100cbc10fb046.tar
gsoc2013-empathy-da1129424fd0d5a2809e0a9f077100cbc10fb046.tar.gz
gsoc2013-empathy-da1129424fd0d5a2809e0a9f077100cbc10fb046.tar.bz2
gsoc2013-empathy-da1129424fd0d5a2809e0a9f077100cbc10fb046.tar.lz
gsoc2013-empathy-da1129424fd0d5a2809e0a9f077100cbc10fb046.tar.xz
gsoc2013-empathy-da1129424fd0d5a2809e0a9f077100cbc10fb046.tar.zst
gsoc2013-empathy-da1129424fd0d5a2809e0a9f077100cbc10fb046.zip
Add GObject propreties for EmpathyFTHandler
-rw-r--r--libempathy/empathy-ft-handler.c110
1 files changed, 109 insertions, 1 deletions
diff --git a/libempathy/empathy-ft-handler.c b/libempathy/empathy-ft-handler.c
index b6d192d8a..9315e6538 100644
--- a/libempathy/empathy-ft-handler.c
+++ b/libempathy/empathy-ft-handler.c
@@ -78,6 +78,12 @@ enum {
PROP_TP_FILE = 1,
PROP_G_FILE,
PROP_CONTACT,
+ PROP_CONTENT_TYPE,
+ PROP_DESCRIPTION,
+ PROP_FILENAME,
+ PROP_MODIFICATION_TIME,
+ PROP_TOTAL_BYTES,
+ PROP_TRANSFERRED_BYTES,
PROP_USE_HASH
};
@@ -154,12 +160,30 @@ do_get_property (GObject *object,
GParamSpec *pspec)
{
EmpathyFTHandlerPriv *priv = GET_PRIV (object);
-
+
switch (property_id)
{
case PROP_CONTACT:
g_value_set_object (value, priv->contact);
break;
+ case PROP_CONTENT_TYPE:
+ g_value_set_string (value, priv->content_type);
+ break;
+ case PROP_DESCRIPTION:
+ g_value_set_string (value, priv->description);
+ break;
+ case PROP_FILENAME:
+ g_value_set_string (value, priv->filename);
+ break;
+ case PROP_MODIFICATION_TIME:
+ g_value_set_uint64 (value, priv->mtime);
+ break;
+ case PROP_TOTAL_BYTES:
+ g_value_set_uint64 (value, priv->total_bytes);
+ break;
+ case PROP_TRANSFERRED_BYTES:
+ g_value_set_uint64 (value, priv->transferred_bytes);
+ break;
case PROP_G_FILE:
g_value_set_object (value, priv->gfile);
break;
@@ -187,6 +211,24 @@ do_set_property (GObject *object,
case PROP_CONTACT:
priv->contact = g_value_dup_object (value);
break;
+ case PROP_CONTENT_TYPE:
+ priv->content_type = g_value_dup_string (value);
+ break;
+ case PROP_DESCRIPTION:
+ priv->description = g_value_dup_string (value);
+ break;
+ case PROP_FILENAME:
+ priv->filename = g_value_dup_string (value);
+ break;
+ case PROP_MODIFICATION_TIME:
+ priv->mtime = g_value_get_uint64 (value);
+ break;
+ case PROP_TOTAL_BYTES:
+ priv->total_bytes = g_value_get_uint64 (value);
+ break;
+ case PROP_TRANSFERRED_BYTES:
+ priv->transferred_bytes = g_value_get_uint64 (value);
+ break;
case PROP_G_FILE:
priv->gfile = g_value_dup_object (value);
break;
@@ -296,6 +338,72 @@ empathy_ft_handler_class_init (EmpathyFTHandlerClass *klass)
g_object_class_install_property (object_class, PROP_CONTACT, param_spec);
/**
+ * EmpathyFTHandler:content-type:
+ *
+ * The content type of the file being transferred
+ */
+ param_spec = g_param_spec_string ("content-type",
+ "content-type", "The content type of the file", NULL,
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+ g_object_class_install_property (object_class,
+ PROP_CONTENT_TYPE, param_spec);
+
+ /**
+ * EmpathyFTHandler:description:
+ *
+ * The description of the file being transferred
+ */
+ param_spec = g_param_spec_string ("description",
+ "description", "The description of the file", NULL,
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+ g_object_class_install_property (object_class,
+ PROP_DESCRIPTION, param_spec);
+
+ /**
+ * EmpathyFTHandler:filename:
+ *
+ * The name of the file being transferred
+ */
+ param_spec = g_param_spec_string ("filename",
+ "filename", "The name of the file", NULL,
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+ g_object_class_install_property (object_class,
+ PROP_FILENAME, param_spec);
+
+ /**
+ * EmpathyFTHandler:modification-time:
+ *
+ * The modification time of the file being transferred
+ */
+ param_spec = g_param_spec_uint64 ("modification-time",
+ "modification-time", "The mtime of the file", 0,
+ G_MAXUINT64, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+ g_object_class_install_property (object_class,
+ PROP_MODIFICATION_TIME, param_spec);
+
+ /**
+ * EmpathyFTHandler:total-bytes:
+ *
+ * The size (in bytes) of the file being transferred
+ */
+ param_spec = g_param_spec_uint64 ("total-bytes",
+ "total-bytes", "The size of the file", 0,
+ G_MAXUINT64, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+ g_object_class_install_property (object_class,
+ PROP_TOTAL_BYTES, param_spec);
+
+ /**
+ * EmpathyFTHandler:transferred-bytes:
+ *
+ * The number of the bytes already transferred
+ */
+ param_spec = g_param_spec_uint64 ("transferred-bytes",
+ "transferred-bytes", "The number of bytes already transferred", 0,
+ G_MAXUINT64, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+ g_object_class_install_property (object_class,
+ PROP_TRANSFERRED_BYTES, param_spec);
+
+ /**
* EmpathyFTHandler:gfile:
*
* The #GFile object where the transfer actually happens