GFBGraphUser

## GFBGraphUser GFBGraphUser — GFBGraph User node |

## Stability Level

Unstable, unless otherwise indicated

## Synopsis

    #include <gfbgraph/gfbgraph.h>

    struct              GFBGraphUser;
    struct              GFBGraphUserClass;
    GFBGraphUser *      gfbgraph_user_new                   (void);
    GFBGraphUser *      gfbgraph_user_new_from_id           (GFBGraphAuthorizer *authorizer,
                                                             const gchar *id,
                                                             GError **error);
    GFBGraphUser *      gfbgraph_user_get_me                (GFBGraphAuthorizer *authorizer,
                                                             GError **error);
    void                gfbgraph_user_get_me_async          (GFBGraphAuthorizer *authorizer,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    GFBGraphUser *      gfbgraph_user_get_me_async_finish   (GFBGraphAuthorizer *authorizer,
                                                             GAsyncResult *result,
                                                             GError **error);
    GList *             gfbgraph_user_get_albums            (GFBGraphUser *user,
                                                             GFBGraphAuthorizer *authorizer,
                                                             GError **error);
    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);

## Object Hierarchy

      GObject
       +----GFBGraphNode
             +----GFBGraphUser

## Properties

      "name"                     gchar*                : Read / Write

## Description

GFBGraphUser represents a user in Facebook. With the "me" functions, (see `gfbgraph_user_get_me()`) you can query for the logged user node.

## Details

### struct GFBGraphUser

    struct GFBGraphUser;

### struct GFBGraphUserClass

    struct GFBGraphUserClass {
            GFBGraphNodeClass parent_class;
    };

### gfbgraph_user_new ()

    GFBGraphUser *      gfbgraph_user_new                   (void);

Creates a new GFBGraphUser.

Returns : | a new GFBGraphUser; unref with `g_object_unref()`

### gfbgraph_user_new_from_id ()

    GFBGraphUser *      gfbgraph_user_new_from_id           (GFBGraphAuthorizer *authorizer,
                                                             const gchar *id,
                                                             GError **error);

Retrieves a user from the Facebook Graph with the give ID.

`authorizer` : | a GFBGraphAuthorizer.
`id` : | a const gchar with the user ID.
`error` : | a GError or `NULL`. [allow-none]
Returns : | a new GFBGraphUser; unref with `g_object_unref()`. [transfer full]

### gfbgraph_user_get_me ()

    GFBGraphUser *      gfbgraph_user_get_me                (GFBGraphAuthorizer *authorizer,
                                                             GError **error);

Retrieve the current user logged using the https://graph.facebook.com/me Graph API function. See `gfbgraph_user_get_my_async()` for the asynchronous version of this call.

`authorizer` : | a GFBGraphAuthorizer.
`error` : | a GError or `NULL`. [allow-none]
Returns : | a GFBGraphUser with the current user information. [transfer full]

### gfbgraph_user_get_me_async ()

    void                gfbgraph_user_get_me_async          (GFBGraphAuthorizer *authorizer,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Asynchronously retrieve the current user logged. See `gfbgraph_user_get_me()` for the synchronous version of this call.

When the operation is finished, `callback` will be called. You can then call `gfbgraph_user_get_me_finish()` to get the GFBGraphUser for to the current user logged.

`authorizer` : | a GFBGraphAuthorizer.
`cancellable` : | An optional GCancellable object, or `NULL`. [allow-none]
`callback` : | A GAsyncReadyCallback to call when the request is completed. [scope async]
`user_data` : | The data to pass to `callback`. [closure]

### gfbgraph_user_get_me_async_finish ()

    GFBGraphUser *      gfbgraph_user_get_me_async_finish   (GFBGraphAuthorizer *authorizer,
                                                             GAsyncResult *result,
                                                             GError **error);

Finishes an asynchronous operation started with `gfbgraph_user_get_me_async()`.

`authorizer` : | a GFBGraphAuthorizer.
`result` : | A GAsyncResult.
`error` : | An optional GError, or `NULL`. [allow-none]
Returns : | a GFBGraphUser for to the current user logged. [transfer full]

### gfbgraph_user_get_albums ()

    GList *             gfbgraph_user_get_albums            (GFBGraphUser *user,
                                                             GFBGraphAuthorizer *authorizer,
                                                             GError **error);

Retrieve the albums nodes owned by the `user`. This functions call the function ID/albums.

`user` : | a GFBGraphUser.
`authorizer` : | a GFBGraphAuthorizer.
`error` : | An optional GError, or `NULL`. [allow-none]
Returns : | a newly-allocated GList with the albums nodes owned by the given user. [element-type GFBGraphAlbum][transfer full]

### gfbgraph_user_get_albums_async ()

    void                gfbgraph_user_get_albums_async      (GFBGraphUser *user,
                                                             GFBGraphAuthorizer *authorizer,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Asynchronously retrieve the albums nodes owned by the `user`. See `gfbgraph_user_get_albums()` for the synchronous version of this call.

When the operation is finished, `callback` will be called. You can then call `gfbgraph_user_get_albums_async_finish()` to get the GList of GFBGraphAlbum owned by the `user`.

`user` : | a GFBGraphUser.
`authorizer` : | a GFBGraphAuthorizer.
`cancellable` : | An optional GCancellable object, or `NULL`. [allow-none]
`callback` : | A GAsyncReadyCallback to call when the request is completed. [scope async]
`user_data` : | The data to pass to `callback`. [closure]

### gfbgraph_user_get_albums_async_finish ()

    GList *             gfbgraph_user_get_albums_async_finish
                                                            (GFBGraphUser *user,
                                                             GAsyncResult *result,
                                                             GError **error);

Finishes an asynchronous operation started with `gfbgraph_user_get_albums_async()`.

`user` : | a GFBGraphUser.
`result` : | A GAsyncResult.
`error` : | An optional GError, or `NULL`. [allow-none]
Returns : | a newly-allocated GList of albums owned by the `user`. [element-type GFBGraphAlbum][transfer full]

### gfbgraph_user_get_name ()

    const gchar *       gfbgraph_user_get_name              (GFBGraphUser *user);

Get the user full name.

`user` : | a GFBGraphUser.
Returns : | a const gchar with the user full name, or `NULL`. [transfer none]

## Property Details

### The `"name"` property

      "name"                     gchar*                : Read / Write

The full name of the user

Default value: ""