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

Last change on this file since 396 was 142, checked in by Nicholas Riley, 21 years ago

ICeCoffEE 1.4a1

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 CFDictionaryRef serviceOptions;
29 Boolean terminalRequireOptionForSelfDrag;
30 Boolean errorSoundEnabled;
31 Boolean errorDialogEnabled;
32} iccfPrefRec;
33
34extern iccfPrefRec ICCF_prefs;
35
36extern CFBundleRef ICCF_bundle;
37
38// CF conveniences
39
40#define ICCF_CopyLocalizedString(key) \
41 CFBundleCopyLocalizedString(ICCF_bundle, (key), CFSTR(""), NULL)
42
43#define SAFE_RELEASE(e) { if (e != NULL) CFRelease(e); }
44
45// functions shared between Cocoa and Carbon implementations
46
47// returns a Pascal string containing the corresponding protocol hint (e.g. http, mailto)
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
51ConstStringPtr ICCF_GetHint(ICInstance inst, const char *urlData, Size length, long *selStart, long *selEnd, Boolean *needsSlashes);
52
53// adds two slashes to the beginning of the string in the handle (e.g. web.sabi.net or http:web.sabi.net)
54void ICCF_AddSlashes(Handle h, ConstStringPtr hint);
55
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)
59CFStringRef ICCF_CopyErrString(OSStatus err, CFStringRef context);
60
61// returns the application name, or "(unknown)" (not localized) if the application name
62// can't be determined
63CFStringRef ICCF_CopyAppName();
64
65#endif /* _H_ICeCoffEEConfig */
Note: See TracBrowser for help on using the repository browser.