Proxy
Eldbus

## Data Structures

struct | _Eldbus_Proxy_Event_Property_Changed
struct | _Eldbus_Proxy_Event_Property_Loaded
struct | _Eldbus_Proxy_Event_Property_Removed

## Typedefs

typedef struct _Eldbus_Proxy_Event_Property_Changed | Eldbus_Proxy_Event_Property_Changed
| A structure used when ELDBUS_PROXY_EVENT_PROPERTY_CHANGED event is received.
typedef struct _Eldbus_Proxy_Event_Property_Loaded | Eldbus_Proxy_Event_Property_Loaded
| A structure used when ELDBUS_PROXY_EVENT_PROPERTY_LOADED event is received.
typedef struct _Eldbus_Proxy_Event_Property_Removed | Eldbus_Proxy_Event_Property_Removed
| A structure used when ELDBUS_PROXY_EVENT_PROPERTY_REMOVED event is received.
typedef void(* | Eldbus_Proxy_Event_Cb) (void *data, Eldbus_Proxy *proxy, void *event_info)
| A callback called when an event occurs.

## Enumerations

enum | Eldbus_Proxy_Event_Type { ELDBUS_PROXY_EVENT_PROPERTY_CHANGED = 0 , ELDBUS_PROXY_EVENT_PROPERTY_REMOVED , ELDBUS_PROXY_EVENT_DEL , ELDBUS_PROXY_EVENT_PROPERTY_LOADED , ELDBUS_PROXY_EVENT_LAST }
| An enumeration containing proxy event types. More...

## Functions

Eldbus_Proxy * | eldbus_proxy_get (Eldbus_Object *obj, const char *interface)
| Get a proxy of the following interface name in a Eldbus_Object.
Eldbus_Proxy * | eldbus_proxy_ref (Eldbus_Proxy *proxy)
| Increase proxy reference.
void | eldbus_proxy_unref (Eldbus_Proxy *proxy)
| Decrease proxy reference.
Eldbus_Object * | eldbus_proxy_object_get (const Eldbus_Proxy *proxy)
| Get the Eldbus_Object associated with a proxy object.
const char * | eldbus_proxy_interface_get (const Eldbus_Proxy *proxy)
| Get the interface name associated with a proxy object.
void | eldbus_proxy_data_set (Eldbus_Proxy *proxy, const char *key, const void *data)
| Set data to an Eldbus_Proxy object.
void * | eldbus_proxy_data_get (const Eldbus_Proxy *proxy, const char *key)
| Get data of an Eldbus_Proxy object.
void * | eldbus_proxy_data_del (Eldbus_Proxy *proxy, const char *key)
| Delete data of an Eldbus_Proxy object.
void | eldbus_proxy_free_cb_add (Eldbus_Proxy *proxy, Eldbus_Free_Cb cb, const void *data)
| Add a callback function to be called when an event of the type passed occurs.
void | eldbus_proxy_free_cb_del (Eldbus_Proxy *proxy, Eldbus_Free_Cb cb, const void *data)
| Remove callback registered in eldbus_proxy_free_cb_add().
Eldbus_Message * | eldbus_proxy_method_call_new (Eldbus_Proxy *proxy, const char *member)
| Constructs a new message to invoke a method on a remote interface.
Eldbus_Pending * | eldbus_proxy_send (Eldbus_Proxy *proxy, Eldbus_Message *msg, Eldbus_Message_Cb cb, const void *cb_data, double timeout)
| Send a message.
Eldbus_Message * | eldbus_proxy_send_and_block (Eldbus_Proxy *proxy, Eldbus_Message *msg, double timeout)
| Send a message and block while waiting for the reply.
Eldbus_Pending * | eldbus_proxy_call (Eldbus_Proxy *proxy, const char *member, Eldbus_Message_Cb cb, const void *cb_data, double timeout, const char *signature,...)
| Call a method in proxy.
Eldbus_Pending * | eldbus_proxy_vcall (Eldbus_Proxy *proxy, const char *member, Eldbus_Message_Cb cb, const void *cb_data, double timeout, const char *signature, va_list ap)
| Call a method in proxy.
Eldbus_Signal_Handler * | eldbus_proxy_signal_handler_add (Eldbus_Proxy *proxy, const char *member, Eldbus_Signal_Cb cb, const void *cb_data)
| Add a signal handler.
void | eldbus_proxy_event_callback_add (Eldbus_Proxy *proxy, Eldbus_Proxy_Event_Type type, Eldbus_Proxy_Event_Cb cb, const void *cb_data)
| Add a callback function to be called when occurs a event of the type passed.
void | eldbus_proxy_event_callback_del (Eldbus_Proxy *proxy, Eldbus_Proxy_Event_Type type, Eldbus_Proxy_Event_Cb cb, const void *cb_data)
| Remove callback registered in eldbus_proxy_event_callback_add().

