//
//  GSInfoProperty.h
//  GlyphsCore
//
//  Created by Georg Seifert on 06.04.19.
//  Copyright © 2019 schriftgestaltung.de. All rights reserved.
//

#import <GlyphsCore/GSBase.h>
#import <GlyphsCore/GSContainerProtocol.h>
NS_ASSUME_NONNULL_BEGIN

@class GSCustomParameter;

@interface GSInfoProperty : NSObject <NSCopying> {
	__weak GSContainer *_parent;
	NSString *_value;

#pragma GSAutoCodeStart ivars

	GSPropertyName _key;

#pragma GSAutoCodeEnd ivars
}

@property (nonatomic, weak) GSContainer *parent;

@property (nonatomic, copy) NSString *value;

- (nullable NSString *)defaultValue;

- (instancetype)initWithKey:(GSPropertyName)key
					  value:(NSString *)value;

- (instancetype)initWithDict:(NSDictionary *)dict
					  format:(GSFormatVersion)formatVersion;

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

#ifndef GLYPHS_VIEWER
- (BOOL)saveToFile:(FILE *)file
			format:(GSFormatVersion)formatVersion
			 error:(NSError **)error;

@property (nonatomic, readonly, nullable) NSUndoManager *undoManager;

@property (nonatomic, readonly, nullable) NSUndoManager *undoManagerCheck;

- (NSSet *)legacyDefaultKeys;

- (nullable NSArray<GSCustomParameter *> *)legacyCustomParameters;

#endif

#pragma GSAutoCodeStart methods

/// The key.
@property (nonatomic, strong, nullable) NSString *key;

#pragma GSAutoCodeEnd methods

@end

NS_ASSUME_NONNULL_END
