//
//  GSGlyphEditView+NSText.h
//  GlyphsApp
//
//  Created by Georg Seifert on 27.02.26.
//  Copyright © 2026 schriftgestaltung.de. All rights reserved.
//

#import <GlyphsApp/GlyphsApp.h>

NS_ASSUME_NONNULL_BEGIN

@interface GSGlyphEditView (NSText) <NSTextInputClient>


/// The selection range in characters as in the original string.
/// Just like the `markedRange` property, its location contains the character index from the text beginning.
/// @note In `NSTextInputClient`, this is readonly.
@property (nonatomic) NSRange selectedRange;

@property (nonatomic, strong) GSTextStorage *textStorage;
@property (nonatomic, strong, nullable) GSLayoutManager *layoutManager;

@property (strong, nonatomic) NSDictionary *currentAttributes;
@property (strong, nonatomic, nullable) NSMutableAttributedString *markedText;


// TODO: Should use setMarkedText:selectedRange:replacementRange: from NSTextInputClient instead
- (void)setMarkedText:(id)aString selectedRange:(NSRange)selRange;

@property (nonatomic, readonly) NSRange markedRange;

- (void)unmarkText;

@end

NS_ASSUME_NONNULL_END
