Commit 01644264 authored by Álvaro Peña's avatar Álvaro Peña

Added "get" funtions to properties

parent 24aee1d9
......@@ -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;
}
......@@ -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__ */
......@@ -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;
}
......@@ -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__ */
......@@ -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;
}
......@@ -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__ */
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