]> git.saurik.com Git - apple/cf.git/blob - PlugIn.subproj/CFPlugIn_Factory.h
CF-299.tar.gz
[apple/cf.git] / PlugIn.subproj / CFPlugIn_Factory.h
1 /*
2 * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
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
13 * file.
14 *
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.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25 /* CFPlugIn_Factory.h
26 Copyright (c) 1999-2003, Apple, Inc. All rights reserved.
27 */
28
29 #if !defined(__COREFOUNDATION_CFPLUGIN_FACTORY__)
30 #define __COREFOUNDATION_CFPLUGIN_FACTORY__ 1
31
32 #include "CFBundle_Internal.h"
33
34 #if defined(__cplusplus)
35 extern "C" {
36 #endif
37
38 typedef struct __CFPFactory {
39 CFAllocatorRef _allocator;
40
41 CFUUIDRef _uuid;
42 Boolean _enabled;
43 char _padding[3];
44 SInt32 _instanceCount;
45
46 CFPlugInFactoryFunction _func;
47
48 CFPlugInRef _plugIn;
49 CFStringRef _funcName;
50
51 CFMutableArrayRef _types;
52 } _CFPFactory;
53
54 extern _CFPFactory *_CFPFactoryCreate(CFAllocatorRef allocator, CFUUIDRef factoryID, CFPlugInFactoryFunction func);
55 extern _CFPFactory *_CFPFactoryCreateByName(CFAllocatorRef allocator, CFUUIDRef factoryID, CFPlugInRef plugIn, CFStringRef funcName);
56
57 extern _CFPFactory *_CFPFactoryFind(CFUUIDRef factoryID, Boolean enabled);
58
59 extern CFUUIDRef _CFPFactoryGetFactoryID(_CFPFactory *factory);
60 extern CFPlugInRef _CFPFactoryGetPlugIn(_CFPFactory *factory);
61
62 extern void *_CFPFactoryCreateInstance(CFAllocatorRef allocator, _CFPFactory *factory, CFUUIDRef typeID);
63 extern void _CFPFactoryDisable(_CFPFactory *factory);
64 extern Boolean _CFPFactoryIsEnabled(_CFPFactory *factory);
65
66 extern void _CFPFactoryFlushFunctionCache(_CFPFactory *factory);
67
68 extern void _CFPFactoryAddType(_CFPFactory *factory, CFUUIDRef typeID);
69 extern void _CFPFactoryRemoveType(_CFPFactory *factory, CFUUIDRef typeID);
70
71 extern Boolean _CFPFactorySupportsType(_CFPFactory *factory, CFUUIDRef typeID);
72 extern CFArrayRef _CFPFactoryFindForType(CFUUIDRef typeID);
73
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);
77
78 #if defined(__cplusplus)
79 }
80 #endif
81
82 #endif /* ! __COREFOUNDATION_CFPLUGIN_FACTORY__ */
83