28 #include <nsIPrefBranch.h>
29 #include <nsIPrefService.h>
30 #include <nsIVariant.h>
31 #include <nsIWritablePropertyBag.h>
32 #include <nsIWritablePropertyBag2.h>
34 #include <nsArrayUtils.h>
36 #include <nsComponentManagerUtils.h>
37 #include <nsServiceManagerUtils.h>
38 #include <nsXPCOMCIDInternal.h>
40 #include <sbIDeviceCapabilities.h>
41 #include <sbIDeviceEvent.h>
42 #include <sbIDeviceLibrary.h>
43 #include <sbIDeviceManager.h>
44 #include <sbIDeviceProperties.h>
55 #define DEVICE_PREF_BRANCH \
56 "songbird.devices.mock.00000000-0000-0000-c000-000000000046."
69 #pragma warning(disable: 4355)
73 : mIsConnected(PR_FALSE)
78 sbMockDevice::~sbMockDevice()
84 NS_IMETHODIMP sbMockDevice::GetName(nsAString &
aName)
86 aName.AssignLiteral(
"Bob's Mock Device");
91 NS_IMETHODIMP sbMockDevice::GetProductName(nsAString & aProductName)
93 aProductName.AssignLiteral(
"Mock Device");
98 NS_IMETHODIMP sbMockDevice::GetControllerId(nsID * *aControllerId)
100 NS_ENSURE_ARG_POINTER(aControllerId);
102 *aControllerId = (nsID*)NS_Alloc(
sizeof(nsID));
103 NS_ENSURE_TRUE(*aControllerId, NS_ERROR_OUT_OF_MEMORY);
104 **aControllerId = NS_GET_IID(nsISupports);
109 NS_IMETHODIMP sbMockDevice::GetId(nsID * *aId)
111 NS_ENSURE_ARG_POINTER(aId);
116 mockDeviceID.Parse(
"{3572E6FC-4954-4458-AFE7-0D0A65BF5F55}");
117 NS_ENSURE_TRUE(success, NS_ERROR_FAILURE);
119 *aId = (nsID*)NS_Alloc(
sizeof(nsID));
120 NS_ENSURE_TRUE(*aId, NS_ERROR_OUT_OF_MEMORY);
122 **aId = mockDeviceID;
135 NS_ENSURE_SUCCESS(rv, rv);
137 nsCOMPtr<sbIDeviceContent> deviceContent;
138 rv = GetContent(getter_AddRefs(deviceContent));
139 NS_ENSURE_SUCCESS(rv, rv);
143 NS_ENSURE_SUCCESS(rv, rv);
156 nsresult sbMockDevice::DeviceSpecificDisconnect()
161 nsRefPtr<sbBaseDeviceVolume> volume;
175 nsCOMArray<sbIDeviceLibrary> libraryListCopy;
176 PRInt32 libraryListCopyCount;
177 nsCOMPtr<nsIArray> libraryList;
178 PRUint32 libraryCount;
179 rv =
mContent->GetLibraries(getter_AddRefs(libraryList));
180 if (NS_SUCCEEDED(rv))
181 rv = libraryList->GetLength(&libraryCount);
182 if (NS_SUCCEEDED(rv)) {
183 for (PRUint32
i = 0;
i < libraryCount;
i++) {
184 nsCOMPtr<sbIDeviceLibrary>
185 library = do_QueryElementAt(libraryList,
i, &rv);
188 libraryListCopy.AppendObject(library);
191 libraryListCopyCount = libraryListCopy.Count();
194 for (PRInt32
i = 0;
i < libraryListCopyCount;
i++) {
206 nsCOMPtr<sbIDeviceManager2> manager =
207 do_GetService(
"@songbirdnest.com/Songbird/DeviceManager;2", &rv);
208 NS_ENSURE_SUCCESS(rv, rv);
210 sbNewVariant data(static_cast<sbIDevice*>(static_cast<sbBaseDevice*>(
this)));
211 nsCOMPtr<sbIDeviceEvent> deviceEvent;
213 sbNewVariant(static_cast<sbIDevice*>(static_cast<sbBaseDevice*>(
this))),
217 getter_AddRefs(deviceEvent));
218 NS_ENSURE_SUCCESS(rv, rv);
221 rv = DispatchEvent(deviceEvent, PR_TRUE, &dispatched);
222 NS_ENSURE_SUCCESS(rv, rv);
228 NS_IMETHODIMP sbMockDevice::GetConnected(PRBool *aConnected)
230 NS_ENSURE_ARG_POINTER(aConnected);
236 NS_IMETHODIMP sbMockDevice::GetThreaded(PRBool *aThreaded)
238 NS_ENSURE_ARG_POINTER(aThreaded);
239 *aThreaded = PR_FALSE;
247 NS_ENSURE_ARG_POINTER(_retval);
250 nsCOMPtr<nsIPrefService> prefRoot =
251 do_GetService(
"@mozilla.org/preferences-service;1", &rv);
252 NS_ENSURE_SUCCESS(rv, rv);
254 nsCOMPtr<nsIPrefBranch> prefBranch;
256 NS_ENSURE_SUCCESS(rv, rv);
258 NS_LossyConvertUTF16toASCII prefNameC(aPrefName);
261 rv = prefBranch->GetPrefType(prefNameC.get(),
263 NS_ENSURE_SUCCESS(rv, rv);
265 nsCOMPtr<nsIWritableVariant> result =
266 do_CreateInstance(
"@songbirdnest.com/Songbird/Variant;1", &rv);
267 NS_ENSURE_SUCCESS(rv, rv);
270 case nsIPrefBranch::PREF_INVALID: {
271 rv = result->SetAsVoid();
272 NS_ENSURE_SUCCESS(rv, rv);
275 case nsIPrefBranch::PREF_STRING: {
276 char *
value = nsnull;
277 rv = prefBranch->GetCharPref(prefNameC.get(), &
value);
278 NS_ENSURE_SUCCESS(rv, rv);
279 rv = result->SetAsString(value);
281 NS_ENSURE_SUCCESS(rv, rv);
284 case nsIPrefBranch::PREF_INT: {
286 rv = prefBranch->GetIntPref(prefNameC.get(), &
value);
287 NS_ENSURE_SUCCESS(rv, rv);
288 rv = result->SetAsInt32(value);
289 NS_ENSURE_SUCCESS(rv, rv);
292 case nsIPrefBranch::PREF_BOOL: {
294 rv = prefBranch->GetBoolPref(prefNameC.get(), &
value);
295 NS_ENSURE_SUCCESS(rv, rv);
296 rv = result->SetAsBool(value);
297 NS_ENSURE_SUCCESS(rv, rv);
302 return NS_ERROR_UNEXPECTED;
306 return CallQueryInterface(result, _retval);
312 NS_ENSURE_ARG_POINTER(aPrefValue);
315 nsCOMPtr<nsIPrefService> prefRoot =
316 do_GetService(
"@mozilla.org/preferences-service;1", &rv);
317 NS_ENSURE_SUCCESS(rv, rv);
319 nsCOMPtr<nsIPrefBranch> prefBranch;
321 NS_ENSURE_SUCCESS(rv, rv);
323 NS_LossyConvertUTF16toASCII prefNameC(aPrefName);
326 rv = aPrefValue->GetDataType(&prefType);
327 NS_ENSURE_SUCCESS(rv, rv);
330 rv = prefBranch->GetPrefType(prefNameC.get(), &oldPrefType);
331 NS_ENSURE_SUCCESS(rv, rv);
334 case nsIDataType::VTYPE_INT8:
335 case nsIDataType::VTYPE_INT16:
336 case nsIDataType::VTYPE_INT32:
337 case nsIDataType::VTYPE_INT64:
338 case nsIDataType::VTYPE_UINT8:
339 case nsIDataType::VTYPE_UINT16:
340 case nsIDataType::VTYPE_UINT32:
341 case nsIDataType::VTYPE_UINT64:
343 if (oldPrefType != nsIPrefBranch::PREF_INVALID &&
344 oldPrefType != nsIPrefBranch::PREF_INT) {
345 rv = prefBranch->ClearUserPref(prefNameC.get());
346 NS_ENSURE_SUCCESS(rv, rv);
349 rv = aPrefValue->GetAsInt32(&value);
350 NS_ENSURE_SUCCESS(rv, rv);
351 rv = prefBranch->SetIntPref(prefNameC.get(),
value);
352 NS_ENSURE_SUCCESS(rv, rv);
355 if (aPrefName.Equals(NS_LITERAL_STRING(
"state"))) {
361 case nsIDataType::VTYPE_BOOL:
363 if (oldPrefType != nsIPrefBranch::PREF_INVALID &&
364 oldPrefType != nsIPrefBranch::PREF_BOOL) {
365 rv = prefBranch->ClearUserPref(prefNameC.get());
366 NS_ENSURE_SUCCESS(rv, rv);
369 rv = aPrefValue->GetAsBool(&value);
370 NS_ENSURE_SUCCESS(rv, rv);
371 rv = prefBranch->SetBoolPref(prefNameC.get(),
value);
372 NS_ENSURE_SUCCESS(rv, rv);
377 if (oldPrefType != nsIPrefBranch::PREF_INVALID &&
378 oldPrefType != nsIPrefBranch::PREF_STRING) {
379 rv = prefBranch->ClearUserPref(prefNameC.get());
380 NS_ENSURE_SUCCESS(rv, rv);
383 rv = aPrefValue->GetAsACString(value);
384 NS_ENSURE_SUCCESS(rv, rv);
385 rv = prefBranch->SetCharPref(prefNameC.get(), value.get());
386 NS_ENSURE_SUCCESS(rv, rv);
397 NS_ENSURE_ARG_POINTER(aCapabilities);
401 nsCOMPtr<sbIDeviceCapabilities> caps =
403 NS_ENSURE_SUCCESS(rv, rv);
405 NS_ENSURE_SUCCESS(rv, rv);
409 rv = caps->SetFunctionTypes(functionTypes, NS_ARRAY_LENGTH(functionTypes));
410 NS_ENSURE_SUCCESS(rv, rv);
414 contentTypes, NS_ARRAY_LENGTH(contentTypes));
415 NS_ENSURE_SUCCESS(rv, rv);
417 const char* K_MIMETYPE_STRING =
"ogg-theora-vorbis-sample-1";
419 &K_MIMETYPE_STRING, 1);
420 NS_ENSURE_SUCCESS(rv, rv);
422 nsCOMPtr<sbIDevCapVideoStream> videoFormat =
424 NS_ENSURE_SUCCESS(rv, rv);
426 nsCOMPtr<sbIImageSize> videoSize =
428 NS_ENSURE_SUCCESS(rv, rv);
429 rv = videoSize->Initialize(1280, 720);
430 NS_ENSURE_SUCCESS(rv, rv);
431 nsCOMPtr<nsIMutableArray> videoSizeArray =
432 do_CreateInstance(
"@songbirdnest.com/moz/xpcom/threadsafe-array;1", &rv);
433 NS_ENSURE_SUCCESS(rv, rv);
434 rv = videoSizeArray->AppendElement(videoSize, PR_FALSE);
435 NS_ENSURE_SUCCESS(rv, rv);
437 nsCOMPtr<sbIDevCapRange> videoBitrateRange =
439 NS_ENSURE_SUCCESS(rv, rv);
440 rv = videoBitrateRange->Initialize(100, 4 * 1024 * 1024, 100);
441 NS_ENSURE_SUCCESS(rv, rv);
444 nsCOMPtr<sbIDevCapFraction> parFraction =
445 do_CreateInstance(
"@songbirdnest.com/Songbird/Device/sbfraction;1", &rv);
446 NS_ENSURE_SUCCESS(rv, rv);
447 rv = parFraction->Initialize(1, 1);
448 NS_ENSURE_SUCCESS(rv, rv);
449 nsCOMPtr<nsIMutableArray> parFractionArray =
450 do_CreateInstance(
"@songbirdnest.com/moz/xpcom/threadsafe-array;1", &rv);
451 NS_ENSURE_SUCCESS(rv, rv);
452 rv = parFractionArray->AppendElement(parFraction, PR_FALSE);
453 NS_ENSURE_SUCCESS(rv, rv);
456 nsCOMPtr<sbIDevCapFraction> frameRateFraction =
457 do_CreateInstance(
"@songbirdnest.com/Songbird/Device/sbfraction;1", &rv);
458 NS_ENSURE_SUCCESS(rv, rv);
459 rv = frameRateFraction->Initialize(30000, 1001);
460 NS_ENSURE_SUCCESS(rv, rv);
461 nsCOMPtr<nsIMutableArray> frameRateFractionArray =
462 do_CreateInstance(
"@songbirdnest.com/moz/xpcom/threadsafe-array;1", &rv);
463 NS_ENSURE_SUCCESS(rv, rv);
464 rv = frameRateFractionArray->AppendElement(frameRateFraction, PR_FALSE);
465 NS_ENSURE_SUCCESS(rv, rv);
467 rv = videoFormat->Initialize(NS_LITERAL_CSTRING(
"video/x-theora"),
473 frameRateFractionArray,
477 nsCOMPtr<sbIDevCapAudioStream> audioFormat =
479 NS_ENSURE_SUCCESS(rv, rv);
480 nsCOMPtr<sbIDevCapRange> audioBitrateRange =
482 NS_ENSURE_SUCCESS(rv, rv);
483 rv = audioBitrateRange->Initialize(100, 4 * 1024 * 1024, 100);
484 NS_ENSURE_SUCCESS(rv, rv);
485 nsCOMPtr<sbIDevCapRange> audioSampleRateRange =
487 NS_ENSURE_SUCCESS(rv, rv);
488 rv = audioSampleRateRange->Initialize(22050, 44100, 22050);
489 NS_ENSURE_SUCCESS(rv, rv);
490 nsCOMPtr<sbIDevCapRange> audioChannelsRange =
492 NS_ENSURE_SUCCESS(rv, rv);
493 rv = audioChannelsRange->Initialize(1, 2, 1);
494 NS_ENSURE_SUCCESS(rv, rv);
495 rv = audioFormat->Initialize(NS_LITERAL_CSTRING(
"audio/x-vorbis"),
497 audioSampleRateRange,
500 nsCOMPtr<sbIVideoFormatType> formatType =
502 NS_ENSURE_SUCCESS(rv, rv);
503 rv = formatType->Initialize(NS_LITERAL_CSTRING(
"application/ogg"),
504 videoFormat, audioFormat);
505 NS_ENSURE_SUCCESS(rv, rv);
507 NS_ConvertASCIItoUTF16(K_MIMETYPE_STRING),
509 NS_ENSURE_SUCCESS(rv, rv);
512 rv = caps->ConfigureDone();
513 NS_ENSURE_SUCCESS(rv, rv);
515 caps.forget(aCapabilities);
525 NS_ENSURE_TRUE(deviceContent, NS_ERROR_OUT_OF_MEMORY);
526 rv = deviceContent->Initialize();
527 NS_ENSURE_SUCCESS(rv, rv);
531 nsRefPtr<sbBaseDeviceVolume> volume;
533 NS_ENSURE_SUCCESS(rv, rv);
536 char volumeGUID[NSID_LENGTH];
538 rv = GetId(&deviceID);
539 NS_ENSURE_SUCCESS(rv, rv);
540 deviceID->ToProvidedString(volumeGUID);
542 rv = volume->SetGUID(NS_ConvertUTF8toUTF16(volumeGUID));
543 NS_ENSURE_SUCCESS(rv, rv);
547 NS_ENSURE_SUCCESS(rv, rv);
557 NS_NAMED_LITERAL_STRING(LIBID,
"mock-library.mock-device");
558 nsCOMPtr<sbIDeviceLibrary> devLib;
560 NS_ENSURE_SUCCESS(rv, rv);
563 rv = volume->SetDeviceLibrary(devLib);
564 NS_ENSURE_SUCCESS(rv, rv);
567 NS_ENSURE_SUCCESS(rv, rv);
594 NS_IMETHODIMP sbMockDevice::GetParameters(nsIPropertyBag2 * *aParameters)
598 nsCOMPtr<nsIWritablePropertyBag> writeBag =
599 do_CreateInstance(
"@mozilla.org/hash-property-bag;1", &rv);
600 NS_ENSURE_SUCCESS(rv, rv);
602 nsCOMPtr<nsIWritableVariant> deviceType =
603 do_CreateInstance(
"@songbirdnest.com/Songbird/Variant;1", &rv);
604 NS_ENSURE_SUCCESS(rv, rv);
607 rv = deviceType->SetAsAString(NS_LITERAL_STRING(
"MTP"));
608 NS_ENSURE_SUCCESS(rv, rv);
610 rv = writeBag->SetProperty(NS_LITERAL_STRING(
"DeviceType"),
612 NS_ENSURE_SUCCESS(rv, rv);
614 nsCOMPtr<nsIPropertyBag2> propBag = do_QueryInterface(writeBag, &rv);
615 NS_ENSURE_SUCCESS(rv, rv);
617 propBag.forget(aParameters);
624 nsresult rv = NS_ERROR_UNEXPECTED;
628 do_CreateInstance(
"@songbirdnest.com/Songbird/Device/DeviceProperties;1", &rv);
629 NS_ENSURE_SUCCESS(rv, rv);
631 rv = properties->InitFriendlyName(NS_LITERAL_STRING(
"Testing Device"));
632 NS_ENSURE_SUCCESS(rv, rv);
634 rv = properties->InitVendorName(NS_LITERAL_STRING(
"ACME Inc."));
635 NS_ENSURE_SUCCESS(rv, rv);
637 nsCOMPtr<nsIWritableVariant> modelNumber =
638 do_CreateInstance(
"@songbirdnest.com/Songbird/Variant;1", &rv);
639 NS_ENSURE_SUCCESS(rv, rv);
641 rv = modelNumber->SetAsString(
"ACME 9000");
642 NS_ENSURE_SUCCESS(rv, rv);
644 rv = properties->InitModelNumber(modelNumber);
645 NS_ENSURE_SUCCESS(rv, rv);
647 nsCOMPtr<nsIWritableVariant> serialNumber =
648 do_CreateInstance(
"@songbirdnest.com/Songbird/Variant;1", &rv);
649 NS_ENSURE_SUCCESS(rv, rv);
651 rv = serialNumber->SetAsString(
"ACME-9000-0001-2000-3000");
652 NS_ENSURE_SUCCESS(rv, rv);
654 rv = properties->InitSerialNumber(serialNumber);
655 NS_ENSURE_SUCCESS(rv, rv);
657 rv = properties->InitFirmwareVersion(NS_LITERAL_STRING(
"1.0.0.0"));
658 NS_ENSURE_SUCCESS(rv, rv);
660 nsCOMPtr<nsIWritablePropertyBag> writeBag =
661 do_CreateInstance(
"@mozilla.org/hash-property-bag;1", &rv);
662 NS_ENSURE_SUCCESS(rv, rv);
664 nsCOMPtr<nsIWritableVariant> freeSpace =
665 do_CreateInstance(
"@songbirdnest.com/Songbird/Variant;1", &rv);
666 NS_ENSURE_SUCCESS(rv, rv);
668 rv = freeSpace->SetAsString(
"17179869184");
669 NS_ENSURE_SUCCESS(rv, rv);
671 rv = writeBag->SetProperty(NS_LITERAL_STRING(
"http://songbirdnest.com/device/1.0#freeSpace"),
673 NS_ENSURE_SUCCESS(rv, rv);
675 nsCOMPtr<nsIWritableVariant> totalUsedSpace =
676 do_CreateInstance(
"@songbirdnest.com/Songbird/Variant;1", &rv);
677 NS_ENSURE_SUCCESS(rv, rv);
679 rv = totalUsedSpace->SetAsString(
"4294967296");
680 NS_ENSURE_SUCCESS(rv, rv);
682 rv = writeBag->SetProperty(NS_LITERAL_STRING(
"http://songbirdnest.com/device/1.0#totalUsedSpace"),
684 NS_ENSURE_SUCCESS(rv, rv);
686 nsCOMPtr<nsIPropertyBag2> propBag = do_QueryInterface(writeBag, &rv);
687 NS_ENSURE_SUCCESS(rv, rv);
689 rv = properties->InitDeviceProperties(propBag);
690 NS_ENSURE_SUCCESS(rv, rv);
692 rv = properties->InitDone();
693 NS_ENSURE_SUCCESS(rv, rv);
704 nsIPropertyBag2 *aRequestParameters)
711 std::insert_iterator<std::vector<nsRefPtr<sbRequestItem> > >
713 std::copy(aBatch.
begin(), aBatch.
end(), insertIter);
726 return NS_ERROR_NOT_IMPLEMENTED;
737 nsCOMPtr<nsIVariant> busyVariant;
740 getter_AddRefs(busyVariant));
741 NS_ENSURE_SUCCESS(rv, rv);
743 PRUint16 dataType = 0;
744 rv = busyVariant->GetDataType(&dataType);
745 NS_ENSURE_SUCCESS(rv, rv);
747 if(dataType == nsIDataType::VTYPE_BOOL) {
748 rv = busyVariant->GetAsBool(aIsBusy);
749 NS_ENSURE_SUCCESS(rv, rv);
753 NS_ENSURE_SUCCESS(rv, rv);
794 #define SET_PROP(type, name) \
795 rv = bag->SetPropertyAs ## type(NS_LITERAL_STRING(#name), \
796 transferRequest->name); \
797 NS_ENSURE_SUCCESS(rv, rv);
800 NS_IMETHODIMP sbMockDevice::PopRequest(nsIPropertyBag2 **_retval)
804 NS_ENSURE_ARG_POINTER(_retval);
809 return NS_ERROR_NOT_AVAILABLE;
811 nsRefPtr<sbRequestItem> requestItem = *
mBatch.begin();
815 nsCOMPtr<nsIWritablePropertyBag2> bag =
816 do_CreateInstance(NS_HASH_PROPERTY_BAG_CONTRACTID, &rv);
817 NS_ENSURE_SUCCESS(rv, rv);
819 const PRInt32 batchCount =
mBatch.size();
821 rv = bag->SetPropertyAsInt32(NS_LITERAL_STRING(
"requestType"),
822 requestItem->GetType());
823 rv = bag->SetPropertyAsInt32(NS_LITERAL_STRING(
"batchCount"), batchCount);
824 NS_ENSURE_SUCCESS(rv, rv);
826 const PRInt32 batchIndex = requestItem->GetBatchIndex();
828 rv = bag->SetPropertyAsInt32(NS_LITERAL_STRING(
"batchIndex"), batchIndex);
829 NS_ENSURE_SUCCESS(rv, rv);
831 const PRInt32 requestId = requestItem->GetRequestId();
833 rv = bag->SetPropertyAsInt32(NS_LITERAL_STRING(
"itemTransferID"),
835 NS_ENSURE_SUCCESS(rv, rv);
838 TransferRequest * transferRequest =
839 static_cast<TransferRequest *
>(requestItem.get());
846 return CallQueryInterface(bag, _retval);
865 nsIInputStream** retval)
870 NS_IMETHODIMP sbMockDevice::GetCurrentStatus(
sbIDeviceStatus * *aCurrentStatus)
872 NS_ENSURE_ARG(aCurrentStatus);
873 return mStatus->GetCurrentStatus(aCurrentStatus);
880 return NS_ERROR_NOT_IMPLEMENTED;
885 NS_ENSURE_ARG_POINTER(_retval);
NS_IMETHOD GetPreference(const nsAString &aPrefName, nsIVariant **_retval)
NS_SCRIPTABLE NS_IMETHOD ResetWarningDialogs(void)
nsCOMPtr< sbDeviceContent > mContent
nsresult CreateDeviceLibrary(const nsAString &aId, nsIURI *aLibraryLocation, sbIDeviceLibrary **_retval)
const PRUint32 FUNCTION_VIDEO_PLAYBACK
nsAutoPtr< sbDeviceStatusHelper > mStatus
#define SB_IMAGESIZE_CONTRACTID
nsresult ProcessBatch(Batch &aBatch)
[UNIMPLEMENTED UNTIL AFTER 0.3]
NS_IMETHOD GetIsDirectTranscoding(PRBool *aIsDirect)
nsRefPtr< sbDeviceRequestThreadQueue > mRequestThreadQueue
nsCOMPtr< sbIDeviceProperties > mProperties
NS_IMETHOD GetPrimaryLibrary(sbIDeviceLibrary **aPrimaryLibrary)
NS_IMETHOD GetPreviousState(PRUint32 *aState)
NS_SCRIPTABLE NS_IMETHOD SetWarningDialogEnabled(const nsAString &aWarning, PRBool aEnabled)
NS_SCRIPTABLE NS_IMETHOD OpenInputStream(nsIURI *aURI, nsIInputStream **retval)
nsRefPtr< sbBaseDeviceVolume > mPrimaryVolume
NS_SCRIPTABLE NS_IMETHOD GetWarningDialogEnabled(const nsAString &aWarning, PRBool *_retval)
NS_IMETHOD SyncLibraries(void)
Songbird Variant Utility Definitions.
[UNIMPLEMENTED UNTIL AFTER 0.3]
#define SET_PROP(type, name)
nsRefPtr< sbBaseDeviceVolume > mDefaultVolume
#define SB_IDEVCAPAUDIOSTREAM_CONTRACTID
NS_IMPL_THREADSAFE_RELEASE(sbRequestItem)
const PRUint32 FUNCTION_DEVICE
#define DEVICE_PREF_BRANCH
NS_IMPL_THREADSAFE_ADDREF(sbRequestItem)
#define SB_IDEVCAPVIDEOSTREAM_CONTRACTID
const PRUint32 CONTENT_VIDEO
NS_IMETHOD GetState(PRUint32 *aState)
std::vector< nsRefPtr< sbRequestItem > > mBatch
#define SONGBIRD_DEVICECAPABILITIES_CONTRACTID
const_iterator end() const
nsresult ReqProcessingStart()
NS_IMETHOD SupportsMediaItem(sbIMediaItem *aMediaItem, sbIDeviceSupportsItemCallback *aCallback)
NS_DECL_ISUPPORTS static NS_DECL_SBIDEVICECONTENT sbDeviceContent * New()
NS_IMETHOD GetDefaultLibrary(sbIDeviceLibrary **aDefaultLibrary)
_updateTextAndScrollDataForFrame aContent
const unsigned long STATE_IDLE
NS_IMETHOD CancelRequests()
Media library abstraction.
attribute unsigned long state
NS_IMETHOD GetIsBusy(PRBool *aIsBusy)
#define SB_IDEVCAPRANGE_CONTRACTID
NS_IMETHOD ExportToDevice(sbIDeviceLibrary *aDevLibrary, sbILibraryChangeset *aChangeset)
readonly attribute sbIDeviceProperties properties
const unsigned long EVENT_DEVICE_REMOVED
nsresult AddVolume(sbBaseDeviceVolume *aVolume)
nsresult RemoveLibrary(sbIDeviceLibrary *aDevLib)
NS_IMETHOD GetSupportsReformat(PRBool *_retval)
#define SB_IVIDEOFORMATTYPE_CONTRACTID
NS_IMETHOD SubmitRequest(PRUint32 aRequest, nsIPropertyBag2 *aRequestParameters)
NS_IMETHOD GetCanDisconnect(PRBool *aCanDisconnect)
static NS_DECL_ISUPPORTS nsresult New(sbBaseDeviceVolume **aVolume, sbBaseDevice *aDevice)
NS_IMETHOD ImportFromDevice(sbILibrary *aImportToLibrary, sbILibraryChangeset *aImportChangeset)
NS_IMETHOD SetState(PRUint32 aState)
_getSelectedPageStyle s i
const_iterator begin() const
NS_IMETHOD SetPreference(const nsAString &aPrefName, nsIVariant *aPrefValue)
void FinalizeDeviceLibrary(sbIDeviceLibrary *aDevLib)
NS_IMETHOD SetDefaultLibrary(sbIDeviceLibrary *aDefaultLibrary)
nsresult RemoveVolume(sbBaseDeviceVolume *aVolume)
nsresult AddLibrary(sbIDeviceLibrary *aDevLib)