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