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