blob: 005b52c02a1a1b8e58ae15590b706bd2926e07d9 [file] [log] [blame]
Alexandre Lision83180df2016-01-18 11:32:20 -05001//
2// INDSequentialTextSelectionManager.h
3// INDSequentialTextSelectionManager
4//
5// Created by Indragie Karunaratne on 2014-03-02.
6// Copyright (c) 2014 Indragie Karunaratne. All rights reserved.
7//
8#import <Cocoa/Cocoa.h>
9#import <Foundation/Foundation.h>
10
11typedef NSAttributedString * (^INDAttributedTextTransformationBlock)(NSAttributedString *);
12
13/**
14 * Coordinates sequential text selection among an arbitrary set of `NSTextView`s
15 */
16@interface INDSequentialTextSelectionManager : NSResponder
17
18/**
19 * Registers a text view to participate in sequential selection.
20 *
21 * @param textView The `NSTextView` instance to register.
22 * @param identifier The unique identifier to associate with the text view instance.
23 */
24- (void)registerTextView:(NSTextView *)textView withUniqueIdentifier:(NSString *)identifier;
25
26/**
27 * Registers a text view to participate in sequential selection.
28 *
29 * @param textView The `NSTextView` instance to register.
30 * @param identifier The unique identifier to associate with the text view instance.
31 * @param block A transformation block to apply to the contents of the text view
32 * before copying the text.
33 */
34- (void)registerTextView:(NSTextView *)textView withUniqueIdentifier:(NSString *)identifier transformationBlock:(INDAttributedTextTransformationBlock)block;
35
36/**
37 * Unregisters a text view for sequential text selection.
38 *
39 * @param textView The text view to unregister.
40 */
41- (void)unregisterTextView:(NSTextView *)textView;
42
43/**
44 * Unregisters all text views.
45 */
46- (void)unregisterAllTextViews;
47
48@end