Commit 79ac2c43 authored by Álvaro Peña's avatar Álvaro Peña

Added usefull functions for retrieve album and photo nodes

parent e83aff51
......@@ -241,3 +241,19 @@ gfbgraph_album_new (void)
{
return GFBGRAPH_ALBUM (g_object_new(GFBGRAPH_TYPE_ALBUM, NULL));
}
/**
* gfbgraph_album_new_from_id:
* @authorizer: a #GFBGraphAuthorizer.
* @id: a const #gchar with the album ID.
* @error: (allow-none): a #GError or %NULL.
*
* Retrieves an album node from the Facebook Graph with the give ID.
*
* Returns: a new #GFBGraphAlbum; unref with g_object_unref()
**/
GFBGraphAlbum*
gfbgraph_album_new_from_id (GFBGraphAuthorizer *authorizer, const gchar *id, GError **error)
{
return GFBGRAPH_ALBUM (gfbgraph_node_new_from_id (authorizer, id, GFBGRAPH_TYPE_ALBUM, error));
}
......@@ -21,6 +21,7 @@
#define __GFBGRAPH_ALBUM_H__
#include <gfbgraph/gfbgraph-node.h>
#include <gfbgraph/gfbgraph-authorizer.h>
G_BEGIN_DECLS
......@@ -47,6 +48,7 @@ struct _GFBGraphAlbumClass {
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);
G_END_DECLS
......
......@@ -237,6 +237,23 @@ gfbgraph_photo_new (void)
return GFBGRAPH_PHOTO(g_object_new(GFBGRAPH_TYPE_PHOTO, NULL));
}
/**
* gfbgraph_photo_new_from_id:
* @authorizer: a #GFBGraphAuthorizer.
* @id: a const #gchar with the photo ID.
* @error: (allow-none): a #GError or %NULL.
*
* Retrieves an photo node from the Facebook Graph with the give ID.
*
* Returns: a new #GFBGraphPhoto; unref with g_object_unref()
**/
GFBGraphPhoto*
gfbgraph_photo_new_from_id (GFBGraphAuthorizer *authorizer, const gchar *id, GError **error)
{
return GFBGRAPH_PHOTO (gfbgraph_node_new_from_id (authorizer, id, GFBGRAPH_TYPE_PHOTO, error));
}
/**
* gfbgraph_photo_download_default_size:
* @photo: a #GFBGraphPhoto.
......
......@@ -48,7 +48,7 @@ struct _GFBGraphPhotoClass {
GType gfbgraph_photo_get_type (void) G_GNUC_CONST;
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);
G_END_DECLS
......
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