//
//  GSProgressWindowController.h
//  Glyphs 4
//
//  Created by Florian Pircher on 24.03.23.
//  Copyright © 2023 schriftgestaltung.de. All rights reserved.
//

NS_ASSUME_NONNULL_BEGIN

@interface GSProgressWindowController : NSWindowController

@property (weak) IBOutlet NSButton *cancelButton;
@property (class, readonly, nonatomic) GSProgressWindowController *shared;
@property (readonly, nonatomic) NSUInteger countOfActiveTasks;

/// Begins tracking a new task. Returns an opaque object that can be used to stop tracking the task.
///
/// Each call to `-addTaskWithTitle:` must be matched by a call to `-stopTask:` with the object returned by this method.
- (id)addTaskWithTitle:(NSString *)title;
/// Stops tracking a task.
///
/// Calling this method repeatedly with the same `taskToken` object will crash.
///
/// - Parameter taskToken: The opaque object returned by `-addTaskWithTitle:`.
- (void)stopTask:(id)taskToken;
@end

NS_ASSUME_NONNULL_END
