27 #include "nsISupports.idl"
32 [scriptable,
uuid(20a5b0ee-1869-4717-bbe4-c5d9db37c6fa)]
36 readonly attribute AString
name;
45 #include <nsIComponentManager.h>
46 #include <nsICategoryManager.h>
47 #include <nsIGenericFactory.h>
48 #include <nsIServiceManager.h>
51 #include <nsServiceManagerUtils.h>
52 #include <nsStringGlue.h>
53 #include <nsXPCOMCID.h>
56 struct nsModuleComponentInfo;
58 #define SB_MEDIACORE_FACTORY_CATEGORY "songbird-mediacore-factory"
81 #define SB_MEDIACORE_FACTORY_REGISTERSELF(_name) \
83 NS_METHOD _name##RegisterSelf(nsIComponentManager* aCompMgr, \
85 const char* registryLocation, \
86 const char* componentType, \
87 const nsModuleComponentInfo* info); \
89 NS_METHOD _name##UnregisterSelf(nsIComponentManager* aCompMgr, \
91 const char* registryLocation, \
92 const nsModuleComponentInfo* info)
97 #define SB_MEDIACORE_FACTORY_REGISTERSELF_IMPL(_name, _desc) \
100 _name##RegisterSelf(nsIComponentManager* aCompMgr, \
102 const char* registryLocation, \
103 const char* componentType, \
104 const nsModuleComponentInfo* info) \
107 nsCOMPtr<nsICategoryManager> catMan = \
108 do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv); \
109 NS_ENSURE_SUCCESS(rv, rv); \
110 nsCAutoString prevEntry; \
111 rv = catMan->AddCategoryEntry(SB_MEDIACORE_FACTORY_CATEGORY, \
115 getter_Copies(prevEntry)); \
116 NS_ENSURE_SUCCESS(rv, rv); \
117 NS_WARN_IF_FALSE(prevEntry.IsEmpty(), \
118 "Another controller was registered with that id!"); \
123 _name##UnregisterSelf(nsIComponentManager* aCompMgr, \
125 const char* registryLocation, \
126 const nsModuleComponentInfo* info) \
129 nsCOMPtr<nsICategoryManager> catMan = \
130 do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv); \
131 NS_ENSURE_SUCCESS(rv, rv); \
132 rv = catMan->DeleteCategoryEntry(SB_MEDIACORE_FACTORY_CATEGORY, \
135 NS_ENSURE_SUCCESS(rv, rv); \