summaryrefslogtreecommitdiffstats
path: root/macosx/HBLanguagesSelection.h
blob: 0d57fba17cddb46d80973c854518bde71e45aa62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*  HBLanguagesSelection.h $

 This file is part of the HandBrake source code.
 Homepage: <http://handbrake.fr/>.
 It may be used under the terms of the GNU General Public License. */

#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>

NS_ASSUME_NONNULL_BEGIN

/**
 *  A collection of KVO enabled model and controllers class
 *  used to populate the languages selection table view
 */

/**
 *  HBLang
 */
@interface HBLang : NSObject <NSCopying>

@property (nonatomic, readwrite) BOOL isSelected;
@property (nonatomic, readonly) NSString *language;
@property (nonatomic, readonly) NSString *iso639_2;

@property (nonatomic, readwrite, weak, nullable) NSUndoManager *undo;

- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithLanguage:(NSString *)value iso639_2code:(NSString *)code NS_DESIGNATED_INITIALIZER;

@end;

/**
 *  HBLanguagesSelection
 */
@interface HBLanguagesSelection : NSObject

@property (nonatomic, readonly) NSMutableArray<HBLang *> *languagesArray;
@property (nonatomic, readonly) NSArray<NSString *> *selectedLanguages;

@property (nonatomic, readwrite, weak, nullable) NSUndoManager *undo;

- (instancetype)initWithLanguages:(NSArray<NSString *> *)languages NS_DESIGNATED_INITIALIZER;

@end

/**
 *  HBLanguageArrayController
 */
@interface HBLanguageArrayController : NSArrayController <NSTableViewDelegate>

/**
 *  Set whether to show only the selected languages or all languages
 */
@property (nonatomic, readwrite) BOOL showSelectedOnly;

/**
 *  Set whether the user can drag the table view's elements.
 */
@property (nonatomic, readwrite) BOOL isDragginEnabled;

@property (unsafe_unretained) IBOutlet NSTableView *tableView;

@end

NS_ASSUME_NONNULL_END