[74] | 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 |
|
---|
| 15 | // constants
|
---|
| 16 | extern const long ICCF_MAX_URL_LEN;
|
---|
| 17 |
|
---|
| 18 | // per-app runtime configuration
|
---|
| 19 | extern Boolean ICCF_enabled;
|
---|
| 20 |
|
---|
| 21 | typedef struct {
|
---|
| 22 | Boolean commandClickEnabled;
|
---|
| 23 | Boolean textBlinkEnabled;
|
---|
| 24 | CFIndex textBlinkCount; // ICeTEe used LMGetMenuFlash, no replacement in Carbon
|
---|
| 25 | Boolean servicesInContextualMenu;
|
---|
| 26 | Boolean servicesInMenuBar;
|
---|
| 27 | Boolean errorSoundEnabled;
|
---|
| 28 | Boolean errorDialogEnabled;
|
---|
| 29 | } iccfPrefRec;
|
---|
| 30 |
|
---|
| 31 | extern iccfPrefRec ICCF_prefs;
|
---|
| 32 |
|
---|
| 33 | extern CFBundleRef ICCF_bundle;
|
---|
| 34 |
|
---|
[75] | 35 | // CF conveniences
|
---|
| 36 |
|
---|
[74] | 37 | #define ICCF_CopyLocalizedString(key) \
|
---|
| 38 | CFBundleCopyLocalizedString(ICCF_bundle, (key), CFSTR(""), NULL)
|
---|
| 39 |
|
---|
[75] | 40 | #define SAFE_RELEASE(e) { if (e != NULL) CFRelease(e); }
|
---|
| 41 |
|
---|
[74] | 42 | // functions shared between Cocoa and Carbon implementations
|
---|
| 43 |
|
---|
| 44 | // returns a Pascal string containing the corresponding protocol hint (e.g. http, mailto)
|
---|
[79] | 45 | // if the text surrounding the range *selStart to *selEnd in urlData likely represents
|
---|
| 46 | // an email address or "slack" (e.g. web.sabi.net/bm) URL
|
---|
| 47 | // needsSlashes is set to true if the URL needs a '//' after the colon to be valid
|
---|
| 48 | ConstStringPtr ICCF_GetHint(ICInstance inst, const char *urlData, Size length, long *selStart, long *selEnd, Boolean *needsSlashes);
|
---|
[74] | 49 |
|
---|
[79] | 50 | // adds two slashes to the beginning of the string in the handle (e.g. web.sabi.net or http:web.sabi.net)
|
---|
| 51 | void ICCF_AddSlashes(Handle h, ConstStringPtr hint);
|
---|
| 52 |
|
---|
[74] | 53 | // returns an explanation for the provided OSStatus in the supplied context
|
---|
| 54 | // (Cocoa clients should use ICCF_ErrString instead - it's simpler to use)
|
---|
| 55 | // if NULL is returned, the error is harmless (e.g., user cancelled)
|
---|
| 56 | CFStringRef ICCF_CopyErrString(OSStatus err, CFStringRef context);
|
---|
| 57 |
|
---|
| 58 | #endif /* _H_ICeCoffEEConfig */ |
---|