//
//  GlyphsFilterPluginProtocol.h
//  GlyphsApp
//
//  Created by Georg Seifert on 08.05.09.
//  Copyright 2009 schriftgestaltung.de. All rights reserved.
//

@class GSLayer;
@class GSFont;
@class GSFontMaster;
@class GSDialogController;
@class GSInstance;
@class GSGlyph;
@class GSFontMaster;

#ifndef NS_SWIFT_NONISOLATED
#define NS_SWIFT_NONISOLATED
#endif

@class GSGlyphViewController;

/** The protocol defining the filter plugin interface */
NS_SWIFT_UI_ACTOR
@protocol GlyphsFilterPlugin
/** The interface version.*/
@property (nonatomic, readonly) NSUInteger interfaceVersion NS_SWIFT_NONISOLATED;
/** The title of the plugin.*/
@property (nonatomic, readonly) NSString *title;
/** The keyEquivalent to select the Filter.*/
@property (nonatomic, readonly) NSString *keyEquivalent;

#ifndef LIBCORE
/** the Controller of type GSEditViewController */
@property (nonatomic, unsafe_unretained) GSGlyphViewController *controller;
#endif

@optional

/// do main initializations
- (void)loadPlugin NS_SWIFT_NONISOLATED;

@property (strong) IBOutlet NSView *view;

/// is set, if the user chose "run last Filter". Then it should keep the settings from the last run.
@property (nonatomic) BOOL rerun;

/// The title of the filter dialog.
@property (nonatomic, readonly) NSString *dialogTitle;

/// the returned value will be placed as the title of the "OK" button in the filter dialog.
- (NSString *)actionName;

/** this can be used to control the sorting of the filters in the menu.

 dont implement this method or return nil, if you like the menu item be sorted alphabetically
 */
- (NSString *)menuSortKey;

/// Implement this to enable the
- (NSString *)customParameterString;

/** Implement it if you need to supply your own window.

 @return a GSDialogController that controls the window
 */
- (GSDialogController *)makeWindowController;

/// do update the window
- (void)setupDialog:(GSDialogController *)dialog;

/**
 Return NO, if the plugin should not be added to the Filter menu.

 If not implemented, it defaults to YES.
 */
- (BOOL)needsMenuEntry;

- (void)setupWithArguments:(NSArray *)arguments;

- (IBAction)runFilterActionAlternate:(id)sender;

/** The title of the plugin.*/
@property (nonatomic, readonly) NSString *titleAlternate;

@end

