Develop Kerberos renew system for ticket
[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 *nsTextFieldKrb5RenewTime;
47         IBOutlet NSTextField *nsTextFieldKrb5SecToExpireDateForRenew;
48         IBOutlet NSTextField *nsTextFieldKrb5RenewCheckIntervall;
49         IBOutlet NSButton *nsButtonEnableDisableKrb5RenewCheck;
50         IBOutlet NSButton *dynRoot;
51         IBOutlet NSButton *afsDB;
52         IBOutlet NSButton *verbose;
53         IBOutlet NSButton *backgrounderActivationCheck;
54         IBOutlet NSBox *groupsBox;
55         
56         //id installationPathTextField;
57         IBOutlet NSButton *startStopButton;
58         IBOutlet NSTableView *cellList;
59         //id cellNameTextEdit;
60         IBOutlet NSControl *cellIpButton;
61         IBOutlet NSControl *addCellButton;
62         IBOutlet NSControl *removeCellButton;
63         //id refreshConfigurationButton;
64         IBOutlet NSControl *saveConfigurationButton;
65         id labelSaveResult;
66         IBOutlet NSTableView *tokensTable;
67         IBOutlet NSControl *afsMenucheckBox;
68                 
69         //Configuration sheet
70         id ipConfigurationSheet;
71         id ipConfControllerCommander;
72         
73         //Token sheet
74         id credentialSheet;
75         id credentialCommander; 
76
77         
78         //Info Sheet
79         id infoSheet;
80         id infoController;      
81
82         //lynk creation
83         id lyncCreationSheet;
84         IBOutlet LynkCreationController         *lynkCreationController;
85         
86         //manage link
87         IBOutlet NSButton                                       *checkEnableLink;
88         IBOutlet NSButton                                       *buttonAddLink;
89         IBOutlet NSButton                                       *buttonRemoveLink;
90         IBOutlet NSTableView                            *tableViewLink;
91         NSMutableDictionary                                     *linkConfiguration;
92         
93         AFSPropertyManager *afsProperty;        //AFS Property managment class
94         NSMutableArray *filteredCellDB;         //Filtered CellServDB
95         NSArray *tokenList;
96         NSTimer *timerForCheckTokensList;
97         NSLock *tokensLock;
98 }
99
100 - (void) mainViewDidLoad;
101 - (void) willUnselect;
102 - (void) didSelect;
103 - (id) initWithBundle:(NSBundle *)bundle;
104 - (void)startTimer;
105 - (void)stopTimer;
106 //View Action
107 - (IBAction) refreshConfiguration:(id) sender;
108 - (void) fillCacheParamView;
109 - (void) updateCacheParamFromView;
110 - (IBAction) showCellIP:(id) sender;
111 - (IBAction) addRemoveCell:(id) sender;
112 - (IBAction) addLink:(id) sender;
113 - (IBAction) removeLink:(id) sender;
114 - (IBAction) enableLink:(id) sender;
115 - (IBAction) saveConfiguration:(id) sender;
116 - (IBAction) saveCacheManagerParam:(id) sender;
117 - (IBAction) startStopAfs:(id) sender;
118 - (IBAction) info:(id) sender;
119 - (IBAction) tableDoubleAction:(id) sender;
120 - (IBAction) getNewToken:(id) sender;
121 - (IBAction) unlog:(id) sender;
122 - (IBAction) afsMenuActivationEvent:(id) sender;
123 - (IBAction) aklogSwitchEvent:(id) sender;
124 - (IBAction) credentialAtLoginTimeEvent:(id) sender;
125 - (IBAction) afsStartupSwitchEvent:(id) sender;
126 - (IBAction) krb5KredentialAtLoginTimeEvent:(id) sender;
127 - (IBAction) searchCellTextEvent:(id) sender;
128 - (IBAction) manageBackgrounderActivation:(id)sender;
129 - (IBAction) tableViewLinkPerformClick:(id) sender;
130 - (IBAction) enableDisableKrb5RenewCheck:(id) sender;
131 - (IBAction) krb5RenewParamChange:(id) sender;
132 - (void) credentialAtLoginTimeEventCreationLaunchAgentDir:(NSWindow*)alert returnCode:(int)returnCode contextInfo:(void *)contextInfo;
133 - (void) clearCellServDBFiltering;
134 - (void) filterCellServDB:(NSString*)textToFilter;
135 - (DBCellElement*) getCurrentCellInDB;
136 - (DBCellElement*) getCellByIDX:(int) idx;
137 - (void) modifyCell:(DBCellElement*) cellElement;
138 - (void) modifyCellByIDX:(int) idx;
139 - (void) showMessage:(NSString*) message;
140 - (void) tableViewCellmanageButtonState:(int) rowSelected;
141 - (void) tableViewLinkmanageButtonState:(NSIndexSet *) rowsSelectedIndex;
142 - (void) setAfsStatus;
143 - (void) refreshTokens:(NSTimer*)theTimer;
144 - (void) repairHelperTool;
145 - (void) writePreferenceFile;
146 - (void) readPreferenceFile;
147 - (void) refreshGui:(NSNotification *)notification;
148 - (void) refreshTokensNotify:(NSNotification*)notification;
149 - (void) afsVolumeMountChange:(NSNotification *)notification;
150 - (void)tabView:(NSTabView *)tabView willSelectTabViewItem: (NSTabViewItem *)tabViewItem;
151 @end
152
153 @interface AFSCommanderPref (NSTableDataSource)
154 - (id) getTableTokensListValue:(int) colId row:(int)row;
155 - (id) getTableCelListValue:(int) colId row:(int)row;
156 - (id) getTableLinkValue:(int) colId row:(int)row;
157 @end;