diff options
author | ritsuka <[email protected]> | 2014-08-07 13:54:14 +0000 |
---|---|---|
committer | ritsuka <[email protected]> | 2014-08-07 13:54:14 +0000 |
commit | 1d7ed1a09e7796b672175d50bc8491b29c22ad96 (patch) | |
tree | 59ea3a867f42733a595853de4a4d915cd57673b4 /macosx/HBPreset.h | |
parent | 91b032d618bf897200f3e50e52e97fe94d7c5623 (diff) |
MacGui: improved the presets management
Added a class to manage the presets (HBPresetsManager) and moved the presets drawer code to a new view controller (HBPresetsViewController).
Removed the limitation of two nested folders and added a way to add to custom folders.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6273 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBPreset.h')
-rw-r--r-- | macosx/HBPreset.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/macosx/HBPreset.h b/macosx/HBPreset.h new file mode 100644 index 000000000..1c2fe22d3 --- /dev/null +++ b/macosx/HBPreset.h @@ -0,0 +1,39 @@ +// +// HBBaseNode.h +// PresetsView +// +// Created by Damiano Galassi on 14/07/14. +// Copyright (c) 2014 Damiano Galassi. All rights reserved. +// + +#import <Cocoa/Cocoa.h> + +/** + * HBPreset + * Stores a preset dictionary + * and implements the requited methods to work with a NSTreeController. + */ +@interface HBPreset : NSObject <NSCopying> + +- (instancetype)initWithName:(NSString *)title content:(NSDictionary *)content builtIn:(BOOL)builtIn; +- (instancetype)initWithFolderName:(NSString *)title builtIn:(BOOL)builtIn; + +@property (nonatomic, copy) NSString *name; +@property (nonatomic, readwrite, retain) NSString *presetDescription; +@property (nonatomic, retain) NSDictionary *content; + +@property (nonatomic, readwrite) BOOL isDefault; +@property (nonatomic, readonly) BOOL isBuiltIn; + +// NSTreeController required properties +@property (nonatomic, retain) NSMutableArray *children; +@property (nonatomic) BOOL isLeaf; + +/** + * Executes a given block using each object in the tree, starting with the root object and continuing through the tree to the last object. + * + * @param block The block to apply to elements in the tree. + */ +- (void)enumerateObjectsUsingBlock:(void (^)(id obj, NSIndexPath *idx, BOOL *stop))block; + +@end |