Import Upstream version 1.8.5
[hcoop/debian/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 <SecurityInterface/SFAuthorizationView.h>
11 #import "AFSPropertyManager.h"
12 #import "global.h"
13 #import "ViewUtility.h"
14 #import "LynkCreationController.h"
15
16 // the way to load and unload the menuextra was inspired by MenuMeters developed by Alex Harper
17 // Routines to handle adding and remove menu extras in HIServices (from ASM source)
18 int CoreMenuExtraGetMenuExtra(CFStringRef identifier, void *menuExtra);
19 int CoreMenuExtraAddMenuExtra(CFURLRef path, int position, int whoCares, int whoCares2, int whoCares3, int whoCares4);
20 int CoreMenuExtraRemoveMenuExtra(void *menuExtra, int whoCares);
21
22
23
24 @interface AFSCommanderPref : NSPreferencePane <NSTableViewDataSource, NSTableViewDelegate>
25 {
26 //for check system version
27 int prefStartUp;
28 // Main View
29 BOOL startAFSAtLogin;
30 IBOutlet SFAuthorizationView *authView;
31 IBOutlet NSView *afsCommanderView;
32 IBOutlet NSSearchField *textSearchField;
33 IBOutlet NSTextField *afsDefaultCellLabel;
34 IBOutlet NSButton *tokensButton;
35 IBOutlet NSButton *unlogButton;
36 IBOutlet NSButton *aklogCredentialAtLoginTime;
37 IBOutlet NSButton *installKRB5AuthAtLoginButton;
38 IBOutlet NSButton *useAklogCheck;
39 IBOutlet NSTextField *afsVersionLabel;
40 IBOutlet NSButton *checkButtonAfsAtBootTime;
41 IBOutlet NSTextField *textFieldDevInfoLabel;
42 IBOutlet NSTextField *statCacheEntry;
43 IBOutlet NSTextField *dCacheDim;
44 IBOutlet NSTextField *cacheDimension;
45 IBOutlet NSTextField *daemonNumber;
46 IBOutlet NSTextField *afsRootMountPoint;
47 IBOutlet NSTextField *nVolEntry;
48 IBOutlet NSTextField *nsTextFieldKrb5RenewTimeD;
49 IBOutlet NSTextField *nsTextFieldKrb5RenewTimeH;
50 IBOutlet NSTextField *nsTextFieldKrb5RenewTimeM;
51 IBOutlet NSTextField *nsTextFieldKrb5RenewTimeS;
52 IBOutlet NSStepper *nsStepperKrb5RenewTimeD;
53 IBOutlet NSStepper *nsStepperKrb5RenewTimeH;
54 IBOutlet NSStepper *nsStepperKrb5RenewTimeM;
55 IBOutlet NSStepper *nsStepperKrb5RenewTimeS;
56 IBOutlet NSTextField *nsTextFieldKrb5SecToExpireDateForRenew;
57 IBOutlet NSTextField *nsTextFieldKrb5RenewCheckIntervall;
58 IBOutlet NSButton *nsButtonEnableDisableKrb5RenewCheck;
59 IBOutlet NSButton *dynRoot;
60 IBOutlet NSButton *afsDB;
61 IBOutlet NSButton *verbose;
62 IBOutlet NSButton *backgrounderActivationCheck;
63 IBOutlet NSBox *groupsBox;
64
65 //id installationPathTextField;
66 IBOutlet NSButton *startStopButton;
67 IBOutlet NSTableView *cellList;
68 //id cellNameTextEdit;
69 IBOutlet NSControl *cellIpButton;
70 IBOutlet NSControl *addCellButton;
71 IBOutlet NSControl *removeCellButton;
72 //id refreshConfigurationButton;
73 IBOutlet NSControl *saveConfigurationButton;
74 id labelSaveResult;
75 IBOutlet NSTableView *tokensTable;
76 IBOutlet NSControl *afsMenucheckBox;
77
78 //Configuration sheet
79 id ipConfigurationSheet;
80 id ipConfControllerCommander;
81
82 //Token sheet
83 id credentialSheet;
84 id credentialCommander;
85
86
87 //Info Sheet
88 id infoSheet;
89 id infoController;
90
91 //lynk creation
92 id lyncCreationSheet;
93 IBOutlet LynkCreationController *lynkCreationController;
94
95 //manage link
96 IBOutlet NSButton *checkEnableLink;
97 IBOutlet NSButton *buttonAddLink;
98 IBOutlet NSButton *buttonRemoveLink;
99 IBOutlet NSTableView *tableViewLink;
100 NSMutableDictionary *linkConfiguration;
101
102 AFSPropertyManager *afsProperty; //AFS Property managment class
103 NSMutableArray *filteredCellDB; //Filtered CellServDB
104 NSArray *tokenList;
105 NSTimer *timerForCheckTokensList;
106 NSLock *tokensLock;
107 }
108
109 - (BOOL)isUnlocked;
110 - (void) mainViewDidLoad;
111 - (void) willUnselect;
112 - (void) didSelect;
113 - (id) initWithBundle:(NSBundle *)bundle;
114 - (void)startTimer;
115 - (void)stopTimer;
116 //View Action
117 - (IBAction) refreshConfiguration:(id) sender;
118 - (void) fillCacheParamView;
119 - (void) updateCacheParamFromView;
120 - (IBAction) showCellIP:(id) sender;
121 - (IBAction) addRemoveCell:(id) sender;
122 - (IBAction) addLink:(id) sender;
123 - (IBAction) removeLink:(id) sender;
124 - (IBAction) enableLink:(id) sender;
125 - (IBAction) saveConfiguration:(id) sender;
126 - (IBAction) saveCacheManagerParam:(id) sender;
127 - (IBAction) startStopAfs:(id) sender;
128 - (IBAction) info:(id) sender;
129 - (IBAction) tableDoubleAction:(id) sender;
130 - (IBAction) getNewToken:(id) sender;
131 - (IBAction) unlog:(id) sender;
132 - (IBAction) afsMenuActivationEvent:(id) sender;
133 - (IBAction) aklogSwitchEvent:(id) sender;
134 - (IBAction) credentialAtLoginTimeEvent:(id) sender;
135 - (IBAction) afsStartupSwitchEvent:(id) sender;
136 - (IBAction) krb5KredentialAtLoginTimeEvent:(id) sender;
137 - (IBAction) searchCellTextEvent:(id) sender;
138 - (IBAction) manageBackgrounderActivation:(id)sender;
139 - (IBAction) tableViewLinkPerformClick:(id) sender;
140 - (IBAction) enableDisableKrb5RenewCheck:(id) sender;
141 - (IBAction) krb5RenewParamChange:(id) sender;
142 - (void) credentialAtLoginTimeEventCreationLaunchAgentDir:(NSWindow*)alert returnCode:(int)returnCode contextInfo:(void *)contextInfo;
143 - (void) clearCellServDBFiltering;
144 - (void) filterCellServDB:(NSString*)textToFilter;
145 - (DBCellElement*) getCurrentCellInDB;
146 - (DBCellElement*) getCellByIDX:(int) idx;
147 - (void) modifyCell:(DBCellElement*) cellElement;
148 - (void) modifyCellByIDX:(int) idx;
149 - (void) showMessage:(NSString*) message;
150 - (void) setAfsStatus;
151 - (void) refreshTokens:(NSTimer*)theTimer;
152 - (void) writePreferenceFile;
153 - (void) readPreferenceFile;
154 - (void) refreshGui:(NSNotification *)notification;
155 - (void) refreshTokensNotify:(NSNotification*)notification;
156 - (void) afsVolumeMountChange:(NSNotification *)notification;
157 - (void)tabView:(NSTabView *)tabView willSelectTabViewItem: (NSTabViewItem *)tabViewItem;
158 @end
159
160 @interface AFSCommanderPref (TableDelegate)
161 - (void) tableViewCellmanageButtonState:(int) rowSelected;
162 - (void) tableViewLinkmanageButtonState:(NSIndexSet *) rowsSelectedIndex;
163 @end;
164
165 @interface AFSCommanderPref (NSTableDataSource)
166 - (id) getTableTokensListValue:(int) colId row:(int)row;
167 - (id) getTableCelListValue:(int) colId row:(int)row;
168 - (id) getTableLinkValue:(int) colId row:(int)row;
169 @end;