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 
239 typedef struct _AXParameter AXParameter;
240 
249 typedef void (AXParameterCallback)(const gchar *name, const gchar *value, gpointer data);
250 
251 
263 AXParameter* ax_parameter_new(const gchar *app_name, GError **error);
264 
265 
272 
293 gboolean ax_parameter_add(AXParameter *parameter, const gchar *name,
294  const gchar *initial_value, const gchar *type,
295  GError **error);
296 
308 gboolean ax_parameter_remove(AXParameter *parameter, const gchar *name,
309  GError **error);
310 
333 gboolean ax_parameter_set(AXParameter *parameter, const gchar *name,
334  const gchar *value, gboolean do_sync, GError **error);
335 
355 gboolean ax_parameter_get(AXParameter *parameter, const gchar *name,
356  gchar **value, GError **error);
357 
369 GList* ax_parameter_list(AXParameter *parameter, GError **error);
370 
371 
388 gboolean ax_parameter_register_callback(AXParameter *parameter, const gchar *name,
389  AXParameterCallback *callback,
390  gpointer userdata, GError **error);
391 
400 void ax_parameter_unregister_callback(AXParameter *parameter, const gchar *name);
401 
402 
403 #ifdef __cplusplus
404 }
405 #endif
406 
407 #endif
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.
struct _AXParameter AXParameter
Opaque structure for the AXParameter.
Definition: ax_parameter.h:239
void ax_parameter_unregister_callback(AXParameter *parameter, const gchar *name)
Unregisters the parameter callback function.
void ax_parameter_free(AXParameter *parameter)
Frees an AXParameter.
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:249
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_remove(AXParameter *parameter, const gchar *name, GError **error)
Removes a parameter. Returns FALSE if the parameter doesn't exist.
gboolean ax_parameter_get(AXParameter *parameter, const gchar *name, gchar **value, GError **error)
Retrieves the value of a parameter.
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.