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