1 | //␊ |
2 | // PreferencesControllerBase.h␊ |
3 | // ChameleonPrefPane␊ |
4 | //␊ |
5 | // Created by Rekursor on 1/22/10.␊ |
6 | //␊ |
7 | ␊ |
8 | #import <Cocoa/Cocoa.h>␊ |
9 | #import <ChameleonPrefPane.h>␊ |
10 | #import "string_util.h"␊ |
11 | #import "BootPropertyList.h"␊ |
12 | #import <ShellProcess.h>␊ |
13 | ␊ |
14 | ␊ |
15 | //--------------------------------------------------------------------------␊ |
16 | const char * const kKernelFlags = "Kernel Flags";␊ |
17 | ␊ |
18 | //--------------------------------------------------------------------------␊ |
19 | typedef enum GroupAction␊ |
20 | {␊ |
21 | ␉SetDefaultValues,␊ |
22 | ␉RefreshLockStates,␊ |
23 | ␉LoadPreferencesOptions,␊ |
24 | ␉LoadBootConfigOptions,␊ |
25 | ␉AddOptionsDesc,␊ |
26 | ␉SaveBootConfigOptions␊ |
27 | };␊ |
28 | ␊ |
29 | ␊ |
30 | // ENHANCE ME: remove this globals and integrate them in ChameleonPrefPane or at least ␊ |
31 | // add function accessor entry points␊ |
32 | extern PartitionExtractor * partExtractor;␊ |
33 | extern BootPropertyList * prop;␊ |
34 | ␊ |
35 | // Defintion of the required protocol for any derived classes of PreferencesControllerBase␊ |
36 | @protocol PreferenceController␊ |
37 | ␊ |
38 | @required␊ |
39 | // must be implemented in all derived classes␊ |
40 | ␊ |
41 | // Called by all buttons of each group in therface␊ |
42 | - (IBAction) onCheckButtonChange: (NSButton*) sender;␊ |
43 | ␊ |
44 | // Called by all text fields of each group in therface␊ |
45 | - (IBAction) onTextFiedChange: (NSTextField*) sender;␊ |
46 | ␊ |
47 | // Add the boot config options descriptors to the consolidated dictionary␊ |
48 | - (void) addOptionsDesc;␊ |
49 | ␊ |
50 | // Set refresh all group states {enabled | disabled} depending on the authorizations state␊ |
51 | - (void) refreshLockStates;␊ |
52 | ␊ |
53 | // load the corresponding pref filer options from the interface␊ |
54 | - (void) loadOptionsFromPreferencesFile: (NSMutableDictionary*) dict;␊ |
55 | ␊ |
56 | @end␊ |
57 | ␊ |
58 | // Define common expected behavior for all derived controllers␊ |
59 | @interface PreferencesControllerBase : NSObject ␊ |
60 | {␊ |
61 | }␊ |
62 | ␊ |
63 | // from the id to desc map in prop, set all default values for dict␊ |
64 | + (void) setDefaultValues: (NSMutableDictionary*) dict; ␊ |
65 | ␊ |
66 | // Register the Group panel for further automatic iteration matters␊ |
67 | + (void) registerPreferencesGroup:(id) myGroup;␊ |
68 | ␊ |
69 | // Iterate and execute action for each register group␊ |
70 | + (void) doForEachGroup: (GroupAction) action withOption:(id) option;␊ |
71 | ␊ |
72 | // Set refresh state {enabled | disabled} depending on the authorizations state␊ |
73 | - (void) refreshLockState: (id) item;␊ |
74 | ␊ |
75 | // Unitary Method for Load One option of any type␊ |
76 | + (void) loadOptionsFromBootFile;␊ |
77 | ␊ |
78 | // Method for loading all registred options components in the interface␊ |
79 | + (void) loadOptionFromBootFile:(id) optionID;␊ |
80 | ␊ |
81 | - (void) loadPreferences;␊ |
82 | - (bool) savePreferences;␊ |
83 | ␊ |
84 | - (bool) handleSender: (id) sender;␊ |
85 | ␊ |
86 | -(NSMutableDictionary*) preferencesFile;␊ |
87 | -(NSMutableDictionary*) preferencesParts;␊ |
88 | ␊ |
89 | -(ChameleonPrefPane*) chameleon;␊ |
90 | ␊ |
91 | @end␊ |
92 | |