28 #include "nsISupports.idl"
50 [scriptable,
uuid(65b0423e-1dd2-11b2-8f1d-8a6e9596b52a)]
148 #include <nsIComponentManager.h>
149 #include <nsICategoryManager.h>
150 #include <nsIGenericFactory.h>
151 #include <nsIServiceManager.h>
153 #include <nsCOMPtr.h>
154 #include <nsServiceManagerUtils.h>
155 #include <nsStringGlue.h>
156 #include <nsXPCOMCID.h>
159 struct nsModuleComponentInfo;
161 #define SB_MEDIA_ITEM_DOWNLOADER_CATEGORY "songbird-media-item-downloader"
184 #define SB_MEDIA_ITEM_DOWNLOADER_REGISTERSELF(_name) \
186 NS_METHOD _name##RegisterSelf(nsIComponentManager* aCompMgr, \
188 const char* registryLocation, \
189 const char* componentType, \
190 const nsModuleComponentInfo* info); \
192 NS_METHOD _name##UnregisterSelf(nsIComponentManager* aCompMgr, \
194 const char* registryLocation, \
195 const nsModuleComponentInfo* info);
200 #define SB_MEDIA_ITEM_DOWNLOADER_REGISTERSELF_IMPL(_name) \
203 _name##RegisterSelf(nsIComponentManager* aCompMgr, \
205 const char* registryLocation, \
206 const char* componentType, \
207 const nsModuleComponentInfo* info) \
210 nsCOMPtr<nsICategoryManager> catMan = \
211 do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv); \
212 NS_ENSURE_SUCCESS(rv, rv); \
213 nsCAutoString prevEntry; \
214 rv = catMan->AddCategoryEntry(SB_MEDIA_ITEM_DOWNLOADER_CATEGORY, \
218 getter_Copies(prevEntry)); \
219 NS_ENSURE_SUCCESS(rv, rv); \
220 NS_WARN_IF_FALSE(prevEntry.IsEmpty(), \
221 "Another downloader was registered with that id!"); \
226 _name##UnregisterSelf(nsIComponentManager* aCompMgr, \
228 const char* registryLocation, \
229 const nsModuleComponentInfo* info) \
232 nsCOMPtr<nsICategoryManager> catMan = \
233 do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv); \
234 NS_ENSURE_SUCCESS(rv, rv); \
235 rv = catMan->DeleteCategoryEntry(SB_MEDIA_ITEM_DOWNLOADER_CATEGORY, \
238 NS_ENSURE_SUCCESS(rv, rv); \
Media library abstraction.