## Detailed Description

## Typedef Documentation

## Eldbus_Proxy_Event_Cb

typedef void(* Eldbus_Proxy_Event_Cb) (void *data, Eldbus_Proxy *proxy, void *event_info)

A callback called when an event occurs.

Parameters

  data | The data passed by the caller.
  proxy | The Eldbus_Proxy object.
  event_info | Information on the event that triggered the callback.

## Enumeration Type Documentation

## Eldbus_Proxy_Event_Type

enum Eldbus_Proxy_Event_Type

An enumeration containing proxy event types.

Enumerator
ELDBUS_PROXY_EVENT_PROPERTY_CHANGED | a property has changed
ELDBUS_PROXY_EVENT_PROPERTY_REMOVED | a property was removed
ELDBUS_PROXY_EVENT_LAST | sentinel, not a real event type

## Function Documentation

## eldbus_proxy_get()

Eldbus_Proxy * eldbus_proxy_get | ( | Eldbus_Object * | obj,
|  | const char * | interface )

Get a proxy of the following interface name in a Eldbus_Object.

Parameters

  obj | The Eldbus_Object on which to do the query.
  interface | The interface name of the proxy.

Returns
  The corresponding Eldbus_Proxy object.

References EINA_MAGIC_SET, EINA_SAFETY_ON_NULL_RETURN_VAL, eina_stringshare_add(), eina_stringshare_del(), eldbus_object_free_cb_add(), and eldbus_proxy_ref().

Referenced by efl_net_connman_access_point_new(), efl_net_connman_init(), efl_net_connman_technology_new(), and eldbus_object_get().

## eldbus_proxy_ref()

Eldbus_Proxy * eldbus_proxy_ref | ( | Eldbus_Proxy * | proxy | ) |

Increase proxy reference.

Parameters

  proxy | The Eldbus_Proxy on which to increase the refcount.

Returns
  The Eldbus_Proxy with an increased refcount.

References DBG.

Referenced by eldbus_proxy_get().

## eldbus_proxy_unref()

void eldbus_proxy_unref | ( | Eldbus_Proxy * | proxy | ) |

Decrease proxy reference.

If reference == 0 proxy will be freed and all your children.

Parameters

  proxy | The Eldbus_Proxy on which to decrease the refcount.

References DBG.

Referenced by efl_net_connman_shutdown().

## eldbus_proxy_object_get()

Eldbus_Object * eldbus_proxy_object_get | ( | const Eldbus_Proxy * | proxy | ) |

Get the Eldbus_Object associated with a proxy object.

Parameters

  proxy | The Eldbus_Proxy on which to do the query.

Returns
  The corresponding Eldbus_Object.

Referenced by efl_net_connman_shutdown().

## eldbus_proxy_interface_get()

const char * eldbus_proxy_interface_get | ( | const Eldbus_Proxy * | proxy | ) |

Get the interface name associated with a proxy object.

Parameters

  proxy | The Eldbus_Proxy on which to do the query.

Returns
  The string corresponding to the interface name.

## eldbus_proxy_data_set()

void eldbus_proxy_data_set | ( | Eldbus_Proxy * | proxy,
|  | const char * | key,
|  | const void * | data )

Set data to an Eldbus_Proxy object.

Parameters

  proxy | The Eldbus_Proxy on which to set the data.
  key | A string to which the data will be associated.
  data | The data to set to the proxy object.

References EINA_SAFETY_ON_NULL_RETURN.

## eldbus_proxy_data_get()

void * eldbus_proxy_data_get | ( | const Eldbus_Proxy * | proxy,
|  | const char * | key )

