2 * Copyright 2004-2015 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
6 * Axel Dörfler, <axeld@pinc-software.de>
7 * Alexander von Gluck, <kallisti5@unixzen.com>
9 #ifndef NETWORK_WINDOW_H
10 #define NETWORK_WINDOW_H
15 #include <ObjectList.h>
18 #include <NetworkSettings.h>
19 #include <NetworkSettingsAddOn.h>
22 using namespace BNetworkKit
;
26 class InterfaceListItem
;
31 kMsgSettingsItemUpdated
= 'SIup'
35 class NetworkWindow
: public BWindow
{
38 virtual ~NetworkWindow();
41 void MessageReceived(BMessage
* message
);
44 typedef BWindow inherited
;
46 void _BuildProfilesMenu(BMenu
* menu
, int32 what
);
47 void _ScanInterfaces();
50 _SettingsItemFor(BListItem
* item
);
51 void _SortItemsUnder(BListItem
* item
);
52 BListItem
* _ListItemFor(BNetworkSettingsType type
);
53 BListItem
* _CreateItem(const char* label
);
54 void _SelectItem(BListItem
* listItem
);
55 void _BroadcastSettingsUpdate(uint32 type
);
56 void _BroadcastConfigurationUpdate(
57 const BMessage
& message
);
58 void _UpdateRevertButton();
60 bool _IsReplicantInstalled();
61 void _ShowReplicant(bool show
);
63 static const char* _ItemName(const BListItem
* item
);
64 static int _CompareTopLevelListItems(const BListItem
* a
,
66 static int _CompareListItems(const BListItem
* a
,
70 typedef BObjectList
<BNetworkSettingsAddOn
> AddOnList
;
71 typedef std::map
<BString
, BListItem
*> ItemMap
;
72 typedef std::map
<BListItem
*, BNetworkSettingsItem
*> SettingsMap
;
74 BNetworkSettings fSettings
;
77 BOutlineListView
* fListView
;
78 ItemMap fInterfaceItemMap
;
79 BListItem
* fServicesItem
;
80 BListItem
* fDialUpItem
;
82 BListItem
* fOtherItem
;
84 SettingsMap fSettingsMap
;
86 InterfaceView
* fInterfaceView
;
87 BView
* fAddOnShellView
;
89 BButton
* fRevertButton
;
93 extern BMessenger gNetworkWindow
;
96 #endif // NETWORK_WINDOW_H