sbLibHal.cpp
Go to the documentation of this file.
1 /*
2 //=BEGIN SONGBIRD GPL
3 //
4 // This file is part of the Songbird web player.
5 //
6 // Copyright(c) 2005-2009 POTI, Inc.
7 // http://www.songbirdnest.com
8 //
9 // This file may be licensed under the terms of of the
10 // GNU General Public License Version 2 (the GPL).
11 //
12 // Software distributed under the License is distributed
13 // on an AS IS basis, WITHOUT WARRANTY OF ANY KIND, either
14 // express or implied. See the GPL for the specific language
15 // governing rights and limitations.
16 //
17 // You should have received a copy of the GPL along with this
18 // program. If not, go to http://www.gnu.org/licenses/gpl.html
19 // or write to the Free Software Foundation, Inc.,
20 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 //
22 //=END SONGBIRD GPL
23 */
24 
25 /* *****************************************************************************
26  *******************************************************************************
27  *
28  * HAL library services.
29  *
30  *******************************************************************************
31  ******************************************************************************/
32 
38 /* *****************************************************************************
39  *
40  * HAL library imported services.
41  *
42  ******************************************************************************/
43 
44 /* Self imports. */
45 #include <sbLibHal.h>
46 
47 #include <sbDebugUtils.h>
48 
49 /* D-Bus imports. */
50 #include <dbus/dbus-glib-lowlevel.h>
51 
52 
53 /* *****************************************************************************
54  *
55  * HAL library services.
56  *
57  ******************************************************************************/
58 
59 /*
60  * sbLibHalCtx
61  *
62  * This method is the constructor for the HAL library context services class.
63  */
64 
66 :
67  mpLibHalCtx(NULL),
68  mpDBusConnection(NULL)
69 {
71 }
72 
73 
74 /*
75  * ~sbLibHalCtx
76  *
77  * This method is the destructor for the HAL library context services class.
78  */
79 
81 {
82  /* Dispose of the HAL library context. */
83  if (mpLibHalCtx)
84  {
85  libhal_ctx_shutdown(mpLibHalCtx, NULL);
86  libhal_ctx_free(mpLibHalCtx);
87  }
88 
89  /* Dispose of the D-Bus connection. */
90  if (mpDBusConnection)
91  dbus_connection_unref(mpDBusConnection);
92 }
93 
94 
95 /*
96  * Initialize
97  *
98  * This method initializes the HAL library context services.
99  */
100 
102 {
103  dbus_bool_t success;
104  DBusError dBusError;
105  nsresult rv = NS_OK;
106 
107  /* Initialize D-Bus errors. */
108  dbus_error_init(&dBusError);
109 
110  /* Create a HAL library context. */
111  mpLibHalCtx = libhal_ctx_new();
112  if (!mpLibHalCtx)
113  rv = NS_ERROR_OUT_OF_MEMORY;
114 
115  /* Set up a D-Bus connection with the glib main event loop. */
116  if (NS_SUCCEEDED(rv))
117  {
118  mpDBusConnection = dbus_bus_get(DBUS_BUS_SYSTEM, &dBusError);
119  if (!mpDBusConnection)
120  rv = NS_ERROR_OUT_OF_MEMORY;
121  }
122  if (NS_SUCCEEDED(rv))
123  dbus_connection_setup_with_g_main(mpDBusConnection, NULL);
124 
125  /* Connect the HAL library context to D-Bus. */
126  if (NS_SUCCEEDED(rv))
127  {
128  success = libhal_ctx_set_dbus_connection(mpLibHalCtx, mpDBusConnection);
129  if (!success)
130  rv = NS_ERROR_FAILURE;
131  }
132 
133  /* Initialize the HAL library context. */
134  if (NS_SUCCEEDED(rv))
135  success = libhal_ctx_init(mpLibHalCtx, &dBusError);
136 
137  /* Log any errors. */
138  if (dbus_error_is_set(&dBusError))
139  {
140  LOG("sbLibHalCtx::Initialize error %s: %s\n",
141  dBusError.name,
142  dBusError.message);
143  dbus_error_init(&dBusError);
144  }
145 
146  /* Clean up. */
147  dbus_error_free(&dBusError);
148 
149  return rv;
150 }
151 
152 
153 /* *****************************************************************************
154  *
155  * HAL library API services.
156  *
157  ******************************************************************************/
158 
159 /*
160  * SetUserData
161  *
162  * --> aUserData User data.
163  *
164  * This function associates the user data specified by aUserData with the
165  * HAL library context.
166  */
167 
169  void *aUserData)
170 {
171  dbus_bool_t success;
172 
173  /* Set the user data. */
174  success = libhal_ctx_set_user_data(mpLibHalCtx, aUserData);
175  NS_ENSURE_TRUE(success, NS_ERROR_UNEXPECTED);
176 
177  return NS_OK;
178 }
179 
180 
181 /*
182  * GetAllDevices
183  *
184  * <-- aDeviceList List of devices.
185  *
186  * This function returns in aDeviceList, the list of all devices. Each entry
187  * in the list contains the device UDI.
188  */
189 
191  nsCStringArray &aDeviceList)
192 {
193  char **deviceList = NULL;
194  int deviceCnt;
195  int i;
196  DBusError dBusError;
197  nsresult rv = NS_OK;
198 
199  /* Initialize D-Bus errors. */
200  dbus_error_init(&dBusError);
201 
202  /* Get the list of devices. */
203  deviceList = libhal_get_all_devices(mpLibHalCtx, &deviceCnt, &dBusError);
204  if (!deviceList)
205  rv = NS_ERROR_UNEXPECTED;
206 
207  /* Return the list of devices. */
208  if (NS_SUCCEEDED(rv))
209  {
210  aDeviceList.Clear();
211  for (i = 0; i < deviceCnt; i++)
212  {
213  aDeviceList.AppendCString(nsCString(deviceList[i]));
214  }
215  }
216 
217  /* Log any errors. */
218  if (dbus_error_is_set(&dBusError))
219  {
220  LOG("sbLibHalCtx::GetAllDevices error %s: %s\n",
221  dBusError.name,
222  dBusError.message);
223  dbus_error_init(&dBusError);
224  }
225 
226  /* Clean up. */
227  dbus_error_free(&dBusError);
228  if (deviceList)
229  libhal_free_string_array(deviceList);
230 
231  return rv;
232 }
233 
234 
235 /*
236  * DevicePropertyExists
237  *
238  * --> aUDI Device for which to check property.
239  * --> aKey Key for property to check.
240  * <-- apExists True if property exists.
241  *
242  * This function checks if the property with the key specified by aKey exists
243  * on the device specified by aUDI. If it does, this function returns true in
244  * apExists; otherwise, it returns false.
245  */
246 
248  const nsACString &aUDI,
249  const char *aKey,
250  PRBool *apExists)
251 {
252  dbus_bool_t exists;
253  DBusError dBusError;
254  nsresult rv = NS_OK;
255 
256  /* Validate parameters. */
257  NS_ASSERTION(aKey, "aKey is null");
258  NS_ASSERTION(apExists, "apExists is null");
259 
260  /* Initialize D-Bus errors. */
261  dbus_error_init(&dBusError);
262 
263  /* Check if the property exists. */
264  exists = libhal_device_property_exists(mpLibHalCtx,
265  aUDI.BeginReading(),
266  aKey,
267  &dBusError);
268 
269  /* Log any errors. */
270  if (dbus_error_is_set(&dBusError))
271  {
272  LOG("sbLibHalCtx::DevicePropertyExists error %s: %s\n",
273  dBusError.name,
274  dBusError.message);
275  dbus_error_init(&dBusError);
276  rv = NS_ERROR_UNEXPECTED;
277  }
278 
279  /* Clean up. */
280  dbus_error_free(&dBusError);
281 
282  /* Return results. */
283  if (NS_SUCCEEDED(rv))
284  {
285  if (exists)
286  *apExists = PR_TRUE;
287  else
288  *apExists = PR_FALSE;
289  }
290 
291  return rv;
292 }
293 
294 
295 /*
296  * DeviceGetPropertyString
297  *
298  * --> aUDI Device for which to get property.
299  * --> aKey Key for property to get.
300  * <-- aProperty Property value.
301  *
302  * This function returns in aProperty the string value for the property with
303  * the key specified by aKey of the device specified by aUDI.
304  */
305 
307  const nsACString &aUDI,
308  const char *aKey,
309  nsCString &aProperty)
310 {
311  char *property = NULL;
312  DBusError dBusError;
313  nsresult rv = NS_OK;
314 
315  /* Validate parameters. */
316  NS_ASSERTION(aKey, "aKey is null");
317 
318  /* Initialize D-Bus errors. */
319  dbus_error_init(&dBusError);
320 
321  /* Get the property string. */
322  property = libhal_device_get_property_string(mpLibHalCtx,
323  aUDI.BeginReading(),
324  aKey,
325  &dBusError);
326  if (property)
327  aProperty.AssignLiteral(property);
328  else
329  rv = NS_ERROR_FAILURE;
330 
331  /* Don't log errors. */
332 
333  /* Clean up. */
334  dbus_error_free(&dBusError);
335  if (property)
336  libhal_free_string(property);
337 
338  return rv;
339 }
340 
341 
342 /*
343  * DeviceGetPropertyInt
344  *
345  * --> aUDI Device for which to get property.
346  * --> aKey Key for property to get.
347  * <-- aProperty Property value.
348  *
349  * This function returns in aProperty the integer value for the property with
350  * the key specified by aKey of the device specified by aUDI.
351  */
352 
354  const nsACString &aUDI,
355  const char *aKey,
356  PRUint32 *aProperty)
357 {
358  int property;
359  DBusError dBusError;
360  nsresult rv = NS_OK;
361 
362  /* Validate parameters. */
363  NS_ASSERTION(aKey, "aKey is null");
364  NS_ASSERTION(aProperty, "aProperty is null");
365 
366  /* Initialize D-Bus errors. */
367  dbus_error_init(&dBusError);
368 
369  /* Get the property int. */
370  property = libhal_device_get_property_int(mpLibHalCtx,
371  aUDI.BeginReading(),
372  aKey,
373  &dBusError);
374  if (!dbus_error_is_set(&dBusError))
375  *aProperty = property;
376  else
377  rv = NS_ERROR_FAILURE;
378 
379  /* Don't log errors. */
380 
381  /* Clean up. */
382  dbus_error_free(&dBusError);
383 
384  return rv;
385 }
386 
387 
388 /*
389  * DeviceGetPropertyBool
390  *
391  * --> aUDI Device for which to get property.
392  * --> aKey Key for property to get.
393  * <-- aProperty Property value.
394  *
395  * This function returns in aProperty the boolean value for the property with
396  * the key specified by aKey of the device specified by aUDI.
397  */
398 
400  const nsACString &aUDI,
401  const char *aKey,
402  PRBool *aProperty)
403 {
404  dbus_bool_t property;
405  DBusError dBusError;
406  nsresult rv = NS_OK;
407 
408  /* Validate parameters. */
409  NS_ASSERTION(aKey, "aKey is null");
410  NS_ASSERTION(aProperty, "aProperty is null");
411 
412  /* Initialize D-Bus errors. */
413  dbus_error_init(&dBusError);
414 
415  /* Get the property int. */
416  property = libhal_device_get_property_bool(mpLibHalCtx,
417  aUDI.BeginReading(),
418  aKey,
419  &dBusError);
420  if (!dbus_error_is_set(&dBusError))
421  *aProperty = property;
422  else
423  rv = NS_ERROR_FAILURE;
424 
425  /* Don't log errors. */
426 
427  /* Clean up. */
428  dbus_error_free(&dBusError);
429 
430  return rv;
431 }
432 
433 
434 /*
435  * DeviceGetPropertyStringList
436  *
437  * --> aUDI Device for which to get property.
438  * --> aKey Key for property to get.
439  * <-- aProperty Property value.
440  *
441  * This function returns in aProperty the string list value for the property
442  * with the key specified by aKey of the device specified by aUDI.
443  */
444 
446  const nsACString &aUDI,
447  const char *aKey,
448  nsTArray<nsCString> &aProperty)
449 {
450  char **property = NULL;
451  DBusError dBusError;
452  nsresult rv = NS_OK;
453 
454  /* Validate parameters. */
455  NS_ASSERTION(aKey, "aKey is null");
456 
457  /* Initialize D-Bus errors. */
458  dbus_error_init(&dBusError);
459 
460  /* Get the property string list. */
461  property = libhal_device_get_property_strlist(mpLibHalCtx,
462  aUDI.BeginReading(),
463  aKey,
464  &dBusError);
465  if (property)
466  {
467  char **pPropStr;
468 
469  pPropStr = &(property[0]);
470  while (*pPropStr)
471  {
472  aProperty.AppendElement(*pPropStr);
473  pPropStr++;
474  }
475  }
476  else
477  {
478  rv = NS_ERROR_FAILURE;
479  }
480 
481  /* Don't log errors since property may not exist. */
482 
483  /* Clean up. */
484  dbus_error_free(&dBusError);
485  if (property)
486  libhal_free_string_array(property);
487 
488  return rv;
489 }
490 
491 
492 /*
493  * SetDeviceAdded
494  *
495  * --> aCallback Device added callback.
496  *
497  * This function sets the device added callback to the callback specified by
498  * aCallback.
499  */
500 
502  LibHalDeviceAdded aCallback)
503 {
504  dbus_bool_t success;
505 
506  /* Validate parameters. */
507  NS_ASSERTION(aCallback, "aCallback is null");
508 
509  /* Set the callback. */
510  success = libhal_ctx_set_device_added(mpLibHalCtx, aCallback);
511  NS_ENSURE_TRUE(success, NS_ERROR_UNEXPECTED);
512 
513  return NS_OK;
514 }
515 
516 
517 /*
518  * SetDeviceRemoved
519  *
520  * --> aCallback Device removed callback.
521  *
522  * This function sets the device removed callback to the callback specified by
523  * aCallback.
524  */
525 
527  LibHalDeviceRemoved aCallback)
528 {
529  dbus_bool_t success;
530 
531  /* Validate parameters. */
532  NS_ASSERTION(aCallback, "aCallback is null");
533 
534  /* Set the callback. */
535  success = libhal_ctx_set_device_removed(mpLibHalCtx, aCallback);
536  NS_ENSURE_TRUE(success, NS_ERROR_UNEXPECTED);
537 
538  return NS_OK;
539 }
540 
541 
542 /*
543  * SetDevicePropertyModified
544  *
545  * --> aCallback Device property modified callback.
546  *
547  * This function sets the device property modified callback to the callback
548  * specified by aCallback.
549  */
550 
552  LibHalDevicePropertyModified
553  aCallback)
554 {
555  dbus_bool_t success;
556 
557  /* Validate parameters. */
558  NS_ASSERTION(aCallback, "aCallback is null");
559 
560  /* Set the callback. */
561  success = libhal_ctx_set_device_property_modified(mpLibHalCtx, aCallback);
562  NS_ENSURE_TRUE(success, NS_ERROR_UNEXPECTED);
563 
564  return NS_OK;
565 }
566 
567 
568 /*
569  * DevicePropertyWatchAll
570  *
571  * This function sets the HAL library API services to watch for and deliver
572  * callbacks for all device property changes.
573  */
574 
576 {
577  DBusError dBusError;
578  dbus_bool_t success;
579  nsresult rv = NS_OK;
580 
581  /* Initialize D-Bus errors. */
582  dbus_error_init(&dBusError);
583 
584  /* Set to watch all property changes for all devices. */
585  success = libhal_device_property_watch_all(mpLibHalCtx, &dBusError);
586  if (!success)
587  rv = NS_ERROR_UNEXPECTED;
588 
589  /* Log any errors. */
590  if (dbus_error_is_set(&dBusError))
591  {
592  LOG("sbLibHalCtx::DevicePropertyWatchAll error %s: %s\n",
593  dBusError.name,
594  dBusError.message);
595  dbus_error_init(&dBusError);
596  }
597 
598  /* Clean up. */
599  dbus_error_free(&dBusError);
600 
601  return rv;
602 }
603 
604 
605 /* *****************************************************************************
606  *
607  * HAL library interface services.
608  *
609  ******************************************************************************/
610 
611 /*
612  * DeviceHasInterface
613  *
614  * --> aUDI Device for which to check for interface.
615  * --> aInterface Interface for which to check.
616  * <-- aHasInterface True if device has interface.
617  *
618  * This function checks if the device specified by aUDI has the interface
619  * specified by aInterface. If it does, this function returns true in
620  * aHasInterface; otherwise, it returns false.
621  */
622 
624  const nsACString &aUDI,
625  const char *aInterface,
626  PRBool *aHasInterface)
627 {
628  nsTArray<nsCString> interfaceList;
629  PRUint32 interfaceCount;
630  PRBool exists;
631  PRUint32 i;
632  nsresult rv;
633 
634  /* Check if the device has any interfaces. */
635  rv = DevicePropertyExists(aUDI, "info.interfaces", &exists);
636  NS_ENSURE_SUCCESS(rv, rv);
637  if (!exists)
638  {
639  *aHasInterface = PR_FALSE;
640  return NS_OK;
641  }
642 
643  /* Get the list of device interfaces. */
644  rv = DeviceGetPropertyStringList(aUDI, "info.interfaces", interfaceList);
645  NS_ENSURE_SUCCESS(rv, rv);
646 
647  /* Search for the interface in the interface list. */
648  interfaceCount = interfaceList.Length();
649  for (i = 0; i < interfaceCount; i++)
650  {
651  if (interfaceList[i].EqualsLiteral(aInterface))
652  {
653  *aHasInterface = PR_TRUE;
654  return NS_OK;
655  }
656  }
657 
658  /* Interface not found. */
659  *aHasInterface = PR_FALSE;
660  return NS_OK;
661 }
662 
663 
664 /* *****************************************************************************
665  *
666  * HAL library D-Bus message services.
667  *
668  ******************************************************************************/
669 
670 /*
671  * DeviceVolumeEject
672  *
673  * --> aDeviceUDI Target device UDI.
674  *
675  * This function sends a call device volume eject method message for the
676  * device specified by aDeviceUDI.
677  */
678 
680  nsCString &aDeviceUDI)
681 {
682  return (DeviceCallMethod(aDeviceUDI,
683  "org.freedesktop.Hal.Device.Volume",
684  "Eject"));
685 }
686 
687 
688 /*
689  * DeviceVolumeUnmount
690  *
691  * --> aDeviceUDI Target device UDI.
692  *
693  * This function sends a call device volume unmount method message for the
694  * device specified by aDeviceUDI.
695  */
696 
698  nsCString &aDeviceUDI)
699 {
700  return (DeviceCallMethod(aDeviceUDI,
701  "org.freedesktop.Hal.Device.Volume",
702  "Unmount"));
703 }
704 
705 
706 /* *****************************************************************************
707  *
708  * Private HAL library D-Bus message services.
709  *
710  ******************************************************************************/
711 
712 /*
713  * DeviceCallMethod
714  *
715  * --> aDeviceUDI Target device UDI.
716  * --> aInterface Method interface.
717  * --> aMethod Method name.
718  *
719  * This function sends the call method message specified by aInterface and
720  * aMethod for the device specified by aDeviceUDI.
721  */
722 
723 nsresult sbLibHalCtx::DeviceCallMethod(
724  nsCString &aDeviceUDI,
725  const char *aInterface,
726  const char *aMethod)
727 {
728  DBusMessage *pDBusMessage = NULL;
729  DBusMessage *pDBusReply = NULL;
730  char **options = NULL;
731  int numOptions = 0;
732  int halRetCode = 0;
733  dbus_bool_t success;
734  DBusError dBusError;
735  nsresult rv = NS_OK;
736 
737  /* Validate parameters. */
738  NS_ASSERTION(aInterface, "aInterface is null");
739  NS_ASSERTION(aMethod, "aMethod is null");
740 
741  /* Initialize D-Bus errors. */
742  dbus_error_init(&dBusError);
743 
744  /* Set up the D-Bus message. */
745  pDBusMessage = dbus_message_new_method_call("org.freedesktop.Hal",
746  aDeviceUDI.get(),
747  aInterface,
748  aMethod);
749  if (!pDBusMessage)
750  rv = NS_ERROR_OUT_OF_MEMORY;
751  if (NS_SUCCEEDED(rv))
752  {
753  success = dbus_message_append_args(pDBusMessage,
754  DBUS_TYPE_ARRAY,
755  DBUS_TYPE_STRING,
756  &options,
757  numOptions,
758  DBUS_TYPE_INVALID);
759  if (!success)
760  rv = NS_ERROR_UNEXPECTED;
761  }
762 
763  /* Send the D-Bus message. */
764  if (NS_SUCCEEDED(rv))
765  {
766  pDBusReply = dbus_connection_send_with_reply_and_block
767  (mpDBusConnection,
768  pDBusMessage,
769  -1,
770  &dBusError);
771  if (!pDBusReply)
772  rv = NS_ERROR_FAILURE;
773  }
774 
775  /* Check for an error return code. If the return */
776  /* code cannot be obtained, assume no error. */
777  if (NS_SUCCEEDED(rv))
778  {
779  rv = DeviceGetMethodRetCode(pDBusReply, &halRetCode);
780  if (NS_SUCCEEDED(rv) && halRetCode)
781  rv = NS_ERROR_FAILURE;
782  else
783  rv = NS_OK;
784  }
785 
786  /* Log any errors. */
787  if (dbus_error_is_set(&dBusError))
788  {
789  LOG("sbLibHalCtx::DeviceCallMethod error %s: %s\n",
790  dBusError.name,
791  dBusError.message);
792  dbus_error_init(&dBusError);
793  }
794 
795  /* Clean up. */
796  dbus_error_free(&dBusError);
797  if (pDBusMessage)
798  dbus_message_unref(pDBusMessage);
799  if (pDBusReply)
800  dbus_message_unref(pDBusReply);
801 
802  return rv;
803 }
804 
805 
806 /*
807  * DeviceGetMethodRetCode
808  *
809  * --> apDBusReply HAL D-Bus reply message.
810  * <-- apRetCode HAL return code.
811  *
812  * This method returns in apRetCode the HAL return code from the HAL device
813  * call method reply message specified by apDBusReply.
814  */
815 
816 nsresult sbLibHalCtx::DeviceGetMethodRetCode(
817  DBusMessage *apDBusReply,
818  int *apRetCode)
819 {
820  DBusMessageIter dBusMessageIter;
821  int retCode;
822  int argType;
823  dbus_bool_t success;
824  nsresult rv = NS_OK;
825  DBusError dBusError;
826 
827  /* Validate parameters. */
828  NS_ASSERTION(apDBusReply, "apDBusReply is null");
829  NS_ASSERTION(apRetCode, "apRetCode is null");
830 
831  /* Initialize D-Bus errors. */
832  dbus_error_init(&dBusError);
833 
834  /* Set up a reply message iterator. */
835  success = dbus_message_iter_init(apDBusReply, &dBusMessageIter);
836  if (!success)
837  rv = NS_ERROR_UNEXPECTED;
838 
839  /* Validate return code argument type. Different version */
840  /* of the HAL library API use signed or unsigned ints. */
841  argType = dbus_message_iter_get_arg_type(&dBusMessageIter);
842  if ((argType != DBUS_TYPE_INT32) && (argType != DBUS_TYPE_UINT32))
843  {
844  LOG("sbLibHalCtx::DeviceGetMethodRetCode "
845  "unexpected return code type %d\n",
846  argType);
847  rv = NS_ERROR_UNEXPECTED;
848  }
849 
850  /* Get the return code. */
851  if (NS_SUCCEEDED(rv))
852  dbus_message_iter_get_basic(&dBusMessageIter, &retCode);
853 
854  /* Log any errors. */
855  if (dbus_error_is_set(&dBusError))
856  {
857  LOG("sbLibHalCtx::DeviceGetMethodRetCode error %s: %s\n",
858  dBusError.name,
859  dBusError.message);
860  dbus_error_init(&dBusError);
861  }
862 
863  /* Clean up. */
864  dbus_error_free(&dBusError);
865 
866  /* Return results. */
867  if (NS_SUCCEEDED(rv))
868  *apRetCode = retCode;
869 
870  return NS_OK;
871 }
872 
873 
nsresult SetDevicePropertyModified(LibHalDevicePropertyModified aCallback)
Definition: sbLibHal.cpp:551
#define SB_PRLOG_SETUP(x)
Definition: sbDebugUtils.h:115
return NS_OK
#define LOG(args)
nsresult DeviceVolumeEject(nsCString &aDeviceUDI)
Definition: sbLibHal.cpp:679
nsresult GetAllDevices(nsCStringArray &aDeviceList)
Definition: sbLibHal.cpp:190
nsresult DeviceHasInterface(const nsACString &aUDI, const char *aInterface, PRBool *aHasInterface)
Definition: sbLibHal.cpp:623
nsresult DeviceGetPropertyInt(const nsACString &aUDI, const char *aKey, PRUint32 *aProperty)
Definition: sbLibHal.cpp:353
nsresult DevicePropertyWatchAll()
Definition: sbLibHal.cpp:575
nsresult DevicePropertyExists(const nsACString &aUDI, const char *aKey, PRBool *apExists)
Definition: sbLibHal.cpp:247
nsresult SetDeviceRemoved(LibHalDeviceRemoved aCallback)
Definition: sbLibHal.cpp:526
virtual ~sbLibHalCtx()
Definition: sbLibHal.cpp:80
nsresult DeviceVolumeUnmount(nsCString &aDeviceUDI)
Definition: sbLibHal.cpp:697
nsresult DeviceGetPropertyStringList(const nsACString &aUDI, const char *aKey, nsTArray< nsCString > &aProperty)
Definition: sbLibHal.cpp:445
nsresult SetDeviceAdded(LibHalDeviceAdded aCallback)
Definition: sbLibHal.cpp:501
foldersync options
Definition: options.js:13
nsresult DeviceGetPropertyBool(const nsACString &aUDI, const char *aKey, PRBool *aProperty)
Definition: sbLibHal.cpp:399
nsresult SetUserData(void *aUserData)
Definition: sbLibHal.cpp:168
nsresult Initialize()
Definition: sbLibHal.cpp:101
_getSelectedPageStyle s i
nsresult DeviceGetPropertyString(const nsACString &aUDI, const char *aKey, nsCString &aProperty)
Definition: sbLibHal.cpp:306