OSX Preference Pane Source Import
[openafs.git] / src / platform / DARWIN / AFSPreference / AFSCommanderPref.h
1 //
2 //  AFSCommanderPref.h
3 //  AFSCommander
4 //
5 //  Created by Claudio Bisegni on 10/05/07.
6 //  Copyright (c) 2007 INFN - National Institute of Nuclear Physics. All rights reserved.
7 //
8
9 #import <PreferencePanes/PreferencePanes.h>
10 #import "AFSPropertyManager.h"
11 #import "global.h"
12 #import "ViewUtility.h"
13 #import "LynkCreationController.h"
14
15 // the way to load and unload the menuextra was inspired by MenuMeters developed by Alex Harper
16 // Routines to handle adding and remove menu extras in HIServices (from ASM source)
17 int CoreMenuExtraGetMenuExtra(CFStringRef identifier, void *menuExtra);
18 int CoreMenuExtraAddMenuExtra(CFURLRef path, int position, int whoCares, int whoCares2, int whoCares3, int whoCares4);
19 int CoreMenuExtraRemoveMenuExtra(void *menuExtra, int whoCares);
20
21
22
23 @interface AFSCommanderPref : NSPreferencePane 
24 {
25         //for check system version
26         int prefStartUp;
27         // Main View
28         IBOutlet NSView *afsCommanderView;
29         IBOutlet NSSearchField *textSearchField;
30         IBOutlet NSTextField *afsDefaultCellLabel;
31         IBOutlet NSButton *tokensButton;
32         IBOutlet NSButton *unlogButton;
33         IBOutlet NSButton *aklogCredentialAtLoginTime;
34         IBOutlet NSButton *installKRB5AuthAtLoginButton;
35         IBOutlet NSButton *useAklogCheck;
36         IBOutlet NSTextField *afsVersionLabel;
37         BOOL startAFSAtLogin;
38         IBOutlet NSButton *checkButtonAfsAtBootTime;
39         IBOutlet NSTextField *textFieldDevInfoLabel;
40         
41         //NSString *appID;
42         //id installationPathTextField;
43         id startStopButton;
44         id cellList;
45         //id cellNameTextEdit;
46         id cellIpButton;
47         id addCellButton;
48         id removeCellButton;
49         //id refreshConfigurationButton;
50         id saveConfigurationButton;
51         id labelSaveResult;
52         id tokensTable;
53         id afsMenucheckBox;
54                 
55         //cache manager IBOutlet
56         IBOutlet NSTextField *statCacheEntry;
57         IBOutlet NSTextField *dCacheDim;
58         IBOutlet NSTextField *cacheDimension;
59         IBOutlet NSTextField *daemonNumber;
60         IBOutlet NSTextField *afsRootMountPoint;
61         IBOutlet NSTextField *nVolEntry;
62         IBOutlet NSButton *dynRoot;
63         IBOutlet NSButton *afsDB;
64         IBOutlet NSButton *verbose;
65         IBOutlet NSBox *groupsBox;
66         
67         //Configuration sheet
68         id ipConfigurationSheet;
69         id ipConfControllerCommander;
70         
71         //Token sheet
72         id credentialSheet;
73         id credentialCommander; 
74
75         
76         //Info Sheet
77         id infoSheet;
78         id infoController;      
79
80         //lynk creation
81         id lyncCreationSheet;
82         IBOutlet LynkCreationController         *lynkCreationController;
83         
84         //manage link
85         IBOutlet NSButton                                       *checkEnableLink;
86         IBOutlet NSButton                                       *buttonAddLink;
87         IBOutlet NSButton                                       *buttonRemoveLink;
88         bool enableLink;
89         
90         AFSPropertyManager *afsProperty;        //AFS Property managment class
91         NSMutableArray *filteredCellDB;         //Filtered CellServDB
92         NSArray *tokenList;
93         NSTimer *timerForCheckTokensList;
94         NSLock *tokensLock;
95 }
96
97 - (void) mainViewDidLoad;
98 - (void) willUnselect;
99 - (void) didSelect;
100 - (id) initWithBundle:(NSBundle *)bundle;
101 - (void)startTimer;
102 - (void)stopTimer;
103 //View Action
104 - (IBAction) refreshConfiguration:(id) sender;
105 - (void) fillCacheParamView;
106 - (void) updateCacheParamFromView;
107 - (IBAction) showCellIP:(id) sender;
108 - (IBAction) addRemoveCell:(id) sender;
109 - (IBAction) addLink:(id) sender;
110 - (IBAction) removeLink:(id) sender;
111 - (IBAction) enableLink:(id) sender;
112 - (IBAction) saveConfiguration:(id) sender;
113 - (IBAction) saveCacheManagerParam:(id) sender;
114 - (IBAction) startStopAfs:(id) sender;
115 - (IBAction) info:(id) sender;
116 - (IBAction) tableDoubleAction:(id) sender;
117 - (IBAction) getNewToken:(id) sender;
118 - (IBAction) unlog:(id) sender;
119 - (IBAction) afsMenuActivationEvent:(id) sender;
120 - (IBAction) aklogSwitchEvent:(id) sender;
121 - (IBAction) credentialAtLoginTimeEvent:(id) sender;
122 - (IBAction) afsStartupSwitchEvent:(id) sender;
123 - (void) credentialAtLoginTimeEventCreationLaunchAgentDir:(NSWindow*)alert returnCode:(int)returnCode contextInfo:(void *)contextInfo;
124 - (IBAction) krb5KredentialAtLoginTimeEvent:(id) sender;
125 - (IBAction) searchCellTextEvent:(id) sender;
126 - (void) clearCellServDBFiltering;
127 - (void) filterCellServDB:(NSString*)textToFilter;
128 - (DBCellElement*) getCurrentCellInDB;
129 - (DBCellElement*) getCellByIDX:(int) idx;
130 - (void) modifyCell:(DBCellElement*) cellElement;
131 - (void) modifyCellByIDX:(int) idx;
132 - (void) showMessage:(NSString*) message;
133 - (void) manageButtonState:(int) rowSelected;
134 - (void) setAfsStatus;
135 - (void) refreshTokens:(NSTimer*)theTimer;
136 - (BOOL) isAFSMenuExtraLoaded;
137 - (void) addAFSMenuExtra;
138 - (void) removeAFSMenuExtra;
139 - (void) repairHelperTool;
140 - (void) writePreferenceFile;
141 - (void) readPreferenceFile;
142 - (void) mextraChangeActivation:(NSNotification *)notification;
143 - (void) refreshGui:(NSNotification *)notification;
144 - (void) afsVolumeMountChange:(NSNotification *)notification;
145 @end