GFBGraphUser: GFBGraph 0.2 Reference Manual

## GFBGraphUser GFBGraphUser — GFBGraph User node |

## Stability Level

Unstable, unless otherwise indicated

## Functions

GFBGraphUser * | gfbgraph_user_new ()
GFBGraphUser * | gfbgraph_user_new_from_id ()
GFBGraphUser * | gfbgraph_user_get_me ()
void | gfbgraph_user_get_me_async ()
GFBGraphUser * | gfbgraph_user_get_me_async_finish ()
GList * | gfbgraph_user_get_albums ()
void | gfbgraph_user_get_albums_async ()
GList * | gfbgraph_user_get_albums_async_finish ()
const gchar * | gfbgraph_user_get_name ()
const gchar * | gfbgraph_user_get_email ()

## Properties

gchar * | email | Read / Write
gchar * | name | Read / Write

## Types and Values

struct | GFBGraphUser
struct | GFBGraphUserClass

## Object Hierarchy

        GObject
        ╰── GFBGraphNode
            ╰── GFBGraphUser

## Includes

    #include <gfbgraph/gfbgraph.h>

## Description

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

## Functions

### 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.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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()`.

#### Parameters

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.

#### Parameters

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` .

#### Parameters

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()`.

#### Parameters

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.

#### Parameters

user | a GFBGraphUser. |

#### Returns

a const gchar with the user full name, or `NULL`.

[transfer none]

### gfbgraph_user_get_email ()

    const gchar *
    gfbgraph_user_get_email (GFBGraphUser *user);

Get the user email. To retrieve this propertie, you need 'email' extended permission.

#### Parameters

user | a GFBGraphUser. |

#### Returns

a const gchar with the user email, or `NULL`.

[transfer none]

## Types and Values

### struct GFBGraphUser

    struct GFBGraphUser;

### struct GFBGraphUserClass

    struct GFBGraphUserClass {
            GFBGraphNodeClass parent_class;
    };

## Property Details

### The `“email”` property

      “email”                    gchar *

The email of the user if available

Owner: GFBGraphUser

Flags: Read / Write

Default value: NULL

### The `“name”` property

      “name”                     gchar *

The full name of the user

Owner: GFBGraphUser

Flags: Read / Write

Default value: ""