GFBGraphNode

## GFBGraphNode GFBGraphNode — GFBGraph Node object |

## Stability Level

Unstable, unless otherwise indicated

## Synopsis

    #include <gfbgraph/gfbgraph.h>

    #define             GFBGRAPH_NODE_ERROR
    struct              GFBGraphNode;
    struct              GFBGraphNodeClass;
    enum                GFBGraphNodeError;
    GQuark              gfbgraph_node_error_quark           (void);
    GFBGraphNode *      gfbgraph_node_new                   (void);
    GFBGraphNode *      gfbgraph_node_new_from_id           (GFBGraphAuthorizer *authorizer,
                                                             const gchar *id,
                                                             GType node_type,
                                                             GError **error);
    const gchar *       gfbgraph_node_get_id                (GFBGraphNode *node);
    const gchar *       gfbgraph_node_get_link              (GFBGraphNode *node);
    const gchar *       gfbgraph_node_get_created_time      (GFBGraphNode *node);
    const gchar *       gfbgraph_node_get_updated_time      (GFBGraphNode *node);
    GList *             gfbgraph_node_get_connection_nodes  (GFBGraphNode *node,
                                                             GType node_type,
                                                             GFBGraphAuthorizer *authorizer,
                                                             GError **error);
    void                gfbgraph_node_get_connection_nodes_async
                                                            (GFBGraphNode *node,
                                                             GType node_type,
                                                             GFBGraphAuthorizer *authorizer,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    GList *             gfbgraph_node_get_connection_nodes_async_finish
                                                            (GFBGraphNode *node,
                                                             GAsyncResult *result,
                                                             GError **error);
    gboolean            gfbgraph_node_append_connection     (GFBGraphNode *node,
                                                             GFBGraphNode *connect_node,
                                                             GFBGraphAuthorizer *authorizer,
                                                             GError **error);

## Object Hierarchy

      GObject
       +----GFBGraphNode
             +----GFBGraphAlbum
             +----GFBGraphPhoto
             +----GFBGraphUser

## Properties

      "created-time"             gchar*                : Read / Write
      "id"                       gchar*                : Read / Write
      "link"                     gchar*                : Read / Write
      "updated-time"             gchar*                : Read / Write

## Description

GFBGraphNode is the base class for the nodes in the Facebook Graph API, such a Album, a Photo or a User. Only usefull to expand the current library functionality creating new nodes based on it.

This object provide the common functions to manage the relations between nodes trough the GFBGraphConnectable interface. See gfbgraph_node_get_connection_nodes and gfbgraph_node_append_node

## Details

### GFBGRAPH_NODE_ERROR

    #define GFBGRAPH_NODE_ERROR            gfbgraph_node_error_quark ()

### struct GFBGraphNode

    struct GFBGraphNode;

### struct GFBGraphNodeClass

    struct GFBGraphNodeClass {
            GObjectClass parent_class;
    };

### enum GFBGraphNodeError

    typedef enum {
            GFBGRAPH_NODE_ERROR_NO_CONNECTIONABLE = 1,
            GFBGRAPH_NODE_ERROR_NO_CONNECTABLE
    } GFBGraphNodeError;

`GFBGRAPH_NODE_ERROR_NO_CONNECTIONABLE` |
`GFBGRAPH_NODE_ERROR_NO_CONNECTABLE` |

### gfbgraph_node_error_quark ()

    GQuark              gfbgraph_node_error_quark           (void);

### gfbgraph_node_new ()

    GFBGraphNode *      gfbgraph_node_new                   (void);

Creates a new GFBGraphNode.

Returns : | a new GFBGraphNode; unref with `g_object_unref()`. [transfer full]

### gfbgraph_node_new_from_id ()

    GFBGraphNode *      gfbgraph_node_new_from_id           (GFBGraphAuthorizer *authorizer,
                                                             const gchar *id,
                                                             GType node_type,
                                                             GError **error);

Retrieve a node object as a GFBgraphNode of node_type type, with the given `id` from the Facebook Graph.

`id` : | a const gchar with the node ID.
`node_type` : | a GFBGraphNode type GType.
`authorizer` : | a GFBGraphAuthorizer.
`error` : | a GError or `NULL`. [allow-none]
Returns : | a GFBGraphNode or `NULL`. [transfer full]

### gfbgraph_node_get_id ()

    const gchar *       gfbgraph_node_get_id                (GFBGraphNode *node);

Gets the Facebook Graph unique node ID.

`node` : | a GFBGraphNode.
Returns : | the node ID. [transfer none]

### gfbgraph_node_get_link ()

    const gchar *       gfbgraph_node_get_link              (GFBGraphNode *node);

### gfbgraph_node_get_created_time ()

    const gchar *       gfbgraph_node_get_created_time      (GFBGraphNode *node);

Gets a node created time.

`node` : | a GFBGraphNode.
Returns : | an ISO 8601 encoded date when the node was initially published. [transfer none]

### gfbgraph_node_get_updated_time ()

    const gchar *       gfbgraph_node_get_updated_time      (GFBGraphNode *node);

Gets a node updated time.

`node` : | a GFBGraphNode.
Returns : | an ISO 8601 encoded date when the node was updated. [transfer none]

### gfbgraph_node_get_connection_nodes ()

    GList *             gfbgraph_node_get_connection_nodes  (GFBGraphNode *node,
                                                             GType node_type,
                                                             GFBGraphAuthorizer *authorizer,
                                                             GError **error);

Retrieve the nodes of type `node_type` connected to the `node` object. The `node_type` object must implement the GFBGraphConnectionable interface and be connectable to `node` type object. See `gfbgraph_node_get_connection_nodes_async()` for the asynchronous version of this call.

`node` : | a GFBGraphNode object which retrieve the connected nodes.
`node_type` : | a GFBGraphNode type GType that determines the kind of nodes to retrieve.
`authorizer` : | a GFBGraphAuthorizer.
`error` : | a GError or `NULL`. [allow-none]
Returns : | a newly-allocated GList of type `node_type` objects with the found nodes. [element-type GFBGraphNode][transfer full]

### gfbgraph_node_get_connection_nodes_async ()

    void                gfbgraph_node_get_connection_nodes_async
                                                            (GFBGraphNode *node,
                                                             GType node_type,
                                                             GFBGraphAuthorizer *authorizer,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Asynchronously retrieve the list of nodes of type `node_type` connected to the `node` object. See `gfbgraph_node_get_connection_nodes()` for the synchronous version of this call.

When the operation is finished, `callback` will be called. You can then call `gfbgraph_node_get_connection_nodes_finish()` to get the list of connected nodes.

`node` : | A GFBGraphNode object which retrieve the connected nodes.
`node_type` : | a GFBGraphNode type GType that must implement the GFBGraphConnectionable interface.
`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_node_get_connection_nodes_async_finish ()

    GList *             gfbgraph_node_get_connection_nodes_async_finish
                                                            (GFBGraphNode *node,
                                                             GAsyncResult *result,
                                                             GError **error);

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

`node` : | A GFBGraphNode.
`result` : | A GAsyncResult.
`error` : | An optional GError, or `NULL`. [allow-none]
Returns : | a newly-allocated GList of type node_type objects with the found nodes. [element-type GFBGraphNode][transfer full]

### gfbgraph_node_append_connection ()

    gboolean            gfbgraph_node_append_connection     (GFBGraphNode *node,
                                                             GFBGraphNode *connect_node,
                                                             GFBGraphAuthorizer *authorizer,
                                                             GError **error);

Appends `connect_node` to `node`. `connect_node` must implement the GFBGraphConnectable interface and be connectable to `node` GType.

`node` : | A GFBGraphNode.
`connect_node` : | A GFBGraphNode.
`authorizer` : | A GFBGraphAuthorizer.
`error` : | An optional GError, or `NULL`. [allow-none]
Returns : | TRUE on sucess, FALSE if an error ocurred.

## Property Details

### The `"created-time"` property

      "created-time"             gchar*                : Read / Write

An ISO 8601 encoded date when the node was initially published.

Default value: ""

### The `"id"` property

      "id"                       gchar*                : Read / Write

The node ID. All nodes have one of this.

Default value: ""

### The `"link"` property

      "link"                     gchar*                : Read / Write

The node link. An URL to the node on Facebook.

Default value: ""

### The `"updated-time"` property

      "updated-time"             gchar*                : Read / Write

An ISO 8601 encoded date when the node was updated.

Default value: ""