fat: Greatly simplify and clean up dosfs_get_file_map().
[haiku.git] / src / preferences / network / InterfaceAddressView.h
blob7325cf481e44c1fe462518a6237a9db79dd24805
1 /*
2 * Copyright 2004-2015 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Alexander von Gluck, kallisti5@unixzen.com
7 * John Scipione, jscipione@gmail.com
8 */
9 #ifndef INTERFACE_ADDRESS_VIEW_H
10 #define INTERFACE_ADDRESS_VIEW_H
13 #include <GroupView.h>
14 #include <NetworkInterface.h>
15 #include <NetworkSettings.h>
16 #include <NetworkSettingsAddOn.h>
19 class BButton;
20 class BMenuField;
21 class BMessage;
22 class BPopUpMenu;
23 class BRect;
24 class BTextControl;
25 class IPAddressControl;
28 using namespace BNetworkKit;
31 class InterfaceAddressView : public BGroupView {
32 public:
33 InterfaceAddressView(int family,
34 const char* interface,
35 BNetworkSettings& settings);
36 virtual ~InterfaceAddressView();
38 virtual void AttachedToWindow();
39 virtual void MessageReceived(BMessage* message);
41 status_t Revert();
42 bool IsRevertable() const;
44 void ConfigurationUpdated(const BMessage& message);
46 private:
47 void _EnableFields(bool enable);
48 void _UpdateFields();
49 void _SetModeField(uint32 mode);
50 void _UpdateSettings();
51 uint32 _Mode() const;
53 void _ConfigureAddress(
54 BNetworkInterfaceAddressSettings& address);
55 void _SetAddress(BNetworkAddress& address,
56 const char* text);
58 private:
59 int fFamily;
60 BNetworkInterface fInterface;
61 BNetworkSettings& fSettings;
62 uint32 fLastMode;
64 BMessage fOriginalSettings;
66 BPopUpMenu* fModePopUpMenu;
67 BMenuField* fModeField;
68 IPAddressControl* fAddressField;
69 IPAddressControl* fNetmaskField;
70 IPAddressControl* fGatewayField;
71 BButton* fApplyButton;
75 #endif // INTERFACE_ADDRESS_VIEW_H