//
//  GSHandle.h
//  GlyphsCore
//
//  Created by Georg Seifert on 22.09.11.
//  Copyright 2011 schriftgestaltung.de. All rights reserved.
//

#import <GlyphsCore/GSElement.h>
#import <GlyphsCore/GSSelectableElementProtocol.h>
#import <GlyphsCore/GSGeometryHelpers.h>

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(int, GSHandleFlag) {
	GSHandleFlagTopLeft = GSTopLeft,
	GSHandleFlagTopCenter = GSTopCenter,
	GSHandleFlagTopRight = GSTopRight,
	GSHandleFlagCenterLeft = GSCenterLeft,
	GSHandleFlagCenterCenter = GSCenterCenter,
	GSHandleFlagCenterRight = GSCenterRight,
	GSHandleFlagBottomLeft = GSBottomLeft,
	GSHandleFlagBottomCenter = GSBottomCenter,
	GSHandleFlagBottomRight = GSBottomRight,
	GSHandleFlagNone = GSAlignmentNone,

	GSHandleFlagIntersection = 1000,
	GSHandleFlagLSB = 1001,
	GSHandleFlagRSB = 1002,
	GSHandleFlagInflection = 1003,
	GSHandleFlagStrokeOut = 1004,
	GSHandleFlagStrokeIn = 1005,

	GSHandleFlagSmartAnchor = 2001,
#ifndef GLYPHS_LITE
	GSHandleFlagPenPoint = 123,
#endif
};

@interface GSHandle : NSObject <GSSelectableElementProtocol>

@property (weak, nullable) GSContainer *parent;
@property (nonatomic, assign) GSHandleFlag flag;
@property (nonatomic, strong, nullable) NSCursor *cursor;
@property (nonatomic, strong, nullable) id object;
@property (nonatomic, assign) NSPoint position;

@property (nonatomic, readonly) BOOL canAttachHint;
@property (nonatomic, readonly) BOOL canAttachCorner;

@end

NS_ASSUME_NONNULL_END
