E_Ofono.h
Go to the documentation of this file.
1 #ifndef E_OFONO_H
2 #define E_OFONO_H
3 
4 #include <stdint.h>
5 #include <stdio.h>
6 
7 #include <Eina.h>
8 #include <Ecore.h>
9 #include <E_DBus.h>
10 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 /* Ecore Events */
22 extern int E_OFONO_EVENT_MANAGER_IN;
23 extern int E_OFONO_EVENT_MANAGER_OUT;
24 extern int E_OFONO_EVENT_ELEMENT_ADD;
25 extern int E_OFONO_EVENT_ELEMENT_DEL;
27 
29 
31 {
32  const char *path;
33  const char *interface;
35  Eina_Inlist *props;
36 
37  /* private */
38  struct
39  {
40  Eina_Inlist *properties_get;
41  Eina_Inlist *property_set;
42  Eina_Inlist *send_sms;
43  } _pending;
44  struct
45  {
46  Ecore_Idler *changed;
47  } _idler;
48  Eina_Inlist *_listeners;
50 };
51 
52 /* General Public API */
53 EAPI unsigned int e_ofono_system_init(E_DBus_Connection *edbus_conn) EINA_ARG_NONNULL(1);
54 EAPI unsigned int e_ofono_system_shutdown(void);
55 
56 /* Manager Methods */
58 EAPI Eina_Bool e_ofono_manager_modems_get(Eina_Array **array);
59 
60 /* Modem Methods */
61 EAPI Eina_Bool e_ofono_modem_powered_get(const E_Ofono_Element *element, Eina_Bool *powered) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
62 EAPI Eina_Bool e_ofono_modem_powered_set(E_Ofono_Element *element, Eina_Bool powered, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
63 EAPI Eina_Bool e_ofono_modem_name_get(const E_Ofono_Element *element, const char **name) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
64 
65 /* NetworkRegistration Methods */
66 EAPI Eina_Bool e_ofono_netreg_mode_get(const E_Ofono_Element *element, const char **mode) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
67 EAPI Eina_Bool e_ofono_netreg_status_get(const E_Ofono_Element *element, const char **status) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
68 EAPI Eina_Bool e_ofono_netreg_operator_get(const E_Ofono_Element *element, const char **op) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
69 EAPI Eina_Bool e_ofono_netreg_strength_get(const E_Ofono_Element *element, uint8_t *strength) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
70 
71 /* SMS Methods */
72 EAPI Eina_Bool e_ofono_sms_sca_get(const E_Ofono_Element *element, const char **sca) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
73 EAPI Eina_Bool e_ofono_sms_sca_set(E_Ofono_Element *element, const char *sca, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
74 EAPI Eina_Bool e_ofono_sms_send_message(E_Ofono_Element *element, const char *number, const char *message, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2, 3) EINA_WARN_UNUSED_RESULT;
75 
76 /* Low-Level API:
77  *
78  * Should just be used to work around problems until proper solution
79  * is made into e_ofono.
80  */
81 EAPI Eina_Bool e_ofono_manager_sync_elements(void);
82 
83 EAPI Eina_Bool e_ofono_elements_get_all(unsigned int *count, E_Ofono_Element ***p_elements) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
84 EAPI Eina_Bool e_ofono_elements_get_all_type(const char *type, unsigned int *count, E_Ofono_Element ***p_elements) EINA_ARG_NONNULL(1, 2, 3) EINA_WARN_UNUSED_RESULT;
85 EAPI E_Ofono_Element * e_ofono_element_get(const char *path, const char *interface) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
86 
87 EAPI void e_ofono_element_listener_add(E_Ofono_Element *element, void (*cb)(void *data, const E_Ofono_Element *element), const void *data, void (*free_data)(void *data)) EINA_ARG_NONNULL(1, 2);
88 EAPI void e_ofono_element_listener_del(E_Ofono_Element *element, void (*cb)(void *data, const E_Ofono_Element *element), const void *data) EINA_ARG_NONNULL(1, 2);
89 
90 EAPI int e_ofono_element_ref(E_Ofono_Element *element) EINA_ARG_NONNULL(1);
91 EAPI int e_ofono_element_unref(E_Ofono_Element *element) EINA_ARG_NONNULL(1);
92 
93 EAPI void e_ofono_element_print(FILE *fp, const E_Ofono_Element *element) EINA_ARG_NONNULL(1, 2);
94 
95 EAPI Eina_Bool e_ofono_element_properties_sync(E_Ofono_Element *element) EINA_ARG_NONNULL(1);
96 EAPI Eina_Bool e_ofono_element_properties_sync_full(E_Ofono_Element *element, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1);
97 
98 EAPI Eina_Bool e_ofono_element_property_set(E_Ofono_Element *element, const char *prop, int type, const void *value) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
99 EAPI Eina_Bool e_ofono_element_property_set_full(E_Ofono_Element *element, const char *prop, int type, const void *value, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
100 EAPI Eina_Bool e_ofono_element_property_dict_set_full(E_Ofono_Element *element, const char *prop, const char *key, int type, const void *value, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2, 3) EINA_WARN_UNUSED_RESULT;
101 
102 EAPI void e_ofono_element_properties_list(const E_Ofono_Element *element, Eina_Bool (*cb)(void *data, const E_Ofono_Element *element, const char *name, int type, const void *value), const void *data) EINA_ARG_NONNULL(1, 2);
103 
104 EAPI Eina_Bool e_ofono_element_property_type_get_stringshared(const E_Ofono_Element *element, const char *name, int *type) EINA_ARG_NONNULL(1, 2, 3) EINA_WARN_UNUSED_RESULT;
105 EAPI Eina_Bool e_ofono_element_property_type_get(const E_Ofono_Element *element, const char *name, int *type) EINA_ARG_NONNULL(1, 2, 3) EINA_WARN_UNUSED_RESULT;
106 EAPI Eina_Bool e_ofono_element_property_dict_get_stringshared(const E_Ofono_Element *element, const char *dict_name, const char *key_name, int *type, void *value) EINA_ARG_NONNULL(1, 2, 4) EINA_WARN_UNUSED_RESULT;
107 EAPI Eina_Bool e_ofono_element_property_get_stringshared(const E_Ofono_Element *element, const char *name, int *type, void *value) EINA_ARG_NONNULL(1, 2, 4) EINA_WARN_UNUSED_RESULT;
108 EAPI Eina_Bool e_ofono_element_property_get(const E_Ofono_Element *element, const char *name, int *type, void *value) EINA_ARG_NONNULL(1, 2, 4) EINA_WARN_UNUSED_RESULT;
109 
110 EAPI Eina_Bool e_ofono_element_is_manager(const E_Ofono_Element *element) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
111 EAPI Eina_Bool e_ofono_element_is_modem(const E_Ofono_Element *element) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
112 EAPI Eina_Bool e_ofono_element_is_netreg(const E_Ofono_Element *element) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
113 
114 #ifdef __cplusplus
115 }
116 #endif
117 
122 #endif /* E_OFONO_H */
EAPI void EAPI Eina_Bool e_ofono_element_property_type_get_stringshared(const E_Ofono_Element *element, const char *name, int *type) EINA_ARG_NONNULL(1
EAPI Eina_Bool e_ofono_element_property_type_get(const E_Ofono_Element *element, const char *name, int *type) EINA_ARG_NONNULL(1
Eina_Inlist * properties_get
Definition: E_Ofono.h:40
EAPI void EAPI void EAPI int e_ofono_element_ref(E_Ofono_Element *element) EINA_ARG_NONNULL(1)
Definition: e_ofono_element.c:1147
EAPI Eina_Bool e_ofono_element_is_manager(const E_Ofono_Element *element) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
Definition: e_ofono_element.c:2475
EAPI unsigned int e_ofono_system_shutdown(void)
Definition: e_ofono.c:311
EAPI Eina_Bool e_ofono_manager_sync_elements(void)
Definition: e_ofono.c:65
const char * path
Definition: E_Ofono.h:32
struct _E_Ofono_Element::@12 _idler
Eina_Inlist * send_sms
Definition: E_Ofono.h:42
Definition: e_dbus_private.h:18
EAPI void e_ofono_element_listener_add(E_Ofono_Element *element, void(*cb)(void *data, const E_Ofono_Element *element), const void *data, void(*free_data)(void *data)) EINA_ARG_NONNULL(1
Ecore_Idler * changed
Definition: E_Ofono.h:46
EAPI void EAPI Eina_Bool e_ofono_element_properties_sync(E_Ofono_Element *element) EINA_ARG_NONNULL(1)
Definition: e_ofono_element.c:1500
int E_OFONO_EVENT_MANAGER_IN
Definition: e_ofono.c:14
void(* E_DBus_Method_Return_Cb)(void *data, DBusMessage *msg, DBusError *error)
Definition: E_DBus.h:124
EAPI Eina_Bool e_ofono_element_property_get_stringshared(const E_Ofono_Element *element, const char *name, int *type, void *value) EINA_ARG_NONNULL(1
EAPI Eina_Bool EINA_WARN_UNUSED_RESULT
Definition: E_Ofono.h:61
EAPI void e_ofono_element_properties_list(const E_Ofono_Element *element, Eina_Bool(*cb)(void *data, const E_Ofono_Element *element, const char *name, int type, const void *value), const void *data) EINA_ARG_NONNULL(1
int E_OFONO_EVENT_ELEMENT_UPDATED
Definition: e_ofono.c:18
EAPI Eina_Bool e_ofono_sms_send_message(E_Ofono_Element *element, const char *number, const char *message, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1
Definition: E_Ofono.h:30
struct _E_Ofono_Element::@11 _pending
Eina_Inlist * _listeners
Definition: E_Ofono.h:48
#define EAPI
Definition: E_DBus.h:44
EAPI Eina_Bool e_ofono_element_property_dict_set_full(E_Ofono_Element *element, const char *prop, const char *key, int type, const void *value, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1
int E_OFONO_EVENT_MANAGER_OUT
Definition: e_ofono.c:15
Eina_Inlist * property_set
Definition: E_Ofono.h:41
EAPI Eina_Bool e_ofono_element_is_netreg(const E_Ofono_Element *element) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
Definition: e_ofono_element.c:2489
EAPI void EAPI void e_ofono_element_listener_del(E_Ofono_Element *element, void(*cb)(void *data, const E_Ofono_Element *element), const void *data) EINA_ARG_NONNULL(1
EAPI E_Ofono_Element * e_ofono_manager_get(void) EINA_WARN_UNUSED_RESULT
Definition: e_ofono_manager.c:9
EAPI unsigned int e_ofono_system_init(E_DBus_Connection *edbus_conn) EINA_ARG_NONNULL(1)
Definition: e_ofono.c:204
EAPI Eina_Bool e_ofono_element_property_set(E_Ofono_Element *element, const char *prop, int type, const void *value) EINA_ARG_NONNULL(1
const char * interface
Definition: E_Ofono.h:33
EAPI Eina_Bool e_ofono_netreg_strength_get(const E_Ofono_Element *element, uint8_t *strength) EINA_ARG_NONNULL(1
EAPI Eina_Bool e_ofono_modem_name_get(const E_Ofono_Element *element, const char **name) EINA_ARG_NONNULL(1
EAPI Eina_Bool e_ofono_netreg_status_get(const E_Ofono_Element *element, const char **status) EINA_ARG_NONNULL(1
int E_OFONO_EVENT_ELEMENT_ADD
Definition: e_ofono.c:16
EAPI Eina_Bool e_ofono_elements_get_all(unsigned int *count, E_Ofono_Element ***p_elements) EINA_ARG_NONNULL(1
EAPI Eina_Bool e_ofono_element_property_get(const E_Ofono_Element *element, const char *name, int *type, void *value) EINA_ARG_NONNULL(1
EAPI Eina_Bool e_ofono_netreg_operator_get(const E_Ofono_Element *element, const char **op) EINA_ARG_NONNULL(1
int E_OFONO_EVENT_ELEMENT_DEL
Definition: e_ofono.c:17
EAPI Eina_Bool e_ofono_netreg_mode_get(const E_Ofono_Element *element, const char **mode) EINA_ARG_NONNULL(1
Eina_Inlist * props
Definition: E_Ofono.h:35
EAPI void e_ofono_element_print(FILE *fp, const E_Ofono_Element *element) EINA_ARG_NONNULL(1
EAPI Eina_Bool e_ofono_elements_get_all_type(const char *type, unsigned int *count, E_Ofono_Element ***p_elements) EINA_ARG_NONNULL(1
EAPI Eina_Bool e_ofono_manager_modems_get(Eina_Array **array)
Definition: e_ofono_manager.c:29
EAPI Eina_Bool e_ofono_sms_sca_get(const E_Ofono_Element *element, const char **sca) EINA_ARG_NONNULL(1
EAPI Eina_Bool e_ofono_element_is_modem(const E_Ofono_Element *element) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
Definition: e_ofono_element.c:2482
EAPI E_Ofono_Element * e_ofono_element_get(const char *path, const char *interface) EINA_ARG_NONNULL(1
EAPI Eina_Bool e_ofono_element_property_dict_get_stringshared(const E_Ofono_Element *element, const char *dict_name, const char *key_name, int *type, void *value) EINA_ARG_NONNULL(1
EAPI Eina_Bool e_ofono_element_property_set_full(E_Ofono_Element *element, const char *prop, int type, const void *value, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1
EAPI Eina_Bool e_ofono_sms_sca_set(E_Ofono_Element *element, const char *sca, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1
EAPI Eina_Bool e_ofono_element_properties_sync_full(E_Ofono_Element *element, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1)
Definition: e_ofono_element.c:1477
EAPI int e_ofono_element_unref(E_Ofono_Element *element) EINA_ARG_NONNULL(1)
Definition: e_ofono_element.c:1159
EAPI Eina_Bool e_ofono_modem_powered_get(const E_Ofono_Element *element, Eina_Bool *powered) EINA_ARG_NONNULL(1
E_DBus_Signal_Handler * signal_handler
Definition: E_Ofono.h:34
EAPI Eina_Bool e_ofono_modem_powered_set(E_Ofono_Element *element, Eina_Bool powered, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
Definition: e_ofono_modem.c:36
int _references
Definition: E_Ofono.h:49
Definition: e_dbus_signal.c:19