blob: d7dc1efbf31bdabb0df70499cf4dfbd288523313 (
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
67
68
69
70
71
72
73
74
|
/* HBPresets.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 <Cocoa/Cocoa.h>
@class HBPreset;
/**
* HBPresetManager
* Manages the load/save of presets to an in memory tree.
*/
@interface HBPresetsManager : NSObject
/**
* The root array of presets.
*/
@property (nonatomic, readonly, retain) NSMutableArray *contents;
/**
* defaultPreset and its index path in the tree
*/
@property (nonatomic, readwrite, retain) HBPreset *defaultPreset;
/**
* Returs a HBPresetManager with the presets loaded at the passed URL.
*
* @param url the URL of the presets file to load.
*
* @return the initialized presets manager.
*/
- (instancetype)initWithURL:(NSURL *)url;
/**
* Checks the version number of the builtin presets.
*
* @return YES if the builtin presets are out of date.
*/
- (BOOL)checkBuiltInsForUpdates;
/**
* Saves the presets to disk.
*/
- (BOOL)savePresets;
/**
* Adds a given preset to the manager.
*
* @param preset the preset dict.
*/
- (void)addPreset:(NSDictionary *)preset;
/**
* Deletes the presets at the specified index path.
*
* @param idx the NSIndexPath of the preset to delete.
*/
- (void)deletePresetAtIndexPath:(NSIndexPath *)idx;
/**
* Returns the index path of the specified object.
*
* @param preset the preset.
*
* @return The index path whose corresponding value is equal to the preset. Returns nil if not found.
*/
- (NSIndexPath *)indexPathOfPreset:(HBPreset *)preset;
- (void)generateBuiltInPresets;
- (void)deleteBuiltInPresets;
@end
|