Chameleon Applications

Chameleon Applications Svn Source Tree

Root/trunk/ChameleonPrefPane/Sources/PreferencesControllerBase.h

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 "ChameleonPropertyList.h"
11#import "ShellProcess.h"
12#import "string_util.h"
13#import "GroupControllerProtocol.h"
14
15
16//--------------------------------------------------------------------------
17const char * const kKernelFlags = "Kernel Flags";
18
19//--------------------------------------------------------------------------
20enum GroupAction
21{
22SetDefaultValues,
23RefreshLockStates,
24LoadPreferencesOptions,
25LoadBootConfigOptions,
26AddOptionsDesc,
27SaveBootConfigOptions
28};
29
30
31
32// ENHANCE ME: remove this globals and integrate them in ChameleonPrefPane or at least
33// add function accessor entry points
34
35// Define common expected behavior for all derived controllers
36@interface PreferencesControllerBase : NSObject
37{
38}
39
40// Register the Group panel for further automatic iteration matters
41+ (void) registerPreferencesGroup:(id) myGroup;
42
43// Iterate and execute action for each register group
44+ (void) doForEachGroup: (GroupAction) action withOption:(id) option;
45
46// Set refresh state {enabled | disabled} depending on the authorizations state
47+ (void) refreshBodLockState: (const BootOptionDesc*) bod;
48+ (void) refreshLockState: (id) item;
49
50// Unitary Method for Load One option of any type
51+ (void) loadOptionsFromBootFile;
52
53// Method for loading all registred options components in the interface
54+ (void) loadOptionFromBootFile:(id) optionID;
55
56// Get the resource in the pref pane, needed because the bundle get resource api wont work
57// as it would return the SystemPreferences application resource
58- (id) getResourcePath: (NSString *) str ofType: (NSString*) sType;
59
60// Execute a task and wait for the process to terminate
61- (bool) executeTaskAndWaitForTermination: (NSString*)taskPath;
62- (bool) executeTaskAndWaitForTermination: (NSString*)taskPath withArgs:(NSArray*) args;
63
64// Open a file selection modal dialog
65- (NSString*) selectFileWithFileTypes:(NSString*) dir withName: (NSString*) name withTypes:(NSArray*) fileTypes;
66// Open a file selection modal dialog with a plist predefined type
67- (NSString*) selectAnyFile;
68- (NSString*) selectPlistFile:(NSString*)name;
69-(NSString*) selectDirectory:(NSString*) dirName;
70
71-(void) msgBoxInfo:(NSString*) msg;
72-(void) msgBoxError:(NSString*) msg;
73
74- (void) loadPreferences;
75- (bool) savePreferences;
76
77- (bool) handleSender: (id) sender;
78
79-(NSMutableDictionary*) preferencesFile;
80-(NSMutableDictionary*) preferencesParts;
81
82-(ChameleonPrefPane*) chameleon;
83
84@end
85

Archive Download this file

Revision: 385