/* * ICeCoffEEConfig.h * ICeCoffEE APE * * Created by Nicholas Riley on Sun Jan 26 2003. * Copyright (c) 2003 Nicholas Riley. All rights reserved. * */ #ifndef _H_ICeCoffEEConfig #define _H_ICeCoffEEConfig #include #include "ICeCoffEEAction.h" // constants extern const long ICCF_MAX_URL_LEN; // per-app runtime configuration extern Boolean ICCF_enabled; typedef struct { Boolean commandClickEnabled; Boolean textBlinkEnabled; CFIndex textBlinkCount; // ICeTEe used LMGetMenuFlash, no replacement in Carbon Boolean servicesInContextualMenu; Boolean servicesInMenuBar; CFDictionaryRef serviceOptions; Boolean terminalRequireOptionForSelfDrag; Boolean errorSoundEnabled; Boolean errorDialogEnabled; } iccfPrefRec; extern iccfPrefRec ICCF_prefs; extern CFBundleRef ICCF_bundle; // CF conveniences #define ICCF_CopyLocalizedString(key) \ CFBundleCopyLocalizedString(ICCF_bundle, (key), CFSTR(""), NULL) #define SAFE_RELEASE(e) { if (e != NULL) CFRelease(e); } // functions shared between Cocoa and Carbon implementations // returns a Pascal string containing the corresponding protocol hint (e.g. http, mailto) // if the text surrounding the range *selStart to *selEnd in urlData likely represents // an email address or "slack" (e.g. web.sabi.net/bm) URL // needsSlashes is set to true if the URL needs a '//' after the colon to be valid ConstStringPtr ICCF_GetHint(ICInstance inst, const char *urlData, Size length, long *selStart, long *selEnd, Boolean *needsSlashes); // adds two slashes to the beginning of the string in the handle (e.g. web.sabi.net or http:web.sabi.net) void ICCF_AddSlashes(Handle h, ConstStringPtr hint); // returns an explanation for the provided OSStatus in the supplied context // (Cocoa clients should use ICCF_ErrString instead - it's simpler to use) // if NULL is returned, the error is harmless (e.g., user cancelled) CFStringRef ICCF_CopyErrString(OSStatus err, CFStringRef context); // returns the application name, or "(unknown)" (not localized) if the application name // can't be determined CFStringRef ICCF_CopyAppName(); #endif /* _H_ICeCoffEEConfig */