AXParameter
ax_parameter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2013 Axis Communications AB
3  */
4 
5 #ifndef _AXPARAMETER_H
6 #define _AXPARAMETER_H
7 
8 #include <glib.h>
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
94 typedef struct _AXParameter AXParameter;
95 
104 typedef void (AXParameterCallback)(const gchar *name, const gchar *value, gpointer data);
105 
106 
118 AXParameter* ax_parameter_new(const gchar *app_name, GError **error);
119 
120 
126 void ax_parameter_free(AXParameter *parameter);
127 
146 gboolean ax_parameter_add(AXParameter *parameter, const gchar *name,
147  const gchar *initial_value, const gchar *type,
148  GError **error);
149 
161 gboolean ax_parameter_remove(AXParameter *parameter, const gchar *name,
162  GError **error);
163 
186 gboolean ax_parameter_set(AXParameter *parameter, const gchar *name,
187  const gchar *value, gboolean do_sync, GError **error);
188 
208 gboolean ax_parameter_get(AXParameter *parameter, const gchar *name,
209  gchar **value, GError **error);
210 
222 GList* ax_parameter_list(AXParameter *parameter, GError **error);
223 
224 
241 gboolean ax_parameter_register_callback(AXParameter *parameter, const gchar *name,
242  AXParameterCallback *callback,
243  gpointer userdata, GError **error);
244 
253 void ax_parameter_unregister_callback(AXParameter *parameter, const gchar *name);
254 
255 
256 #ifdef __cplusplus
257 }
258 #endif
259 
260 #endif
gboolean ax_parameter_get(AXParameter *parameter, const gchar *name, gchar **value, GError **error)
Retrieves the value of a parameter.
void ax_parameter_unregister_callback(AXParameter *parameter, const gchar *name)
Unregisters the parameter callback function.
struct _AXParameter AXParameter
Opaque structure for the AXParameter.
Definition: ax_parameter.h:94
gboolean ax_parameter_add(AXParameter *parameter, const gchar *name, const gchar *initial_value, const gchar *type, GError **error)
Adds a new parameter. Returns failure if the parameter already exists.
gboolean ax_parameter_set(AXParameter *parameter, const gchar *name, const gchar *value, gboolean do_sync, GError **error)
Sets the value of a parameter.
gboolean ax_parameter_register_callback(AXParameter *parameter, const gchar *name, AXParameterCallback *callback, gpointer userdata, GError **error)
Registers a callback function to be run whenever a parameter value is updated.
gboolean ax_parameter_remove(AXParameter *parameter, const gchar *name, GError **error)
Removes a parameter. Returns FALSE if the parameter doesn&#39;t exist.
void() AXParameterCallback(const gchar *name, const gchar *value, gpointer data)
The typedef for a callback function registered by ax_parameter_register_callback() ...
Definition: ax_parameter.h:104
void ax_parameter_free(AXParameter *parameter)
Frees an AXParameter.
GList * ax_parameter_list(AXParameter *parameter, GError **error)
Lists all parameters for the application. The returned list and its members must be freed by the call...
AXParameter * ax_parameter_new(const gchar *app_name, GError **error)
Creates a new AXParameter.