xref: /haiku/src/preferences/network/NetworkWindow.h (revision 2f470aec1c92ce6917b8a903e343795dc77af41f)
1 #ifndef NETWORK_WINDOW_H
2 #define NETWORK_WINDOW_H
3 
4 #include <Window.h>
5 #include <View.h>
6 #include <Button.h>
7 #include <TabView.h>
8 #include <Box.h>
9 #include <CheckBox.h>
10 #include <String.h>
11 #include "ConfigData.h"
12 
13 class NetListView;
14 
15 class NetworkWindow : public BWindow
16 {
17 public:
18 	NetworkWindow();
19 
20 	BView 			*fView;
21 	BTabView 		*fTabView;
22 
23 	BButton			*fRestart;
24 	BButton			*fRevert;
25 	BButton			*fSave;
26 
27 	BTab 			*fIdentity;
28 	BView 			*fIdentityView;
29 
30 	BBox 			*fNames;
31 	BTextControl 	*fDomain;
32 	BTextControl 	*fHost;
33 	BTextControl 	*fPrimaryDNS;
34 	BTextControl 	*fSecondaryDNS;
35 
36 	BBox 			*fInterfaces;
37 	NetListView		*fInterfacesList;
38 	BButton			*fSettings;
39 	BButton			*fClear;
40 	BButton			*fCustom;
41 
42 	BTab 			*fServices;
43 	BView 			*fServicesView;
44 	BCheckBox		*fFTPServer;
45 	BCheckBox		*fTelnetServer;
46 	BCheckBox		*fAppleTalk;
47 	BCheckBox		*fIPForwarding;
48 	BButton			*fLoginInfo;
49 
50 	BBox			*fConfigurations;
51 	NetListView		*fConfigurationsList;
52 	BButton			*fBackup;
53 	BButton			*fRestore;
54 	BButton			*fRemove;
55 
56 	// Messages
57 	static const int32 kRestart_Networking_M = 'ranm' ;
58 	static const int32 kRevert_M			 = 'revm' ;
59 	static const int32 kSave_M				 = 'savm' ;
60 	static const int32 kSettings_M			 = 'setm' ;
61 	static const int32 kClear_M				 = 'clem' ;
62 	static const int32 kCustom_M			 = 'cusm' ;
63 	static const int32 kLogin_Info_M		 = 'logm' ;
64 	static const int32 kBackup_M			 = 'bakm' ;
65 	static const int32 kRestore_M			 = 'resm' ;
66 	static const int32 kDelete_M			 = 'delm' ;
67 
68 	static const int32 kSOMETHING_HAS_CHANGED_M = 'shcm' ;
69 
70 /*
71 	As this window is the 'main' one and that at startup it gathers up the
72 	info with the LoadSettings() method, some data are kept here and will be passed
73 	to who needs it.
74 */
75 	BString fusername;
76 	BString flogin_info_S[2];
77 
78 	virtual bool QuitRequested();
79 	virtual void MessageReceived(BMessage *message);
80 
81 	//All these are defined in funcs.cpp
82 	void DeleteConfigFile();
83 	void LoadConfigEntries();
84 	void LoadSettings(const char *bakname = NULL);
85 
86 	// Gets all the infos of the interfaces at startup, display and store them
87 	// or get them from a backup file.
88 	ConfigData fData;
89 };
90 
91 #endif
92