2 * Copyright 2003-2004 Waldemar Kornewald. All rights reserved.
3 * Copyright 2017 Haiku, Inc. All rights reserved.
4 * Distributed under the terms of the MIT License.
18 #include <ScrollView.h>
24 #include <NetworkSettings.h>
25 #include <NetworkSettingsAddOn.h>
26 #include "InterfaceListItem.h"
28 #include "DialUpView.h"
31 using namespace BNetworkKit
;
34 class AddOn
: public BNetworkSettingsAddOn
{
36 AddOn(image_id addon_image
, BNetworkSettings
& settings
);
39 virtual BNetworkSettingsItem
*
40 CreateNextItem(uint32
& cookie
);
44 class DialUpInterfaceItem
: public BNetworkSettingsItem
{
46 DialUpInterfaceItem(BNetworkSettings
& settings
);
47 virtual ~DialUpInterfaceItem();
49 virtual BNetworkSettingsType
52 virtual BListItem
* ListItem();
53 virtual BView
* View();
55 virtual status_t
Revert();
56 virtual bool IsRevertable();
59 BNetworkSettings
& fSettings
;
68 DialUpInterfaceItem::DialUpInterfaceItem(BNetworkSettings
& settings
)
71 fItem(new InterfaceListItem("Dialup",
72 B_NETWORK_INTERFACE_TYPE_DIAL_UP
)),
78 DialUpInterfaceItem::~DialUpInterfaceItem()
80 if (fView
->Parent() == NULL
)
88 DialUpInterfaceItem::Type() const
90 return B_NETWORK_SETTINGS_TYPE_DIAL_UP
;
95 DialUpInterfaceItem::ListItem()
102 DialUpInterfaceItem::View()
105 fView
= new DialUpView(/*fSettings*/);
112 DialUpInterfaceItem::Revert()
118 DialUpInterfaceItem::IsRevertable()
128 AddOn::AddOn(image_id image
, BNetworkSettings
& settings
)
129 : BNetworkSettingsAddOn(image
, settings
)
139 BNetworkSettingsItem
*
140 AddOn::CreateNextItem(uint32
& cookie
)
143 return new DialUpInterfaceItem(Settings());
153 BNetworkSettingsAddOn
*
154 instantiate_network_settings_add_on(image_id image
, BNetworkSettings
& settings
)
156 return new AddOn(image
, settings
);