diff options
author | Álvaro Peña <alvaropg@gmail.com> | 2013-06-04 13:26:24 +0200 |
---|---|---|
committer | Álvaro Peña <alvaropg@gmail.com> | 2013-06-04 13:26:24 +0200 |
commit | 24aee1d99159f26bac6ac754d9b1dc6c00c7d05d (patch) | |
tree | f186a7adf2ac352d66e29bdf0de370161b1e5e14 | |
parent | 588c225ef782dc22c42c0ff507ac4b8e7c4352a4 (diff) | |
download | libgfbgraph-24aee1d99159f26bac6ac754d9b1dc6c00c7d05d.tar.gz |
Created getters for node properties
-rw-r--r-- | gfbgraph/gfbgraph-node.c | 50 | ||||
-rw-r--r-- | gfbgraph/gfbgraph-node.h | 5 |
2 files changed, 55 insertions, 0 deletions
diff --git a/gfbgraph/gfbgraph-node.c b/gfbgraph/gfbgraph-node.c index bdf71cd..df4e48e 100644 --- a/gfbgraph/gfbgraph-node.c +++ b/gfbgraph/gfbgraph-node.c @@ -288,6 +288,54 @@ gfbgraph_node_new_from_id (GFBGraphAuthorizer *authorizer, const gchar *id, GTyp } /** + * gfbgraph_node_get_id: + * @node: a #GFBGraphNode. + * + * Gets the Facebook Graph unique node ID. + * + * Returns: (transfer none): the node ID. + **/ +const gchar* +gfbgraph_node_get_id (GFBGraphNode *node) +{ + g_return_val_if_fail (GFBGRAPH_IS_NODE (node), NULL); + + return g_strdup (node->priv->id); +} + +/** + * gfbgraph_node_get_url: + * @node: a #GFBGraphNode. + * + * Gets the node link to the Facebook web page. + * + * Returns: (transfer none): the URL. + **/ +const gchar* +gfbgraph_node_get_link (GFBGraphNode *node) +{ + g_return_val_if_fail (GFBGRAPH_IS_NODE (node), NULL); + + return g_strdup (node->priv->link); +} + +/** + * gfbgraph_node_get_created_time: + * @node: a #GFBGraphNode. + * + * Gets a node created time. + * + * Returns: (transfer none): an ISO 8601 encoded date when the node was initially published. + **/ +const gchar* +gfbgraph_node_get_created_time (GFBGraphNode *node) +{ + g_return_val_if_fail (GFBGRAPH_IS_NODE (node), NULL); + + return g_strdup (node->priv->created_time); +} + +/** * gfbgraph_node_get_connection_nodes: * @node: a #GFBGraphNode object which retrieve the connected nodes. * @node_type: a #GFBGraphNode type #GType that determines the kind of nodes to retrieve. @@ -434,6 +482,8 @@ gfbgraph_node_get_connection_nodes_async_finish (GFBGraphNode *node, GAsyncResul * * Appends @connect_node to @node. @connect_node must implement the #GFBGraphConnectable interface * and be connectable to @node GType. + * + * Returns: TRUE on sucess, FALSE if an error ocurred. **/ gboolean gfbgraph_node_append_connection (GFBGraphNode *node, GFBGraphNode *connect_node, GFBGraphAuthorizer *authorizer, GError **error) diff --git a/gfbgraph/gfbgraph-node.h b/gfbgraph/gfbgraph-node.h index 247e97e..36618d4 100644 --- a/gfbgraph/gfbgraph-node.h +++ b/gfbgraph/gfbgraph-node.h @@ -60,6 +60,11 @@ 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); + +GList* gfbgraph_node_get_connection_nodes (GFBGraphNode *node, GType node_type, GFBGraphAuthorizer *authorizer, GError **error); |