]> git.saurik.com Git - apple/cf.git/blob - CFBundlePriv.h
CF-476.15.tar.gz
[apple/cf.git] / CFBundlePriv.h
1 /*
2 * Copyright (c) 2008 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23 /* CFBundlePriv.h
24 Copyright (c) 1999-2007, Apple Inc. All rights reserved.
25 */
26
27 #if !defined(__COREFOUNDATION_CFBUNDLEPRIV__)
28 #define __COREFOUNDATION_CFBUNDLEPRIV__ 1
29
30 #include <CoreFoundation/CFBase.h>
31 #include <CoreFoundation/CFArray.h>
32 #include <CoreFoundation/CFBundle.h>
33 #include <CoreFoundation/CFDictionary.h>
34 #include <CoreFoundation/CFString.h>
35 #include <CoreFoundation/CFURL.h>
36
37 CF_EXTERN_C_BEGIN
38
39 /* Finder stuff */
40 CF_EXPORT
41 const CFStringRef _kCFBundlePackageTypeKey;
42 CF_EXPORT
43 const CFStringRef _kCFBundleSignatureKey;
44 CF_EXPORT
45 const CFStringRef _kCFBundleIconFileKey;
46 CF_EXPORT
47 const CFStringRef _kCFBundleDocumentTypesKey;
48 CF_EXPORT
49 const CFStringRef _kCFBundleURLTypesKey;
50
51 /* Localizable Finder stuff */
52 CF_EXPORT
53 const CFStringRef _kCFBundleDisplayNameKey;
54 CF_EXPORT
55 const CFStringRef _kCFBundleShortVersionStringKey;
56 CF_EXPORT
57 const CFStringRef _kCFBundleGetInfoStringKey;
58 CF_EXPORT
59 const CFStringRef _kCFBundleGetInfoHTMLKey;
60
61 /* Sub-keys for CFBundleDocumentTypes dictionaries */
62 CF_EXPORT
63 const CFStringRef _kCFBundleTypeNameKey;
64 CF_EXPORT
65 const CFStringRef _kCFBundleTypeRoleKey;
66 CF_EXPORT
67 const CFStringRef _kCFBundleTypeIconFileKey;
68 CF_EXPORT
69 const CFStringRef _kCFBundleTypeOSTypesKey;
70 CF_EXPORT
71 const CFStringRef _kCFBundleTypeExtensionsKey;
72 CF_EXPORT
73 const CFStringRef _kCFBundleTypeMIMETypesKey;
74
75 /* Sub-keys for CFBundleURLTypes dictionaries */
76 CF_EXPORT
77 const CFStringRef _kCFBundleURLNameKey;
78 CF_EXPORT
79 const CFStringRef _kCFBundleURLIconFileKey;
80 CF_EXPORT
81 const CFStringRef _kCFBundleURLSchemesKey;
82
83 /* Compatibility key names */
84 CF_EXPORT
85 const CFStringRef _kCFBundleOldExecutableKey;
86 CF_EXPORT
87 const CFStringRef _kCFBundleOldInfoDictionaryVersionKey;
88 CF_EXPORT
89 const CFStringRef _kCFBundleOldNameKey;
90 CF_EXPORT
91 const CFStringRef _kCFBundleOldIconFileKey;
92 CF_EXPORT
93 const CFStringRef _kCFBundleOldDocumentTypesKey;
94 CF_EXPORT
95 const CFStringRef _kCFBundleOldShortVersionStringKey;
96
97 /* Compatibility CFBundleDocumentTypes key names */
98 CF_EXPORT
99 const CFStringRef _kCFBundleOldTypeNameKey;
100 CF_EXPORT
101 const CFStringRef _kCFBundleOldTypeRoleKey;
102 CF_EXPORT
103 const CFStringRef _kCFBundleOldTypeIconFileKey;
104 CF_EXPORT
105 const CFStringRef _kCFBundleOldTypeExtensions1Key;
106 CF_EXPORT
107 const CFStringRef _kCFBundleOldTypeExtensions2Key;
108 CF_EXPORT
109 const CFStringRef _kCFBundleOldTypeOSTypesKey;
110
111
112 /* Functions for examining directories that may "look like" bundles */
113
114 CF_EXPORT
115 CFURLRef _CFBundleCopyBundleURLForExecutableURL(CFURLRef url);
116
117 CF_EXPORT
118 Boolean _CFBundleURLLooksLikeBundle(CFURLRef url);
119
120 CF_EXPORT
121 CFBundleRef _CFBundleCreateIfLooksLikeBundle(CFAllocatorRef allocator, CFURLRef url);
122
123 CF_EXPORT
124 CFBundleRef _CFBundleGetMainBundleIfLooksLikeBundle(void);
125
126 CF_EXPORT
127 Boolean _CFBundleMainBundleInfoDictionaryComesFromResourceFork(void);
128
129 CF_EXPORT
130 CFBundleRef _CFBundleCreateWithExecutableURLIfLooksLikeBundle(CFAllocatorRef allocator, CFURLRef url);
131
132 CF_EXPORT
133 CFURLRef _CFBundleCopyMainBundleExecutableURL(Boolean *looksLikeBundle);
134
135 CF_EXPORT
136 CFBundleRef _CFBundleGetExistingBundleWithBundleURL(CFURLRef bundleURL);
137
138 /* Functions for examining the structure of a bundle */
139
140 CF_EXPORT
141 CFURLRef _CFBundleCopyResourceForkURL(CFBundleRef bundle);
142
143 CF_EXPORT
144 CFURLRef _CFBundleCopyInfoPlistURL(CFBundleRef bundle);
145
146
147 /* Functions for working without a bundle instance */
148
149 CF_EXPORT
150 CFURLRef _CFBundleCopyExecutableURLInDirectory(CFURLRef url);
151
152 CF_EXPORT
153 CFURLRef _CFBundleCopyOtherExecutableURLInDirectory(CFURLRef url);
154
155
156 /* Functions for dealing with localizations */
157
158 CF_EXPORT
159 void _CFBundleGetLanguageAndRegionCodes(SInt32 *languageCode, SInt32 *regionCode);
160 // may return -1 for either one if no code can be found
161
162 CF_EXPORT
163 Boolean CFBundleGetLocalizationInfoForLocalization(CFStringRef localizationName, SInt32 *languageCode, SInt32 *regionCode, SInt32 *scriptCode, CFStringEncoding *stringEncoding);
164 /* Gets the appropriate language and region codes, and the default */
165 /* script code and encoding, for the localization specified. */
166 /* Pass NULL for the localizationName to get these values for the */
167 /* single most preferred localization in the current context. */
168 /* May give -1 if there is no language or region code for a particular */
169 /* localization. Returns false if CFBundle has no information about */
170 /* the given localization. */
171
172 CF_EXPORT
173 CFStringRef CFBundleCopyLocalizationForLocalizationInfo(SInt32 languageCode, SInt32 regionCode, SInt32 scriptCode, CFStringEncoding stringEncoding);
174 /* Returns the default localization for the combination of codes */
175 /* specified. Pass in -1 for language, region code, or script code, or */
176 /* 0xFFFF for stringEncoding, if you do not wish to specify one of these. */
177
178 CF_EXPORT
179 void _CFBundleSetDefaultLocalization(CFStringRef localizationName);
180
181
182 /* Functions for dealing specifically with CFM executables */
183
184 CF_EXPORT
185 void *_CFBundleGetCFMFunctionPointerForName(CFBundleRef bundle, CFStringRef funcName);
186
187 CF_EXPORT
188 void _CFBundleGetCFMFunctionPointersForNames(CFBundleRef bundle, CFArrayRef functionNames, void *ftbl[]);
189
190 CF_EXPORT
191 void _CFBundleSetCFMConnectionID(CFBundleRef bundle, void *connectionID);
192
193
194 /* Miscellaneous functions */
195
196 CF_EXPORT
197 CFStringRef _CFBundleCopyFileTypeForFileURL(CFURLRef url);
198
199 CF_EXPORT
200 CFStringRef _CFBundleCopyFileTypeForFileData(CFDataRef data);
201
202 CF_EXPORT
203 Boolean _CFBundleGetHasChanged(CFBundleRef bundle);
204
205 CF_EXPORT
206 void _CFBundleFlushCaches(void);
207
208 CF_EXPORT
209 void _CFBundleFlushCachesForURL(CFURLRef url);
210
211 CF_EXPORT
212 void _CFBundleFlushBundleCaches(CFBundleRef bundle); // The previous two functions flush cached resource paths; this one also flushes bundle-specific caches such as the info dictionary and strings files
213
214 CF_EXPORT
215 void _CFBundleSetStringsFilesShared(CFBundleRef bundle, Boolean flag);
216
217 CF_EXPORT
218 Boolean _CFBundleGetStringsFilesShared(CFBundleRef bundle);
219
220
221 /* Functions deprecated as SPI */
222
223 CF_EXPORT
224 CFDictionaryRef _CFBundleGetLocalInfoDictionary(CFBundleRef bundle); // deprecated in favor of CFBundleGetLocalInfoDictionary
225
226 CF_EXPORT
227 CFPropertyListRef _CFBundleGetValueForInfoKey(CFBundleRef bundle, CFStringRef key); // deprecated in favor of CFBundleGetValueForInfoDictionaryKey
228
229 CF_EXPORT
230 Boolean _CFBundleGetPackageInfoInDirectory(CFAllocatorRef alloc, CFURLRef url, UInt32 *packageType, UInt32 *packageCreator); // deprecated in favor of CFBundleGetPackageInfoInDirectory
231
232 CF_EXPORT
233 CFDictionaryRef _CFBundleCopyInfoDictionaryInResourceFork(CFURLRef url); // CFBundleCopyInfoDictionaryForURL is usually preferred; for the main bundle, however, no special call is necessary, since the info dictionary will automatically be available whether the app is bundled or not
234
235 CF_EXPORT
236 CFURLRef _CFBundleCopyPrivateFrameworksURL(CFBundleRef bundle); // deprecated in favor of CFBundleCopyPrivateFrameworksURL
237
238 CF_EXPORT
239 CFURLRef _CFBundleCopySharedFrameworksURL(CFBundleRef bundle); // deprecated in favor of CFBundleCopySharedFrameworksURL
240
241 CF_EXPORT
242 CFURLRef _CFBundleCopySharedSupportURL(CFBundleRef bundle); // deprecated in favor of CFBundleCopySharedSupportURL
243
244 CF_EXPORT
245 CFURLRef _CFBundleCopyBuiltInPlugInsURL(CFBundleRef bundle); // deprecated in favor of CFBundleCopyBuiltInPlugInsURL
246
247 CF_EXPORT
248 CFArrayRef _CFBundleCopyBundleRegionsArray(CFBundleRef bundle); // deprecated in favor of CFBundleCopyBundleLocalizations
249
250 CF_EXPORT
251 CFURLRef _CFBundleCopyResourceURLForLanguage(CFBundleRef bundle, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName, CFStringRef language); // deprecated in favor of CFBundleCopyResourceURLForLocalization
252
253 CF_EXPORT
254 CFArrayRef _CFBundleCopyResourceURLsOfTypeForLanguage(CFBundleRef bundle, CFStringRef resourceType, CFStringRef subDirName, CFStringRef language); // deprecated in favor of CFBundleCopyResourceURLsOfTypeForLocalization
255
256 CF_EXPORT
257 CFBundleRefNum _CFBundleOpenBundleResourceFork(CFBundleRef bundle); // deprecated in favor of CFBundleOpenBundleResourceMap
258
259 CF_EXPORT
260 void _CFBundleCloseBundleResourceFork(CFBundleRef bundle); // deprecated in favor of CFBundleCloseBundleResourceMap
261
262 CF_EXTERN_C_END
263
264 #endif /* ! __COREFOUNDATION_CFBUNDLEPRIV__ */
265