29 #include <sbIDatabaseQuery.h>
30 #include <sbILibrary.h>
31 #include <sbILocalDatabaseLibrary.h>
32 #include <sbIMediaItem.h>
34 #include <nsAutoPtr.h>
41 #define SB_SIMPLE_MEDIALIST_FACTORY_TYPE "simple"
43 #define SB_SIMPLE_MEDIALIST_METRICS_TYPE "simple"
62 sbLocalDatabaseSimpleMediaListFactory::GetContractID(nsACString& aContractID)
72 sbLocalDatabaseSimpleMediaListFactory::CreateMediaList(
sbIMediaItem* aInner,
75 NS_ENSURE_ARG_POINTER(aInner);
76 NS_ENSURE_ARG_POINTER(_retval);
78 nsCOMPtr<sbILibrary> library;
79 nsresult rv = aInner->GetLibrary(getter_AddRefs(library));
80 NS_ENSURE_SUCCESS(rv, rv);
82 nsCOMPtr<sbILocalDatabaseLibrary> localLibrary =
83 do_QueryInterface(library, &rv);
84 NS_ENSURE_SUCCESS(rv, rv);
88 NS_ENSURE_SUCCESS(rv, rv);
91 rv = aInner->GetGuid(guid);
92 NS_ENSURE_SUCCESS(rv, rv);
94 nsRefPtr<sbLocalDatabaseSimpleMediaList>
96 NS_ENSURE_TRUE(newMediaList, NS_ERROR_OUT_OF_MEMORY);
98 rv = newMediaList->Init(localLibraryPtr, guid);
99 NS_ENSURE_SUCCESS(rv, rv);
103 nsAutoString customType;
105 if (customType.IsEmpty()) {
113 nsAutoString isSortable;
115 if (isSortable.IsEmpty()) {
118 NS_LITERAL_STRING(
"1"));
121 NS_ADDREF(*_retval = newMediaList);
NS_IMPL_ISUPPORTS1(sbDeviceCapabilitiesUtils, sbIDeviceCapabilitiesUtils) sbDeviceCapabilitiesUtils
#define SB_PROPERTY_ISSORTABLE
#define SB_LOCALDATABASE_SIMPLEMEDIALISTFACTORY_CONTRACTID
#define SB_PROPERTY_CUSTOMTYPE