[libgfbgraph] Added "get" funtions to properties



commit 016442649718f7935b3f861b2178de9fdeb12a83
Author: Álvaro Peña <alvaropg gmail com>
Date:   Tue Jun 11 12:14:21 2013 +0200

    Added "get" funtions to properties

 gfbgraph/gfbgraph-album.c |   56 +++++++++++++++++++++++++++++++++++++++++++++
 gfbgraph/gfbgraph-album.h |    5 ++++
 gfbgraph/gfbgraph-photo.c |   56 +++++++++++++++++++++++++++++++++++++++++++++
 gfbgraph/gfbgraph-photo.h |    5 ++++
 gfbgraph/gfbgraph-user.c  |   16 +++++++++++++
 gfbgraph/gfbgraph-user.h  |    2 +
 6 files changed, 140 insertions(+), 0 deletions(-)
---
diff --git a/gfbgraph/gfbgraph-album.c b/gfbgraph/gfbgraph-album.c
index b3b5d8c..28e4489 100644
--- a/gfbgraph/gfbgraph-album.c
+++ b/gfbgraph/gfbgraph-album.c
@@ -257,3 +257,59 @@ gfbgraph_album_new_from_id (GFBGraphAuthorizer *authorizer, const gchar *id, GEr
 {
         return GFBGRAPH_ALBUM (gfbgraph_node_new_from_id (authorizer, id, GFBGRAPH_TYPE_ALBUM, error));
 }
+
+/**
+ * gfbgraph_album_get_name:
+ * @album: a #GFBGraphAlbum.
+ *
+ * Returns: (transfer none): the @album name, or %NULL.
+ **/
+const gchar*
+gfbgraph_album_get_name (GFBGraphAlbum *album)
+{
+        g_return_val_if_fail (GFBGRAPH_IS_ALBUM (album), NULL);
+
+        return album->priv->name;
+}
+
+/**
+ * gfbgraph_album_get_description:
+ * @album: a #GFBGraphAlbum.
+ *
+ * Returns: (transfer none): the @album description, or %NULL.
+ **/
+const gchar*
+gfbgraph_album_get_description (GFBGraphAlbum *album)
+{
+        g_return_val_if_fail (GFBGRAPH_IS_ALBUM (album), NULL);
+
+        return album->priv->description;
+}
+
+/**
+ * gfbgraph_album_get_cover_photo:
+ * @album: a #GFBGraphAlbum.
+ *
+ * Returns: (transfer none): the cover photo node ID or %NULL.
+ **/
+const gchar*
+gfbgraph_album_get_cover_photo_id (GFBGraphAlbum *album)
+{
+        g_return_val_if_fail (GFBGRAPH_IS_ALBUM (album), NULL);
+
+        return album->priv->cover_photo;
+}
+
+/**
+ * gfbgraph_album_get_count:
+ * @album: a #GFBGraphAlbum.
+ *
+ * Returns: (transfer none): the number of photos into the @album or -1 in case of error.
+ **/
+guint
+gfbgraph_album_get_count (GFBGraphAlbum *album)
+{
+        g_return_val_if_fail (GFBGRAPH_IS_ALBUM (album), -1);
+
+        return album->priv->count;
+}
diff --git a/gfbgraph/gfbgraph-album.h b/gfbgraph/gfbgraph-album.h
index c78202a..cb4f442 100644
--- a/gfbgraph/gfbgraph-album.h
+++ b/gfbgraph/gfbgraph-album.h
@@ -51,6 +51,11 @@ GType          gfbgraph_album_get_type    (void) G_GNUC_CONST;
 GFBGraphAlbum* gfbgraph_album_new         (void);
 GFBGraphAlbum* gfbgraph_album_new_from_id (GFBGraphAuthorizer *authorizer, const gchar *id, GError **error);
 
+const gchar*   gfbgraph_album_get_name           (GFBGraphAlbum *album);
+const gchar*   gfbgraph_album_get_description    (GFBGraphAlbum *album);
+const gchar*   gfbgraph_album_get_cover_photo_id (GFBGraphAlbum *album);
+guint          gfbgraph_album_get_count          (GFBGraphAlbum *album);
+
 G_END_DECLS
 
 #endif /* __GFBGRAPH_ALBUM_H__ */
diff --git a/gfbgraph/gfbgraph-photo.c b/gfbgraph/gfbgraph-photo.c
index 12b091a..5001251 100644
--- a/gfbgraph/gfbgraph-photo.c
+++ b/gfbgraph/gfbgraph-photo.c
@@ -302,3 +302,59 @@ gfbgraph_photo_download_default_size (GFBGraphPhoto *photo, GFBGraphAuthorizer *
 
         return stream;
 }
+
+/**
+ * gfbgraph_photo_get_name:
+ * @photo: a #GFBGraphPhoto.
+ *
+ * Returns: (transfer none): the @photo name, which is the comment given by the user so it would by larger, 
or %NULL.
+ **/
+const gchar*
+gfbgraph_photo_get_name (GFBGraphPhoto *photo)
+{
+        g_return_val_if_fail (GFBGRAPH_IS_PHOTO (photo), NULL);
+
+        return photo->priv->name;
+}
+
+/**
+ * gfbgraph_photo_get_source_uri:
+ * @photo: a #GFBGraphPhoto.
+ *
+ * Returns: (transfer none): the image link with a maximun widht or height of 720px
+ **/
+const gchar*
+gfbgraph_photo_get_default_source_uri (GFBGraphPhoto *photo)
+{
+        g_return_val_if_fail (GFBGRAPH_IS_PHOTO (photo), NULL);
+
+        return photo->priv->source;
+}
+
+/**
+ * gfbgraph_pohto_get_default_width:
+ * @photo: a #GFBGraphPhoto.
+ *
+ * Returns: (transfer none): the default photo width, up to 720px.
+ **/
+guint
+gfbgraph_photo_get_default_width (GFBGraphPhoto *photo)
+{
+        g_return_val_if_fail (GFBGRAPH_IS_PHOTO (photo), -1);
+
+        return photo->priv->width;
+}
+
+/**
+ * gfbgraph_pohto_get_default_height:
+ * @photo: a #GFBGraphPhoto.
+ *
+ * Returns: (transfer none): the default photo height, up to 720px.
+ **/
+guint
+gfbgraph_photo_get_default_height (GFBGraphPhoto *photo)
+{
+        g_return_val_if_fail (GFBGRAPH_IS_PHOTO (photo), -1);
+
+        return photo->priv->height;
+}
diff --git a/gfbgraph/gfbgraph-photo.h b/gfbgraph/gfbgraph-photo.h
index 55ff3d9..1d13173 100644
--- a/gfbgraph/gfbgraph-photo.h
+++ b/gfbgraph/gfbgraph-photo.h
@@ -52,6 +52,11 @@ GFBGraphPhoto* gfbgraph_photo_new      (void);
 GFBGraphPhoto* gfbgraph_photo_new_from_id (GFBGraphAuthorizer *authorizer, const gchar *id, GError **error);
 GInputStream*  gfbgraph_photo_download_default_size (GFBGraphPhoto *photo, GFBGraphAuthorizer *authorizer, 
GError **error);
 
+const gchar*   gfbgraph_photo_get_name               (GFBGraphPhoto *photo);
+const gchar*   gfbgraph_photo_get_default_source_uri (GFBGraphPhoto *photo);
+guint          gfbgraph_photo_get_default_width      (GFBGraphPhoto *photo);
+guint          gfbgraph_photo_get_default_height     (GFBGraphPhoto *photo);
+
 G_END_DECLS
 
 #endif /* __GFBGRAPH_PHOTO_H__ */
diff --git a/gfbgraph/gfbgraph-user.c b/gfbgraph/gfbgraph-user.c
index af21b7f..5679a90 100644
--- a/gfbgraph/gfbgraph-user.c
+++ b/gfbgraph/gfbgraph-user.c
@@ -413,3 +413,19 @@ gfbgraph_user_get_albums_async_finish (GFBGraphUser *user, GAsyncResult *result,
         data = (GFBGraphUserConnectionAsyncData *) g_simple_async_result_get_op_res_gpointer (simple_async);
         return data->nodes;
 }
+
+/**
+ * gfbgraph_user_get_name:
+ * @user: a #GFBGraphUser.
+ *
+ * Get the user full name.
+ *
+ * Returns: (transfer none): a const #gchar with the user full name, or %NULL.
+ **/
+const gchar*
+gfbgraph_user_get_name (GFBGraphUser *user)
+{
+        g_return_val_if_fail (GFBGRAPH_IS_USER (user), NULL);
+
+        return user->priv->name;
+}
diff --git a/gfbgraph/gfbgraph-user.h b/gfbgraph/gfbgraph-user.h
index f17a4dd..505a262 100644
--- a/gfbgraph/gfbgraph-user.h
+++ b/gfbgraph/gfbgraph-user.h
@@ -61,6 +61,8 @@ GList*        gfbgraph_user_get_albums              (GFBGraphUser *user, GFBGrap
 void          gfbgraph_user_get_albums_async        (GFBGraphUser *user, GFBGraphAuthorizer *authorizer, 
GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
 GList*        gfbgraph_user_get_albums_async_finish (GFBGraphUser *user, GAsyncResult *result, GError 
**error);
 
+const gchar*  gfbgraph_user_get_name (GFBGraphUser *user);
+
 G_END_DECLS
 
 #endif /* __GFBGRAPH_USER_H__ */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]