00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef __OFFSCREENGECKO_COMPONENTMGR_H__
00038 #define __OFFSCREENGECKO_COMPONENTMGR_H__
00039
00044 #include "baseobj.h"
00045
00051 OSGK_DERIVEDTYPE(OSGK_ComponentMgr);
00052
00053 struct nsID;
00054 typedef struct nsID nsCID;
00055 OSGK_CLASSTYPE_DEF nsIFactory;
00056
00068 OSGK_EXTERN_C OSGK_API int osgk_componentmgr_register_xpcom_factory (
00069 OSGK_ComponentMgr* compMgr, const nsCID* aClass, const char* className,
00070 const char* contractID, OSGK_CLASSTYPE_REF nsIFactory* factory,
00071 OSGK_GeckoResult* geckoResult OSGK_DEFAULT_ARG(0));
00072
00073 #ifdef __cplusplus
00074
00075 namespace OSGK
00076 {
00082 struct ComponentMgr : public CXXAPI::Wrap<OSGK_ComponentMgr>
00083 {
00084 explicit ComponentMgr (WrappedType* obj) : WrapperType (obj) {}
00085 ComponentMgr& operator=(const ComponentMgr& other)
00086 {
00087 WrapperType::operator=(other);
00088 return *this;
00089 }
00090
00100 bool RegisterXPCOMFactory (const nsCID& aClass,
00101 const char* className,
00102 const char* contractID,
00103 nsIFactory* factory,
00104 OSGK_GeckoResult& geckoResult)
00105 {
00106 return osgk_componentmgr_register_xpcom_factory (GetObject(),
00107 &aClass, className, contractID, factory, &geckoResult) != 0;
00108 }
00117 bool RegisterXPCOMFactory (const nsCID& aClass,
00118 const char* className,
00119 const char* contractID,
00120 nsIFactory* factory)
00121 {
00122 return osgk_componentmgr_register_xpcom_factory (GetObject(),
00123 &aClass, className, contractID, factory) != 0;
00124 }
00125 };
00126
00127 }
00128 #endif
00129
00130 #endif // __OFFSCREENGECKO_COMPONENTMGR_H__