GUI Update for Kerberos Ticket Renew
[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         BOOL startAFSAtLogin;
29         IBOutlet NSView *afsCommanderView;
30         IBOutlet NSSearchField *textSearchField;
31         IBOutlet NSTextField *afsDefaultCellLabel;
32         IBOutlet NSButton *tokensButton;
33         IBOutlet NSButton *unlogButton;
34         IBOutlet NSButton *aklogCredentialAtLoginTime;
35         IBOutlet NSButton *installKRB5AuthAtLoginButton;
36         IBOutlet NSButton *useAklogCheck;
37         IBOutlet NSTextField *afsVersionLabel;
38         IBOutlet NSButton *checkButtonAfsAtBootTime;
39         IBOutlet NSTextField *textFieldDevInfoLabel;
40         IBOutlet NSTextField *statCacheEntry;
41         IBOutlet NSTextField *dCacheDim;
42         IBOutlet NSTextField *cacheDimension;
43         IBOutlet NSTextField *daemonNumber;
44         IBOutlet NSTextField *afsRootMountPoint;
45         IBOutlet NSTextField *nVolEntry;
46         IBOutlet NSTextField *nsTextFieldKrb5RenewTimeD;
47         IBOutlet NSTextField *nsTextFieldKrb5RenewTimeH;
48         IBOutlet NSTextField *nsTextFieldKrb5RenewTimeM;
49         IBOutlet NSTextField *nsTextFieldKrb5RenewTimeS;
50         IBOutlet NSStepper *nsStepperKrb5RenewTimeD;
51         IBOutlet NSStepper *nsStepperKrb5RenewTimeH;
52         IBOutlet NSStepper *nsStepperKrb5RenewTimeM;
53         IBOutlet NSStepper *nsStepperKrb5RenewTimeS;
54         IBOutlet NSTextField *nsTextFieldKrb5SecToExpireDateForRenew;
55         IBOutlet NSTextField *nsTextFieldKrb5RenewCheckIntervall;
56         IBOutlet NSButton *nsButtonEnableDisableKrb5RenewCheck;
57         IBOutlet NSButton *dynRoot;
58         IBOutlet NSButton *afsDB;
59         IBOutlet NSButton *verbose;
60         IBOutlet NSButton *backgrounderActivationCheck;
61         IBOutlet NSBox *groupsBox;
62         
63         //id installationPathTextField;
64         IBOutlet NSButton *startStopButton;
65         IBOutlet NSTableView *cellList;
66         //id cellNameTextEdit;
67         IBOutlet NSControl *cellIpButton;
68         IBOutlet NSControl *addCellButton;
69         IBOutlet NSControl *removeCellButton;
70         //id refreshConfigurationButton;
71         IBOutlet NSControl *saveConfigurationButton;
72         id labelSaveResult;
73         IBOutlet NSTableView *tokensTable;
74         IBOutlet NSControl *afsMenucheckBox;
75                 
76         //Configuration sheet
77         id ipConfigurationSheet;
78         id ipConfControllerCommander;
79         
80         //Token sheet
81         id credentialSheet;
82         id credentialCommander; 
83
84         
85         //Info Sheet
86         id infoSheet;
87         id infoController;      
88
89         //lynk creation
90         id lyncCreationSheet;
91         IBOutlet LynkCreationController         *lynkCreationController;
92         
93         //manage link
94         IBOutlet NSButton                                       *checkEnableLink;
95         IBOutlet NSButton                                       *buttonAddLink;
96         IBOutlet NSButton                                       *buttonRemoveLink;
97         IBOutlet NSTableView                            *tableViewLink;
98         NSMutableDictionary                                     *linkConfiguration;
99         
100         AFSPropertyManager *afsProperty;        //AFS Property managment class
101         NSMutableArray *filteredCellDB;         //Filtered CellServDB
102         NSArray *tokenList;
103         NSTimer *timerForCheckTokensList;
104         NSLock *tokensLock;
105 }
106
107 - (void) mainViewDidLoad;
108 - (void) willUnselect;
109 - (void) didSelect;
110 - (id) initWithBundle:(NSBundle *)bundle;
111 - (void)startTimer;
112 - (void)stopTimer;
113 //View Action
114 - (IBAction) refreshConfiguration:(id) sender;
115 - (void) fillCacheParamView;
116 - (void) updateCacheParamFromView;
117 - (IBAction) showCellIP:(id) sender;
118 - (IBAction) addRemoveCell:(id) sender;
119 - (IBAction) addLink:(id) sender;
120 - (IBAction) removeLink:(id) sender;
121 - (IBAction) enableLink:(id) sender;
122 - (IBAction) saveConfiguration:(id) sender;
123 - (IBAction) saveCacheManagerParam:(id) sender;
124 - (IBAction) startStopAfs:(id) sender;
125 - (IBAction) info:(id) sender;
126 - (IBAction) tableDoubleAction:(id) sender;
127 - (IBAction) getNewToken:(id) sender;
128 - (IBAction) unlog:(id) sender;
129 - (IBAction) afsMenuActivationEvent:(id) sender;
130 - (IBAction) aklogSwitchEvent:(id) sender;
131 - (IBAction) credentialAtLoginTimeEvent:(id) sender;
132 - (IBAction) afsStartupSwitchEvent:(id) sender;
133 - (IBAction) krb5KredentialAtLoginTimeEvent:(id) sender;
134 - (IBAction) searchCellTextEvent:(id) sender;
135 - (IBAction) manageBackgrounderActivation:(id)sender;
136 - (IBAction) tableViewLinkPerformClick:(id) sender;
137 - (IBAction) enableDisableKrb5RenewCheck:(id) sender;
138 - (IBAction) krb5RenewParamChange:(id) sender;
139 - (void) credentialAtLoginTimeEventCreationLaunchAgentDir:(NSWindow*)alert returnCode:(int)returnCode contextInfo:(void *)contextInfo;
140 - (void) clearCellServDBFiltering;
141 - (void) filterCellServDB:(NSString*)textToFilter;
142 - (DBCellElement*) getCurrentCellInDB;
143 - (DBCellElement*) getCellByIDX:(int) idx;
144 - (void) modifyCell:(DBCellElement*) cellElement;
145 - (void) modifyCellByIDX:(int) idx;
146 - (void) showMessage:(NSString*) message;
147 - (void) tableViewCellmanageButtonState:(int) rowSelected;
148 - (void) tableViewLinkmanageButtonState:(NSIndexSet *) rowsSelectedIndex;
149 - (void) setAfsStatus;
150 - (void) refreshTokens:(NSTimer*)theTimer;
151 - (void) repairHelperTool;
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 (NSTableDataSource)
161 - (id) getTableTokensListValue:(int) colId row:(int)row;
162 - (id) getTableCelListValue:(int) colId row:(int)row;
163 - (id) getTableLinkValue:(int) colId row:(int)row;
164 @end;