~ubuntu-branches/debian/sid/hal/sid

« back to all changes in this revision

Viewing changes to libhal/libhal.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2007-10-23 12:33:58 UTC
  • Revision ID: james.westby@ubuntu.com-20071023123358-xaf8mjc5n84d5gtz
Tags: upstream-0.5.10
ImportĀ upstreamĀ versionĀ 0.5.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 * libhal.h : HAL daemon C convenience library headers
5
5
 *
6
6
 * Copyright (C) 2003 David Zeuthen, <david@fubar.dk>
 
7
 * Copyright (C) 2007 Codethink Ltd. Author Rob Taylor <rob.taylor@codethink.co.uk>
7
8
 *
8
9
 * Licensed under the Academic Free License version 2.1
9
10
 *
26
27
#ifndef LIBHAL_H
27
28
#define LIBHAL_H
28
29
 
 
30
#ifndef DBUS_API_SUBJECT_TO_CHANGE
 
31
#define DBUS_API_SUBJECT_TO_CHANGE 
 
32
#endif
 
33
 
29
34
#include <dbus/dbus.h>
30
35
 
31
36
#if defined(__cplusplus)
103
108
 
104
109
 
105
110
typedef struct LibHalContext_s LibHalContext;
 
111
typedef struct LibHalProperty_s LibHalProperty;
 
112
typedef struct LibHalPropertySet_s LibHalPropertySet;
 
113
 
106
114
 
107
115
/** 
108
116
 * LibHalIntegrateDBusIntoMainLoop:
251
259
                                             const char *lock_owner,
252
260
                                             int         num_locks);
253
261
 
 
262
/**
 
263
 * LibHalSingletonDeviceAdded:
 
264
 * @ctx: context for connection to hald
 
265
 * @udi: the Unique Device Id
 
266
 * @properties: the device's properties
 
267
 *
 
268
 * Type for callback for addon singletons when a device is added
 
269
 */
 
270
typedef void (*LibHalSingletonDeviceAdded) (LibHalContext *ctx,
 
271
                                            const char *udi,
 
272
                                            const LibHalPropertySet *properties);
 
273
 
 
274
/**
 
275
 * LibHalSingletonDeviceRemoved:
 
276
 * @ctx: context for connection to hald
 
277
 * @udi: the Unique Device Id
 
278
 * @properties: the device's properties
 
279
 *
 
280
 * Type for callback for addon singletons when a device is added
 
281
 */
 
282
typedef void (*LibHalSingletonDeviceRemoved) (LibHalContext *ctx,
 
283
                                            const char *udi,
 
284
                                            const LibHalPropertySet *properties);
 
285
 
254
286
 
255
287
 
256
288
/* Create a new context for a connection with hald */
301
333
/* Set the callback for when an interface lock is released  */
302
334
dbus_bool_t    libhal_ctx_set_interface_lock_released (LibHalContext *ctx, LibHalInterfaceLockReleased callback);
303
335
 
 
336
/* Set the callback for addon singleton device added */
 
337
dbus_bool_t    libhal_ctx_set_singleton_device_added (LibHalContext *ctx, LibHalSingletonDeviceAdded callback);
 
338
 
 
339
/* Set the callback for addon singleton device removed*/
 
340
dbus_bool_t    libhal_ctx_set_singleton_device_removed (LibHalContext *ctx, LibHalSingletonDeviceRemoved callback);
 
341
 
304
342
/* Initialize the connection to hald */
305
343
dbus_bool_t    libhal_ctx_init                         (LibHalContext *ctx, DBusError *error);
306
344
 
475
513
void libhal_device_free_changeset (LibHalChangeSet *changeset);
476
514
 
477
515
 
478
 
struct LibHalProperty_s;
479
 
typedef struct LibHalProperty_s LibHalProperty;
480
 
 
481
 
struct LibHalPropertySet_s;
482
 
typedef struct LibHalPropertySet_s LibHalPropertySet;
483
 
 
484
 
 
485
516
/* Retrieve all the properties on a device. */
486
517
LibHalPropertySet *libhal_device_get_all_properties (LibHalContext *ctx, 
487
518
                                                     const char *udi,
497
528
/* Get the number of properties in a property set. */
498
529
unsigned int libhal_property_set_get_num_elems (LibHalPropertySet *set);
499
530
 
 
531
/* Get type of property. */
 
532
LibHalPropertyType libhal_ps_get_type (const LibHalPropertySet *set, const char *key);
 
533
 
 
534
/* Get the value of a property of type string. */
 
535
const char *libhal_ps_get_string  (const LibHalPropertySet *set, const char *key);
 
536
 
 
537
/* Get the value of a property of type signed integer. */
 
538
dbus_int32_t libhal_ps_get_int32 (const LibHalPropertySet *set, const char *key);
 
539
 
 
540
/* Get the value of a property of type unsigned integer. */
 
541
dbus_uint64_t libhal_ps_get_uint64 (const LibHalPropertySet *set, const char *key);
 
542
 
 
543
/* Get the value of a property of type double. */
 
544
double libhal_ps_get_double (const LibHalPropertySet *set, const char *key);
 
545
 
 
546
/* Get the value of a property of type bool. */
 
547
dbus_bool_t libhal_ps_get_bool (const LibHalPropertySet *set, const char *key);
 
548
 
 
549
/* Get the value of a property of type string list. */
 
550
const char * const *libhal_ps_get_strlist (const LibHalPropertySet *set, const char *key);
 
551
 
 
552
 
500
553
/** 
501
554
 * LibHalPropertySetIterator: 
502
555
 * 
675
728
/* hald waits for all addons to call this function before announcing the addon (for hald helpers only) */
676
729
dbus_bool_t libhal_device_addon_is_ready (LibHalContext *ctx, const char *udi, DBusError *error);
677
730
 
 
731
dbus_bool_t libhal_device_singleton_addon_is_ready (LibHalContext *ctx, const char *command_line, DBusError *error);
678
732
 
679
733
/* Take a mandatory lock on an interface on a device. */
680
734
dbus_bool_t libhal_device_acquire_interface_lock (LibHalContext *ctx,
713
767
                                               const char *interface,
714
768
                                               DBusError *error);
715
769
 
 
770
/* Determine if a given caller is privileged (requires HAL to be built with PolicyKit support) */
 
771
char* libhal_device_is_caller_privileged (LibHalContext *ctx,
 
772
                                          const char *udi,
 
773
                                          const char *action,
 
774
                                          const char *caller,
 
775
                                          DBusError *error);
 
776
 
716
777
 
717
778
#if defined(__cplusplus)
718
779
}