2 * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
26 Copyright (c) 1999-2003, Apple, Inc. All rights reserved.
29 #if !defined(__COREFOUNDATION_CFPLUGIN_FACTORY__)
30 #define __COREFOUNDATION_CFPLUGIN_FACTORY__ 1
32 #include "CFBundle_Internal.h"
34 #if defined(__cplusplus)
38 typedef struct __CFPFactory
{
39 CFAllocatorRef _allocator
;
44 SInt32 _instanceCount
;
46 CFPlugInFactoryFunction _func
;
49 CFStringRef _funcName
;
51 CFMutableArrayRef _types
;
54 extern _CFPFactory
*_CFPFactoryCreate(CFAllocatorRef allocator
, CFUUIDRef factoryID
, CFPlugInFactoryFunction func
);
55 extern _CFPFactory
*_CFPFactoryCreateByName(CFAllocatorRef allocator
, CFUUIDRef factoryID
, CFPlugInRef plugIn
, CFStringRef funcName
);
57 extern _CFPFactory
*_CFPFactoryFind(CFUUIDRef factoryID
, Boolean enabled
);
59 extern CFUUIDRef
_CFPFactoryGetFactoryID(_CFPFactory
*factory
);
60 extern CFPlugInRef
_CFPFactoryGetPlugIn(_CFPFactory
*factory
);
62 extern void *_CFPFactoryCreateInstance(CFAllocatorRef allocator
, _CFPFactory
*factory
, CFUUIDRef typeID
);
63 extern void _CFPFactoryDisable(_CFPFactory
*factory
);
64 extern Boolean
_CFPFactoryIsEnabled(_CFPFactory
*factory
);
66 extern void _CFPFactoryFlushFunctionCache(_CFPFactory
*factory
);
68 extern void _CFPFactoryAddType(_CFPFactory
*factory
, CFUUIDRef typeID
);
69 extern void _CFPFactoryRemoveType(_CFPFactory
*factory
, CFUUIDRef typeID
);
71 extern Boolean
_CFPFactorySupportsType(_CFPFactory
*factory
, CFUUIDRef typeID
);
72 extern CFArrayRef
_CFPFactoryFindForType(CFUUIDRef typeID
);
74 /* These methods are called by CFPlugInInstance when an instance is created or destroyed. If a factory's instance count goes to 0 and the factory has been disabled, the factory is destroyed. */
75 extern void _CFPFactoryAddInstance(_CFPFactory
*factory
);
76 extern void _CFPFactoryRemoveInstance(_CFPFactory
*factory
);
78 #if defined(__cplusplus)
82 #endif /* ! __COREFOUNDATION_CFPLUGIN_FACTORY__ */