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

Archive Download this file

Revision: 386