Get data of an Eldbus_Proxy object.

Parameters

  proxy | The Eldbus_Proxy on which to get the data.
  key | The string to which the data is associated.

Returns
  The data set to the proxy object associated with the provided key.

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## eldbus_proxy_data_del()

void * eldbus_proxy_data_del | ( | Eldbus_Proxy * | proxy,
|  | const char * | key )

Delete data of an Eldbus_Proxy object.

Parameters

  proxy | The Eldbus_Proxy on which to delete the data.
  key | The string to which the data is associated.

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## eldbus_proxy_free_cb_add()

void eldbus_proxy_free_cb_add | ( | Eldbus_Proxy * | proxy,
|  | Eldbus_Free_Cb | cb,
|  | const void * | data )

Add a callback function to be called when an event of the type passed occurs.

Parameters

  proxy | The Eldbus_Proxy on which to add the callback.
  cb | The callback to add.
  data | The data to pass to the callback.

References EINA_SAFETY_ON_NULL_RETURN.

Referenced by efl_net_connman_init().

## eldbus_proxy_free_cb_del()

void eldbus_proxy_free_cb_del | ( | Eldbus_Proxy * | proxy,
|  | Eldbus_Free_Cb | cb,
|  | const void * | data )

Remove callback registered in eldbus_proxy_free_cb_add().

Parameters

  proxy | The Eldbus_Proxy on which to delete the callback.
  cb | The callback to delete.
  data | The data passed to the callback.

References EINA_SAFETY_ON_NULL_RETURN.

## eldbus_proxy_method_call_new()

Eldbus_Message * eldbus_proxy_method_call_new | ( | Eldbus_Proxy * | proxy,
|  | const char * | member )

Constructs a new message to invoke a method on a remote interface.

Parameters

  proxy | The Eldbus_Proxy on which to call the method.
  member | The name of the method to invoke.

Returns
  An Eldbus_Message object.

References eldbus_message_method_call_new(), eldbus_object_bus_name_get(), and eldbus_object_path_get().

Referenced by eldbus_proxy_property_set(), eldbus_proxy_property_value_set(), and ethumb_client_ethumb_setup().

## eldbus_proxy_send()

Eldbus_Pending * eldbus_proxy_send | ( | Eldbus_Proxy * | proxy,
|  | Eldbus_Message * | msg,
|  | Eldbus_Message_Cb | cb,
|  | const void * | cb_data,
|  | double | timeout )

Send a message.

Parameters

  proxy | the msg will be send in connection that proxy belongs
  msg | message that will be send
  cb | if msg is a method call a callback should be passed
  cb_data | data passed to callback
  timeout | timeout in milliseconds, -1 to default internal value or ELDBUS_TIMEOUT_INFINITE for no timeout

Returns
  A Eldbus_Pending object on the sent message.

References EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by eldbus_proxy_property_set(), eldbus_proxy_property_value_set(), and ethumb_client_ethumb_setup().

## eldbus_proxy_send_and_block()

Eldbus_Message * eldbus_proxy_send_and_block | ( | Eldbus_Proxy * | proxy,
|  | Eldbus_Message * | msg,
|  | double | timeout )

Send a message and block while waiting for the reply.

Parameters

  proxy | the msg will be send in connection that proxy belongs
  msg | message that will be send
  timeout | timeout in milliseconds, -1 to default internal value or ELDBUS_TIMEOUT_INFINITE for no timeout

Returns
  The reply message, error message or NULL. The returned Eldbus_Message need to be unref after read.

Since
  1.13

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## eldbus_proxy_call()

Eldbus_Pending * eldbus_proxy_call | ( | Eldbus_Proxy * | proxy,
|  | const char * | member,
|  | Eldbus_Message_Cb | cb,
|  | const void * | cb_data,
|  | double | timeout,
|  | const char * | signature,
|  |  | ... )

Call a method in proxy.

Send a method call to interface that proxy belong with data.

Parameters

  proxy |
  member | method name
  cb | if msg is a method call a callback should be passed to be execute when response arrive
  cb_data | data passed to callback
  timeout | timeout in milliseconds, -1 to default internal value or ELDBUS_TIMEOUT_INFINITE for no timeout
  signature | of data that will be send
  ... | data value

