//
//  MSInkData.h
//  MSInkFramework
//
//  Created by Raleigh Ledet on Sun Aug 10 2003.
//  Copyright (c) 2003-2007 Mage Software. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <Carbon/Carbon.h>

extern NSString *kMSInkDataObject;
extern NSString *kMSInkDataLocPoints;
extern NSString *kMSInkDataTabletPoints;

// This is the raw Ink data. Just ink data here. Actually, just a C array of NSPoints and another matching C array of TabletPointerRecs.
// TabletPointerRec entries with zero pressure indicate the end of a stroke.
@interface MSInkData : NSObject <NSCopying, NSMutableCopying>
{
	UInt32				_length;
	TabletPointerRec	*_tabletPointerRecs;
	NSPoint				*_points;
}

// Number of points in the data
- (unsigned int)length;

- (NSPoint)pointAtIndex:(unsigned)index;
- (TabletPointerRec)pointerRecAtIndex:(unsigned)index;

- (void)getPoints:(NSPoint *)buffer;
- (void)getPoints:(NSPoint *)buffer range:(NSRange)aRange;
- (void)getPointerRecs:(TabletPointerRec *)buffer;
- (void)getPointerRecs:(TabletPointerRec *)buffer range:(NSRange)aRange;

- (const NSPoint*)points;
- (const TabletPointerRec*)tabletPointerRecs;

- (MSInkData *)subMSInkDataFromIndex:(unsigned)from;
- (MSInkData *)subMSInkDataToIndex:(unsigned)to;
- (MSInkData *)subMSInkDataWithRange:(NSRange)range;
- (NSRange)rangeOfStrokesInRect:(NSRect)rect;
- (NSSize) size;
- (NSRect) rectOfInkDrawing;

+ (id)inkDataWithMSInkTextRef:(InkTextRef)iTextRef;
- (id)init;
- (id)initWithMSInkTextRef:(InkTextRef)iTextRef;
- (id)initWithData:(NSData*)data;
- (NSData*)data;
@end


@interface MSMutableInkData : MSInkData
{
	UInt32  _capacity;
}

- (void)insertMSInkData:(MSInkData *)aMSInkData atIndex:(unsigned)loc;
- (void)deleteMSInkDataInRange:(NSRange)range;
- (void)appendMSInkData:(MSInkData *)aMSInkData;
- (void)appendInkPoint:(TabletPointerRec *)tabletRec atLoc:(NSPoint)loc;
- (void)setMSInkData:(MSInkData *)aMSInkData;

-(void)translatePointsBy:(NSPoint)translatePoint;
-(void)scalePointsByX:(float)x y:(float)y;
-(void)rotPointsCWByRadAngle:(double)cwAngle;

+ (id)inkDataWithCapacity:(unsigned)capacity;
- (id)initWithCapacity:(unsigned)capacity;
- (id)initWithMSInkData:(MSInkData *)aMSInkData;

@end
