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