docs/ikteam: Delete most files.
[haiku.git] / src / preferences / network / NetworkWindow.h
blob5d937a44fee49554b3a3b7dc0df4ebb1d7978bee
1 /*
2 * Copyright 2004-2015 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Axel Dörfler, <axeld@pinc-software.de>
7 * Alexander von Gluck, <kallisti5@unixzen.com>
8 */
9 #ifndef NETWORK_WINDOW_H
10 #define NETWORK_WINDOW_H
13 #include <map>
15 #include <ObjectList.h>
16 #include <Window.h>
18 #include <NetworkSettings.h>
19 #include <NetworkSettingsAddOn.h>
22 using namespace BNetworkKit;
24 class BButton;
25 class BMenu;
26 class InterfaceListItem;
27 class InterfaceView;
30 enum {
31 kMsgSettingsItemUpdated = 'SIup'
35 class NetworkWindow : public BWindow {
36 public:
37 NetworkWindow();
38 virtual ~NetworkWindow();
40 bool QuitRequested();
41 void MessageReceived(BMessage* message);
43 private:
44 typedef BWindow inherited;
46 void _BuildProfilesMenu(BMenu* menu, int32 what);
47 void _ScanInterfaces();
48 void _ScanAddOns();
49 BNetworkSettingsItem*
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,
65 const BListItem* b);
66 static int _CompareListItems(const BListItem* a,
67 const BListItem* b);
69 private:
70 typedef BObjectList<BNetworkSettingsAddOn> AddOnList;
71 typedef std::map<BString, BListItem*> ItemMap;
72 typedef std::map<BListItem*, BNetworkSettingsItem*> SettingsMap;
74 BNetworkSettings fSettings;
75 AddOnList fAddOns;
77 BOutlineListView* fListView;
78 ItemMap fInterfaceItemMap;
79 BListItem* fServicesItem;
80 BListItem* fDialUpItem;
81 BListItem* fVPNItem;
82 BListItem* fOtherItem;
84 SettingsMap fSettingsMap;
86 InterfaceView* fInterfaceView;
87 BView* fAddOnShellView;
89 BButton* fRevertButton;
93 extern BMessenger gNetworkWindow;
96 #endif // NETWORK_WINDOW_H