]> git.saurik.com Git - apple/cf.git/blame - CFBundlePriv.h
CF-635.15.tar.gz
[apple/cf.git] / CFBundlePriv.h
CommitLineData
9ce05555 1/*
8ca704e1 2 * Copyright (c) 2011 Apple Inc. All rights reserved.
9ce05555
A
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
9ce05555
A
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 */
f64f9b69 23
9ce05555 24/* CFBundlePriv.h
8ca704e1 25 Copyright (c) 1999-2011, Apple Inc. All rights reserved.
9ce05555
A
26*/
27
28#if !defined(__COREFOUNDATION_CFBUNDLEPRIV__)
29#define __COREFOUNDATION_CFBUNDLEPRIV__ 1
30
31#include <CoreFoundation/CFBase.h>
32#include <CoreFoundation/CFArray.h>
33#include <CoreFoundation/CFBundle.h>
34#include <CoreFoundation/CFDictionary.h>
35#include <CoreFoundation/CFString.h>
36#include <CoreFoundation/CFURL.h>
37
bd5b749c 38CF_EXTERN_C_BEGIN
9ce05555
A
39
40/* Finder stuff */
41CF_EXPORT
42const CFStringRef _kCFBundlePackageTypeKey;
43CF_EXPORT
44const CFStringRef _kCFBundleSignatureKey;
45CF_EXPORT
46const CFStringRef _kCFBundleIconFileKey;
47CF_EXPORT
48const CFStringRef _kCFBundleDocumentTypesKey;
49CF_EXPORT
50const CFStringRef _kCFBundleURLTypesKey;
51
52/* Localizable Finder stuff */
53CF_EXPORT
54const CFStringRef _kCFBundleDisplayNameKey;
55CF_EXPORT
56const CFStringRef _kCFBundleShortVersionStringKey;
57CF_EXPORT
58const CFStringRef _kCFBundleGetInfoStringKey;
59CF_EXPORT
60const CFStringRef _kCFBundleGetInfoHTMLKey;
61
62/* Sub-keys for CFBundleDocumentTypes dictionaries */
63CF_EXPORT
64const CFStringRef _kCFBundleTypeNameKey;
65CF_EXPORT
66const CFStringRef _kCFBundleTypeRoleKey;
67CF_EXPORT
68const CFStringRef _kCFBundleTypeIconFileKey;
69CF_EXPORT
70const CFStringRef _kCFBundleTypeOSTypesKey;
71CF_EXPORT
72const CFStringRef _kCFBundleTypeExtensionsKey;
73CF_EXPORT
74const CFStringRef _kCFBundleTypeMIMETypesKey;
75
76/* Sub-keys for CFBundleURLTypes dictionaries */
77CF_EXPORT
78const CFStringRef _kCFBundleURLNameKey;
79CF_EXPORT
80const CFStringRef _kCFBundleURLIconFileKey;
81CF_EXPORT
82const CFStringRef _kCFBundleURLSchemesKey;
83
84/* Compatibility key names */
85CF_EXPORT
86const CFStringRef _kCFBundleOldExecutableKey;
87CF_EXPORT
88const CFStringRef _kCFBundleOldInfoDictionaryVersionKey;
89CF_EXPORT
90const CFStringRef _kCFBundleOldNameKey;
91CF_EXPORT
92const CFStringRef _kCFBundleOldIconFileKey;
93CF_EXPORT
94const CFStringRef _kCFBundleOldDocumentTypesKey;
95CF_EXPORT
96const CFStringRef _kCFBundleOldShortVersionStringKey;
97
98/* Compatibility CFBundleDocumentTypes key names */
99CF_EXPORT
100const CFStringRef _kCFBundleOldTypeNameKey;
101CF_EXPORT
102const CFStringRef _kCFBundleOldTypeRoleKey;
103CF_EXPORT
104const CFStringRef _kCFBundleOldTypeIconFileKey;
105CF_EXPORT
106const CFStringRef _kCFBundleOldTypeExtensions1Key;
107CF_EXPORT
108const CFStringRef _kCFBundleOldTypeExtensions2Key;
109CF_EXPORT
110const CFStringRef _kCFBundleOldTypeOSTypesKey;
111
cf7d2af9
A
112/* For platform specification */
113CF_EXPORT
114const CFStringRef _kCFBundleSupportedPlatformsKey;
115
116/* For Code Signing */
117CF_EXPORT
118const CFStringRef _kCFBundleResourceSpecificationKey;
119
9ce05555
A
120
121/* Functions for examining directories that may "look like" bundles */
122
123CF_EXPORT
124CFURLRef _CFBundleCopyBundleURLForExecutableURL(CFURLRef url);
125
126CF_EXPORT
127Boolean _CFBundleURLLooksLikeBundle(CFURLRef url);
128
129CF_EXPORT
130CFBundleRef _CFBundleCreateIfLooksLikeBundle(CFAllocatorRef allocator, CFURLRef url);
131
132CF_EXPORT
133CFBundleRef _CFBundleGetMainBundleIfLooksLikeBundle(void);
134
bd5b749c
A
135CF_EXPORT
136Boolean _CFBundleMainBundleInfoDictionaryComesFromResourceFork(void);
137
9ce05555
A
138CF_EXPORT
139CFBundleRef _CFBundleCreateWithExecutableURLIfLooksLikeBundle(CFAllocatorRef allocator, CFURLRef url);
140
d8925383
A
141CF_EXPORT
142CFURLRef _CFBundleCopyMainBundleExecutableURL(Boolean *looksLikeBundle);
9ce05555 143
bd5b749c
A
144CF_EXPORT
145CFBundleRef _CFBundleGetExistingBundleWithBundleURL(CFURLRef bundleURL);
146
cf7d2af9
A
147CF_EXPORT
148CFArrayRef _CFBundleGetSupportedPlatforms(CFBundleRef bundle);
149
150CF_EXPORT
151CFStringRef _CFBundleGetCurrentPlatform(void);
152
153
154/* For Code Signing */
155
156CF_EXPORT
157CFBundleRef _CFBundleCreateIfMightBeBundle(CFAllocatorRef allocator, CFURLRef url);
158
159CF_EXPORT
160CFBundleRef _CFBundleCreateWithExecutableURLIfMightBeBundle(CFAllocatorRef allocator, CFURLRef url);
161
162
9ce05555
A
163/* Functions for examining the structure of a bundle */
164
165CF_EXPORT
166CFURLRef _CFBundleCopyResourceForkURL(CFBundleRef bundle);
167
168CF_EXPORT
169CFURLRef _CFBundleCopyInfoPlistURL(CFBundleRef bundle);
170
171
172/* Functions for working without a bundle instance */
173
174CF_EXPORT
175CFURLRef _CFBundleCopyExecutableURLInDirectory(CFURLRef url);
176
177CF_EXPORT
178CFURLRef _CFBundleCopyOtherExecutableURLInDirectory(CFURLRef url);
179
180
181/* Functions for dealing with localizations */
182
183CF_EXPORT
184void _CFBundleGetLanguageAndRegionCodes(SInt32 *languageCode, SInt32 *regionCode);
185// may return -1 for either one if no code can be found
186
187CF_EXPORT
188Boolean CFBundleGetLocalizationInfoForLocalization(CFStringRef localizationName, SInt32 *languageCode, SInt32 *regionCode, SInt32 *scriptCode, CFStringEncoding *stringEncoding);
189 /* Gets the appropriate language and region codes, and the default */
190 /* script code and encoding, for the localization specified. */
191 /* Pass NULL for the localizationName to get these values for the */
192 /* single most preferred localization in the current context. */
193 /* May give -1 if there is no language or region code for a particular */
194 /* localization. Returns false if CFBundle has no information about */
195 /* the given localization. */
196
197CF_EXPORT
198CFStringRef CFBundleCopyLocalizationForLocalizationInfo(SInt32 languageCode, SInt32 regionCode, SInt32 scriptCode, CFStringEncoding stringEncoding);
199 /* Returns the default localization for the combination of codes */
200 /* specified. Pass in -1 for language, region code, or script code, or */
201 /* 0xFFFF for stringEncoding, if you do not wish to specify one of these. */
202
203CF_EXPORT
204void _CFBundleSetDefaultLocalization(CFStringRef localizationName);
205
206
207/* Functions for dealing specifically with CFM executables */
208
209CF_EXPORT
210void *_CFBundleGetCFMFunctionPointerForName(CFBundleRef bundle, CFStringRef funcName);
211
212CF_EXPORT
213void _CFBundleGetCFMFunctionPointersForNames(CFBundleRef bundle, CFArrayRef functionNames, void *ftbl[]);
214
215CF_EXPORT
216void _CFBundleSetCFMConnectionID(CFBundleRef bundle, void *connectionID);
217
218
219/* Miscellaneous functions */
220
221CF_EXPORT
222CFStringRef _CFBundleCopyFileTypeForFileURL(CFURLRef url);
223
d8925383
A
224CF_EXPORT
225CFStringRef _CFBundleCopyFileTypeForFileData(CFDataRef data);
226
9ce05555
A
227CF_EXPORT
228Boolean _CFBundleGetHasChanged(CFBundleRef bundle);
229
230CF_EXPORT
231void _CFBundleFlushCaches(void);
232
d8925383
A
233CF_EXPORT
234void _CFBundleFlushCachesForURL(CFURLRef url);
235
bd5b749c
A
236CF_EXPORT
237void _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
238
8ca704e1
A
239CF_EXPORT
240CFArrayRef _CFBundleCopyAllBundles(void); // Pending publication, the only known client of this is PowerBox. Email david_smith@apple.com before using this.
241
9ce05555
A
242CF_EXPORT
243void _CFBundleSetStringsFilesShared(CFBundleRef bundle, Boolean flag);
244
245CF_EXPORT
246Boolean _CFBundleGetStringsFilesShared(CFBundleRef bundle);
247
8ca704e1
A
248CF_EXPORT
249CFURLRef _CFBundleCopyFrameworkURLForExecutablePath(CFStringRef executablePath);
250
9ce05555
A
251
252/* Functions deprecated as SPI */
253
254CF_EXPORT
255CFDictionaryRef _CFBundleGetLocalInfoDictionary(CFBundleRef bundle); // deprecated in favor of CFBundleGetLocalInfoDictionary
256
257CF_EXPORT
258CFPropertyListRef _CFBundleGetValueForInfoKey(CFBundleRef bundle, CFStringRef key); // deprecated in favor of CFBundleGetValueForInfoDictionaryKey
259
260CF_EXPORT
261Boolean _CFBundleGetPackageInfoInDirectory(CFAllocatorRef alloc, CFURLRef url, UInt32 *packageType, UInt32 *packageCreator); // deprecated in favor of CFBundleGetPackageInfoInDirectory
262
263CF_EXPORT
264CFDictionaryRef _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
265
266CF_EXPORT
267CFURLRef _CFBundleCopyPrivateFrameworksURL(CFBundleRef bundle); // deprecated in favor of CFBundleCopyPrivateFrameworksURL
268
269CF_EXPORT
270CFURLRef _CFBundleCopySharedFrameworksURL(CFBundleRef bundle); // deprecated in favor of CFBundleCopySharedFrameworksURL
271
272CF_EXPORT
273CFURLRef _CFBundleCopySharedSupportURL(CFBundleRef bundle); // deprecated in favor of CFBundleCopySharedSupportURL
274
275CF_EXPORT
276CFURLRef _CFBundleCopyBuiltInPlugInsURL(CFBundleRef bundle); // deprecated in favor of CFBundleCopyBuiltInPlugInsURL
277
278CF_EXPORT
279CFArrayRef _CFBundleCopyBundleRegionsArray(CFBundleRef bundle); // deprecated in favor of CFBundleCopyBundleLocalizations
280
281CF_EXPORT
282CFURLRef _CFBundleCopyResourceURLForLanguage(CFBundleRef bundle, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName, CFStringRef language); // deprecated in favor of CFBundleCopyResourceURLForLocalization
283
284CF_EXPORT
285CFArrayRef _CFBundleCopyResourceURLsOfTypeForLanguage(CFBundleRef bundle, CFStringRef resourceType, CFStringRef subDirName, CFStringRef language); // deprecated in favor of CFBundleCopyResourceURLsOfTypeForLocalization
286
287CF_EXPORT
bd5b749c 288CFBundleRefNum _CFBundleOpenBundleResourceFork(CFBundleRef bundle); // deprecated in favor of CFBundleOpenBundleResourceMap
9ce05555
A
289
290CF_EXPORT
291void _CFBundleCloseBundleResourceFork(CFBundleRef bundle); // deprecated in favor of CFBundleCloseBundleResourceMap
292
bd5b749c 293CF_EXTERN_C_END
9ce05555
A
294
295#endif /* ! __COREFOUNDATION_CFBUNDLEPRIV__ */
296