//
//  GSElement.h
//  GlyphsCore
//
//  Created by Georg Seifert on 10.04.09.
//  Copyright 2009 schriftgestaltung.de. All rights reserved.
//

#import <GlyphsCore/GSBase.h>
#import <GlyphsCore/GSBaseObject.h>

NS_ASSUME_NONNULL_BEGIN

@class GSLayer;

/** GSElement: The base class for Layer elements.

 The base class for Layer elements.
 */

@interface GSElement : GSBaseObject

#ifndef GLYPHS_VIEWER
- (void)setPropertyListValue:(NSDictionary *)dict format:(GSFormatVersion)format;

- (nullable NSDictionary *)propertyListValueFormat:(GSFormatVersion)formatVersion error:(out NSError **)error;

- (BOOL)propertyListToData:(CFMutableDataRef)data format:(GSFormatVersion)formatVersion error:(out NSError **)error;
#endif

/**
 Inits with a dict.

 @param dict The property list representation
 @param formatVersion The file format version
 @return a element object
 */
- (instancetype)initWithDict:(NSDictionary *)dict format:(GSFormatVersion)formatVersion;

#ifndef GLYPHS_VIEWER
- (NSString *)elementString;
#endif

#ifndef GLYPHS_VIEWER
- (NSRect)getHandleRect:(NSPoint)pt scale:(CGFloat)scale;

- (BOOL)hitTest:(NSPoint)aPoint tolerance:(CGFloat)tolerance;

- (void)transform:(NSAffineTransform *)transform;
#endif

@end
NS_ASSUME_NONNULL_END
