27 #include "nsISupports.idl"
35 [scriptable,
uuid(e5219882-1dd1-11b2-a99d-c2250594367c)]
41 readonly attribute nsIDPtr
id;
46 readonly attribute AString
name;
70 #include "nsIComponentManager.h"
71 #include "nsICategoryManager.h"
72 #include "nsIServiceManager.h"
73 #include "nsStringGlue.h"
74 #include "nsXPCOMCID.h"
77 struct nsModuleComponentInfo;
79 #define SB_DEVICE_MARSHALL_CATEGORY "songbird-device-marshall"
102 #define SB_DEVICE_MARSHALL_REGISTERSELF(_name) \
104 static NS_METHOD _name##RegisterSelf(nsIComponentManager* aCompMgr, \
106 const char* registryLocation, \
107 const char* componentType, \
108 const nsModuleComponentInfo* info); \
110 static NS_METHOD _name##UnregisterSelf(nsIComponentManager* aCompMgr, \
112 const char* registryLocation, \
113 const nsModuleComponentInfo* info)
118 #define SB_DEVICE_MARSHALL_REGISTERSELF_IMPL(_name) \
121 _name##RegisterSelf(nsIComponentManager* aCompMgr, \
123 const char* registryLocation, \
124 const char* componentType, \
125 const nsModuleComponentInfo* info) \
128 nsCOMPtr<nsICategoryManager> catMan = \
129 do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv); \
130 NS_ENSURE_SUCCESS(rv, rv); \
132 rv = this->GetIdInPlace(&id); \
133 NS_ENSURE_SUCCESS(rv, rv); \
134 nsCAutoString idString(id.ToString()); \
135 NS_ENSURE_STATE(!idString.IsEmpty()); \
136 nsXPIDLCString prevEntry; \
137 rv = catMan->AddCategoryEntry(SB_DEVICE_MARSHALL_CATEGORY, \
141 getter_Copies(prevEntry)); \
142 NS_ENSURE_SUCCESS(rv, rv); \
143 NS_WARN_IF_FALSE(prevEntry.IsEmpty(), \
144 "Another marshall was registered with that id!"); \
149 _name##UnregisterSelf(nsIComponentManager* aCompMgr, \
151 const char* registryLocation, \
152 const nsModuleComponentInfo* info) \
155 nsCOMPtr<nsICategoryManager> catMan = \
156 do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv); \
157 NS_ENSURE_SUCCESS(rv, rv); \
159 rv = this->GetIdInPlace(&id); \
160 NS_ENSURE_SUCCESS(rv, rv); \
161 nsCAutoString idString(id.ToString()); \
162 NS_ENSURE_STATE(!idString.IsEmpty()); \
163 rv = catMan->DeleteCategoryEntry(SB_DEVICE_MARSHALL_CATEGORY, \
166 NS_ENSURE_SUCCESS(rv, rv); \
void loadControllers(in sbIDeviceControllerRegistrar aRegistrar)
[UNIMPLEMENTED UNTIL AFTER 0.3]
void removeDevice(in sbIDevice aDevice)
readonly attribute nsIDPtr id
readonly attribute AString name