| Derived from | |
| Framework | CoreFoundation/CoreFoundation.h |
| Companion guide | |
| Declared in | CFBundle.h CFPlugIn.h |
CFPlugIn provides a standard architecture for application extensions. With CFPlugIn, you can design your application as a host framework that uses a set of executable code modules called plug-ins to provide certain well-defined areas of functionality. This approach allows third-party developers to add features to your application without requiring access to your source code. You can also bundle together plug-ins for multiple platforms and let CFPlugIn transparently load the appropriate plug-in at runtime. You can use CFPlugIn to add plug-in capability to, or write a plug-in for, your application.
CFPlugInRegisterFactoryFunction
CFPlugInRegisterFactoryFunctionByName
CFPlugInRegisterPlugInType
CFPlugInUnregisterFactory
CFPlugInUnregisterPlugInType
CFPlugInAddInstanceForFactory
CFPlugInFindFactoriesForPlugInType
CFPlugInFindFactoriesForPlugInTypeInPlugIn
CFPlugInGetBundle
CFPlugInGetTypeID
CFPlugInIsLoadOnDemand
CFPlugInRemoveInstanceForFactory
CFPlugInSetLoadOnDemand
Registers a new instance of a type with CFPlugIn. .
void CFPlugInAddInstanceForFactory ( CFUUIDRef factoryID );
The CFUUID object representing the plug-in factory.
CFPlugIn.h
Creates a CFPlugIn given its URL.
CFPlugInRef CFPlugInCreate ( CFAllocatorRef allocator, CFURLRef plugInURL );
The allocator to use to allocate memory for the new plug-in. Pass NULL or kCFAllocatorDefault to use the default allocator.
The location of the plug-in.
A new plug-in. Ownership follows the Create Rule.
CFPlugIn.h
Searches all registered plug-ins for factory functions capable of creating an instance of the given type.
CFArrayRef CFPlugInFindFactoriesForPlugInType ( CFUUIDRef typeUUID );
A UUID type.
An array of UUIDs for factory functions capable of creating an instance of the given type.
CFPlugIn.hSearches the given plug-in for factory functions capable of creating an instance of the given type.
CFArrayRef CFPlugInFindFactoriesForPlugInTypeInPlugIn ( CFUUIDRef typeUUID, CFPlugInRef plugIn );
A UUID type.
The plug-in to search.
An array of UUIDs for factory functions capable of creating an instance of the given type.
CFPlugIn.h
Returns a plug-in's bundle.
CFBundleRef CFPlugInGetBundle ( CFPlugInRef plugIn );
The plug-in whose bundle to obtain.
The bundle for plugIn. Ownership follows the Get Rule.
You should always use this function to get a plug-in's bundle. Never attempt to access the plug-in directly as a bundle.
CFPlugIn.h
Returns the type identifier for the CFPlugIn opaque type.
CFTypeID CFPlugInGetTypeID ( void );
The type identifier for the CFPlugIn opaque type.
CFPlugIn.h
Creates a CFPlugIn instance of a given type using a given factory.
void * CFPlugInInstanceCreate ( CFAllocatorRef allocator, CFUUIDRef factoryUUID, CFUUIDRef typeUUID );
The allocator to use to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the default allocator.
The UUID representing the factory function to use to create a plug-in of the given type.
The UUID type.
Returns the IUnknown interface for the new plug-in.
The plug-in host uses this function to create an instance of the given type. Unless the plug-in is using dynamic registration, this function causes the plug-in's code to be loaded into memory.
CFPlugIn.h
Determines where or not a plug-in is loaded on demand.
Boolean CFPlugInIsLoadOnDemand ( CFPlugInRef plugIn );
The plug-in to query.
true if the plug-in is loaded only when a client requests an instance of a supported type, otherwise false.
Plug-ins that do static registration are load on demand by default. Plug-ins that do dynamic registration are not load on demand by default.
CFPlugIn.h
Registers a factory function and its UUID with a CFPlugIn object.
Boolean CFPlugInRegisterFactoryFunction ( CFUUIDRef factoryUUID, CFPlugInFactoryFunction func );
The CFUUID object representing the factory function to register.
The factory function pointer to register.
true if the factory function was successfully registered, otherwise false.
This function is used by a plug-in or host when performing dynamic registration.
CFPlugIn.h
Registers a factory function with a CFPlugIn object using the function's name instead of its UUID.
Boolean CFPlugInRegisterFactoryFunctionByName ( CFUUIDRef factoryUUID, CFPlugInRef plugIn, CFStringRef functionName );
The CFUUID object representing the factory function to register.
The plug-in containing functionName.
The name of the factory function to register.
true if the factory function was successfully registered, otherwise false.
This function is used by a plug-in or host when performing dynamic registration.
CFPlugIn.h
Registers a type and its corresponding factory function with a CFPlugIn object.
Boolean CFPlugInRegisterPlugInType ( CFUUIDRef factoryUUID, CFUUIDRef typeUUID );
The CFUUID object representing the factory function that can create the type being registered.
The UUID type to register.
true if the factory function was successfully registered, otherwise false.
This function is used by a plug-in or host when performing dynamic registration.
CFPlugIn.h
Unregisters an instance of a type with CFPlugIn.
void CFPlugInRemoveInstanceForFactory ( CFUUIDRef factoryID );
The CFUUID object representing the plug-in factory.
If the instance counts of every factory in a plug-in are zero, the plug-in can be unloaded.]
CFPlugIn.h
Enables or disables load on demand for plug-ins that do dynamic registration (only when a client requests an instance of a supported type).
void CFPlugInSetLoadOnDemand ( CFPlugInRef plugIn, Boolean flag );
The plug-in to be loaded on demand.
true to enable load on demand, false otherwise.
Plug-ins that do static registration are load on demand by default. Plug-ins that do dynamic registration are not load on demand by default.
CFPlugIn.h
Removes the given function from a plug-in’s list of registered factory functions.
Boolean CFPlugInUnregisterFactory ( CFUUIDRef factoryUUID );
The CFUUID object representing the factory to unregister.
true if the factory function was successfully unregistered, otherwise false.
Used by a plug-in or host when performing dynamic registration.
CFPlugIn.h
Removes the given type from a plug-in’s list of registered types.
Boolean CFPlugInUnregisterPlugInType ( CFUUIDRef factoryUUID, CFUUIDRef typeUUID );
The CFUUID object representing the factory function for the type to unregister.
The UUID type to unregister.
true if the factory function was successfully unregistered, otherwise false.
Used by a plug-in or host when performing dynamic registration.
CFPlugIn.hA callback which provides a plug-in the opportunity to dynamically register its types with a host.
typedef void (*CFPlugInDynamicRegisterFunction) ( CFPlugInRef plugIn );
If you name your function MyCallBack, you would declare it like this:
void MyCallBack ( CFPlugInRef plugIn );
The CFPlugIn object that is engaged in dynamic registration. When using in C++, this parameter functions as a this pointer for the plug-in.
This callback is called as a plug-in is being loaded. This provides the plugin the means to dynamically register its types and factories with a plug-in’s host. The call is triggered by the presence of kCFPlugInDynamicRegistrationKey in the plug-in's information property list.
CFPlugIn.hCallback function that a plug-in author must implement to create a plug-in instance.
typedef void *(*CFPlugInFactoryFunction) ( CFAllocatorRef allocator, CFUUIDRef typeUUID );
If you name your function MyCallBack, you would declare it like this:
void *MyCallBack ( CFAllocatorRef allocator, CFUUIDRef typeUUID );
The allocator to use to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the default allocator.
The UUID type to instantiate.
The plug-in author's implementation of this function is registered with CFPlugIn either statically in the plug-in's information property list, or dynamically. This function is executed as a result of a call to CFPlugInInstanceCreate by the plug-in host.
CFPlugIn.hCallback function that is called, if present, just before a plug-in's code is unloaded.
typedef void (*CFPlugInUnloadFunction) ( CFPlugInRef plugIn );
If you name your function MyCallBack, you would declare it like this:
void MyCallBack ( CFPlugInRef plugIn );
The CFPlugIn object that is about to be unloaded from memory. When writing in C++, this parameter functions as a this pointer for the plug-in.
CFPlugIn.hA reference to a CFPlugin object.
typedef struct __CFBundle *CFPlugInRef;
CFBundle.hA plug-in’s information property list can contain these keys used for registering types, factories, and interfaces.
const CFStringRef kCFPlugInDynamicRegistrationKey; const CFStringRef kCFPlugInDynamicRegisterFunctionKey; const CFStringRef kCFPlugInUnloadFunctionKey; const CFStringRef kCFPlugInFactoriesKey; const CFStringRef kCFPlugInTypesKey;
kCFPlugInDynamicRegistrationKeyIndicates whether a plug-in requires dynamic registration.
Available in Mac OS X v10.0 and later.
Declared in CFPlugIn.h
kCFPlugInDynamicRegisterFunctionKeyUsed to specify a plug-in’s registration function.
Available in Mac OS X v10.0 and later.
Declared in CFPlugIn.h
kCFPlugInUnloadFunctionKeyUsed to specify a plug-in’s unload function.
Available in Mac OS X v10.0 and later.
Declared in CFPlugIn.h
kCFPlugInFactoriesKeyUsed to statically register factory functions.
Available in Mac OS X v10.0 and later.
Declared in CFPlugIn.h
kCFPlugInTypesKeyUsed to statically register the factories that can create each supported type.
Available in Mac OS X v10.0 and later.
Declared in CFPlugIn.h
CFPlugIn.h
Last updated: 2006-02-07