GFBGraphNode

GFBGraphNode — GFBGraph Node object

Stability Level

Unstable, unless otherwise indicated

Functions

Properties

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

Types and Values

Object Hierarchy

    GObject
    ╰── GFBGraphNode
        ├── GFBGraphAlbum
        ├── GFBGraphPhoto
        ╰── GFBGraphUser

Includes

#include <gfbgraph/gfbgraph.h>

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

Functions

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.

Parameters

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.

Parameters

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.

Parameters

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.

Parameters

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.

Parameters

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.

Parameters

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

Parameters

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.

Parameters

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.

Types and Values

GFBGRAPH_NODE_ERROR

#define GFBGRAPH_NODE_ERROR            gfbgraph_node_error_quark ()

struct GFBGraphNode

struct GFBGraphNode;

struct GFBGraphNodeClass

struct GFBGraphNodeClass {
        GObjectClass parent_class;
};

enum GFBGraphNodeError

Members

GFBGRAPH_NODE_ERROR_NO_CONNECTIONABLE

   

GFBGRAPH_NODE_ERROR_NO_CONNECTABLE

   

Property Details

The “created-time” property

  “created-time”             gchar *

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

Owner: GFBGraphNode

Flags: Read / Write

Default value: ""


The “id” property

  “id”                       gchar *

The node ID. All nodes have one of this.

Owner: GFBGraphNode

Flags: Read / Write

Default value: ""


The “link” property

  “link”                     gchar *

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

Owner: GFBGraphNode

Flags: Read / Write

Default value: ""


The “updated-time” property

  “updated-time”             gchar *

An ISO 8601 encoded date when the node was updated.

Owner: GFBGraphNode

Flags: Read / Write

Default value: ""