9180d3bc186adcc501d4dfaa46279a59d469582b
[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         id startStopButton;
54         id cellList;
55         //id cellNameTextEdit;
56         id cellIpButton;
57         id addCellButton;
58         id removeCellButton;
59         //id refreshConfigurationButton;
60         id saveConfigurationButton;
61         id labelSaveResult;
62         id tokensTable;
63         id 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         bool enableLink;
87         
88         AFSPropertyManager *afsProperty;        //AFS Property managment class
89         NSMutableArray *filteredCellDB;         //Filtered CellServDB
90         NSArray *tokenList;
91         NSTimer *timerForCheckTokensList;
92         NSLock *tokensLock;
93 }
94
95 - (void) mainViewDidLoad;
96 - (void) willUnselect;
97 - (void) didSelect;
98 - (id) initWithBundle:(NSBundle *)bundle;
99 - (void)startTimer;
100 - (void)stopTimer;
101 //View Action
102 - (IBAction) refreshConfiguration:(id) sender;
103 - (void) fillCacheParamView;
104 - (void) updateCacheParamFromView;
105 - (IBAction) showCellIP:(id) sender;
106 - (IBAction) addRemoveCell:(id) sender;
107 - (IBAction) addLink:(id) sender;
108 - (IBAction) removeLink:(id) sender;
109 - (IBAction) enableLink:(id) sender;
110 - (IBAction) saveConfiguration:(id) sender;
111 - (IBAction) saveCacheManagerParam:(id) sender;
112 - (IBAction) startStopAfs:(id) sender;
113 - (IBAction) info:(id) sender;
114 - (IBAction) tableDoubleAction:(id) sender;
115 - (IBAction) getNewToken:(id) sender;
116 - (IBAction) unlog:(id) sender;
117 - (IBAction) afsMenuActivationEvent:(id) sender;
118 - (IBAction) aklogSwitchEvent:(id) sender;
119 - (IBAction) credentialAtLoginTimeEvent:(id) sender;
120 - (IBAction) afsStartupSwitchEvent:(id) sender;
121 - (IBAction) krb5KredentialAtLoginTimeEvent:(id) sender;
122 - (IBAction) searchCellTextEvent:(id) sender;
123 - (IBAction) manageBackgrounderActivation:(id)sender;
124 - (void) credentialAtLoginTimeEventCreationLaunchAgentDir:(NSWindow*)alert returnCode:(int)returnCode contextInfo:(void *)contextInfo;
125 - (void) clearCellServDBFiltering;
126 - (void) filterCellServDB:(NSString*)textToFilter;
127 - (DBCellElement*) getCurrentCellInDB;
128 - (DBCellElement*) getCellByIDX:(int) idx;
129 - (void) modifyCell:(DBCellElement*) cellElement;
130 - (void) modifyCellByIDX:(int) idx;
131 - (void) showMessage:(NSString*) message;
132 - (void) manageButtonState:(int) rowSelected;
133 - (void) setAfsStatus;
134 - (void) refreshTokens:(NSTimer*)theTimer;
135 - (void) repairHelperTool;
136 - (void) writePreferenceFile;
137 - (void) readPreferenceFile;
138 - (void) refreshGui:(NSNotification *)notification;
139 - (void) refreshTokensNotify:(NSNotification*)notification;
140 - (void) afsVolumeMountChange:(NSNotification *)notification;
141 - (void)tabView:(NSTabView *)tabView willSelectTabViewItem: (NSTabViewItem *)tabViewItem;
142 @end
143
144 @interface AFSCommanderPref (NSTableDataSource)
145 - (id) getTableTokensListValue:(int) colId row:(int)row;
146 - (id) getTableCelListValue:(int) colId row:(int)row;
147 @end;