source: trunk/ICeCoffEE/ICeCoffEE/ICeCoffEEConfig.h@ 139

Last change on this file since 139 was 139, checked in by Nicholas Riley, 21 years ago
File size: 2.1 KB
Line 
1/*
2 * ICeCoffEEConfig.h
3 * ICeCoffEE APE
4 *
5 * Created by Nicholas Riley on Sun Jan 26 2003.
6 * Copyright (c) 2003 Nicholas Riley. All rights reserved.
7 *
8 */
9
10#ifndef _H_ICeCoffEEConfig
11#define _H_ICeCoffEEConfig
12
13#include <CoreFoundation/CoreFoundation.h>
14#include "ICeCoffEEAction.h"
15
16// constants
17extern const long ICCF_MAX_URL_LEN;
18
19// per-app runtime configuration
20extern Boolean ICCF_enabled;
21
22typedef struct {
23 Boolean commandClickEnabled;
24 Boolean textBlinkEnabled;
25 CFIndex textBlinkCount; // ICeTEe used LMGetMenuFlash, no replacement in Carbon
26 Boolean servicesInContextualMenu;
27 Boolean servicesInMenuBar;
28 Boolean errorSoundEnabled;
29 Boolean errorDialogEnabled;
30} iccfPrefRec;
31
32extern iccfPrefRec ICCF_prefs;
33
34extern CFBundleRef ICCF_bundle;
35
36// CF conveniences
37
38#define ICCF_CopyLocalizedString(key) \
39 CFBundleCopyLocalizedString(ICCF_bundle, (key), CFSTR(""), NULL)
40
41#define SAFE_RELEASE(e) { if (e != NULL) CFRelease(e); }
42
43// functions shared between Cocoa and Carbon implementations
44
45// returns a Pascal string containing the corresponding protocol hint (e.g. http, mailto)
46// if the text surrounding the range *selStart to *selEnd in urlData likely represents
47// an email address or "slack" (e.g. web.sabi.net/bm) URL
48// needsSlashes is set to true if the URL needs a '//' after the colon to be valid
49ConstStringPtr ICCF_GetHint(ICInstance inst, const char *urlData, Size length, long *selStart, long *selEnd, Boolean *needsSlashes);
50
51// adds two slashes to the beginning of the string in the handle (e.g. web.sabi.net or http:web.sabi.net)
52void ICCF_AddSlashes(Handle h, ConstStringPtr hint);
53
54// returns an explanation for the provided OSStatus in the supplied context
55// (Cocoa clients should use ICCF_ErrString instead - it's simpler to use)
56// if NULL is returned, the error is harmless (e.g., user cancelled)
57CFStringRef ICCF_CopyErrString(OSStatus err, CFStringRef context);
58
59// returns the application name, or "(unknown)" (not localized) if the application name
60// can't be determined
61CFStringRef ICCF_CopyAppName();
62
63#endif /* _H_ICeCoffEEConfig */
Note: See TracBrowser for help on using the repository browser.