//
//  MSInkApplication.h
//  inkBook
//
//  Created by Raleigh Ledet on Sat Sep 06 2003.
//  Copyright (c) 2003-2007 Mage Software. All rights reserved.
//

/*************** I M P O R T A N T ***********************/
// Any applicaiton that uses the MSInk.framework must set
// their target's "Principal Class" to MSInkApplication or
// a subclass there of.
/*************** I M P O R T A N T ***********************/

#import <AppKit/NSApplication.h>
#import <Carbon/Carbon.h>

// This was added to Tiger, but didn't get added to the header file.
#ifndef kInkWriteWithUserSettingsInApp
#define kInkWriteWithUserSettingsInApp 'user'
#endif

// Apple's Ink evnts are not native to Cocoa. This class makes up for that deficiency.
// Also be sure to read MSInkEvents.h and MSInkResponder.h
@interface MSInkApplication : NSApplication
{
	EventHandlerRef  mInkHandlerRef;
	NSDictionary	*_currentPoximity;
}

// Returns a string containing the version of the MSInk Framework
// It might be useful to use this in an about box for support purposes.
+(NSString*)MSInkFrameworkVersion;

// Does the user have Ink turned on in the Ink System Preferences? If this returns NO, then you may consider asking the user to turn it on.
// This applescript will open the Ink system preference pane for the user:
// tell app "System Preferences"
//    activate
//    set current pane to pane "com.apple.preference.ink"
// end tell
-(BOOL)isInkwellOn;

// Turn off the application level ink event carbon handlers.
- (void)disableInkEventHandlers;

// Turn on the applicaiton level ink event carbon handlers
- (void)enableInkEventHandlers;

// Ink carbon events care about the return value. MSInkApplicaiton routes both the Carbon and Cocoa events through this method.
- (OSErr)returnErrorFromSendingEvent:(NSEvent *)theEvent;

// As per Wacom's guidance, the tablet proximity events are caught at the app level and a notification (kProximityNotification) is sent out so that all objects that care know what is going on with the pen.
// But you can get the current proximity with this method. See TabletEvents.h for more info.
- (NSDictionary*)currentProximityDictionary;

// Internal routine to handle the proximity event. You should never call this directly.
- (void)handleProximityEvent:(NSEvent *)theEvent;
@end