Returns
  A Eldbus_Pending object on the sent message.

Note
  This function only support basic type to complex types use eldbus_message_iter_* functions.

References EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by eldbus_hello(), eldbus_name_owner_get(), eldbus_name_owner_has(), eldbus_name_release(), eldbus_name_request(), eldbus_name_start(), eldbus_names_activatable_list(), eldbus_names_list(), eldbus_proxy_property_get(), eldbus_proxy_property_get_all(), ethumb_client_generate_cancel(), and ethumb_client_generate_cancel_all().

## eldbus_proxy_vcall()

Eldbus_Pending * eldbus_proxy_vcall | ( | Eldbus_Proxy * | proxy,
|  | const char * | member,
|  | Eldbus_Message_Cb | cb,
|  | const void * | cb_data,
|  | double | timeout,
|  | const char * | signature,
|  | va_list | ap )

Call a method in proxy.

Send a method call to interface that proxy belong with data.

Parameters

  proxy |
  member | method name
  cb | callback that will be called when response arrive.
  cb_data | data passed to callback
  timeout | timeout in milliseconds, -1 to default internal value or ELDBUS_TIMEOUT_INFINITE for no timeout
  signature | of data that will be send
  ap | va_list of data value

Returns
  A Eldbus_Pending object on the sent message.

Note
  This function only support basic type to complex types use eldbus_message_iter_* functions.

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## eldbus_proxy_signal_handler_add()

Eldbus_Signal_Handler * eldbus_proxy_signal_handler_add | ( | Eldbus_Proxy * | proxy,
|  | const char * | member,
|  | Eldbus_Signal_Cb | cb,
|  | const void * | cb_data )

Add a signal handler.

Parameters

  proxy | interface where the signal is emitted
  member | name of the signal
  cb | callback that will be called when this signal is received
  cb_data | data that will be passed to callback

Returns
  A listener to the desired signal.

References DBG, eina_list_append(), EINA_SAFETY_ON_NULL_RETURN_VAL, eldbus_object_bus_name_get(), eldbus_object_path_get(), and eldbus_signal_handler_free_cb_add().

Referenced by eldbus_proxy_properties_changed_callback_add().

## eldbus_proxy_event_callback_add()

void eldbus_proxy_event_callback_add | ( | Eldbus_Proxy * | proxy,
|  | Eldbus_Proxy_Event_Type | type,
|  | Eldbus_Proxy_Event_Cb | cb,
|  | const void * | cb_data )

Add a callback function to be called when occurs a event of the type passed.

Parameters

  proxy | The Eldbus_Proxy object.
  type | The type of the event to register an callback on.
  cb | The callback function to register.
  cb_data | The data to pass to the callback.

References eina_hash_string_superfast_new(), eina_inlist_append(), EINA_INLIST_GET, EINA_SAFETY_ON_NULL_RETURN, EINA_SAFETY_ON_TRUE_RETURN, ELDBUS_PROXY_EVENT_LAST, ELDBUS_PROXY_EVENT_PROPERTY_CHANGED, ELDBUS_PROXY_EVENT_PROPERTY_REMOVED, and eldbus_proxy_properties_changed_callback_add().

Referenced by eldbus_proxy_properties_monitor().

## eldbus_proxy_event_callback_del()

void eldbus_proxy_event_callback_del | ( | Eldbus_Proxy * | proxy,
|  | Eldbus_Proxy_Event_Type | type,
|  | Eldbus_Proxy_Event_Cb | cb,
|  | const void * | cb_data )

Remove callback registered in eldbus_proxy_event_callback_add().

Parameters

  proxy | The Eldbus_Proxy object.
  type | The type of the event the callback was registered on.
  cb | The callback function to delete.
  cb_data | The data passed to the callback.

References eina_hash_free(), EINA_INLIST_FOREACH, eina_list_append(), EINA_SAFETY_ON_NULL_RETURN, EINA_SAFETY_ON_TRUE_RETURN, EINA_TRUE, ELDBUS_PROXY_EVENT_LAST, ELDBUS_PROXY_EVENT_PROPERTY_CHANGED, ELDBUS_PROXY_EVENT_PROPERTY_REMOVED, and eldbus_signal_handler_unref().