177db25ddSAxel Dörfler /* 277db25ddSAxel Dörfler * Copyright 2004-2015 Haiku Inc. All rights reserved. 377db25ddSAxel Dörfler * Distributed under the terms of the MIT License. 477db25ddSAxel Dörfler * 577db25ddSAxel Dörfler */ 677db25ddSAxel Dörfler #ifndef _NETWORK_SETTINGS_ADD_ON_H 777db25ddSAxel Dörfler #define _NETWORK_SETTINGS_ADD_ON_H 877db25ddSAxel Dörfler 977db25ddSAxel Dörfler 1077db25ddSAxel Dörfler #include <image.h> 1177db25ddSAxel Dörfler #include <ListItem.h> 1277db25ddSAxel Dörfler #include <Resources.h> 1377db25ddSAxel Dörfler #include <View.h> 1477db25ddSAxel Dörfler 1577db25ddSAxel Dörfler 1677db25ddSAxel Dörfler namespace BNetworkKit { 1777db25ddSAxel Dörfler 1877db25ddSAxel Dörfler 1977db25ddSAxel Dörfler enum BNetworkSettingsType { 2077db25ddSAxel Dörfler B_NETWORK_SETTINGS_TYPE_INTERFACE = 'intf', 2177db25ddSAxel Dörfler B_NETWORK_SETTINGS_TYPE_SERVICE = 'serv', 2277db25ddSAxel Dörfler B_NETWORK_SETTINGS_TYPE_DIAL_UP = 'dial', 2377db25ddSAxel Dörfler B_NETWORK_SETTINGS_TYPE_OTHER = 'othr' 2477db25ddSAxel Dörfler }; 2577db25ddSAxel Dörfler 2677db25ddSAxel Dörfler class BNetworkProfile; 2777db25ddSAxel Dörfler 2877db25ddSAxel Dörfler 2977db25ddSAxel Dörfler class BNetworkSettingsItem { 3077db25ddSAxel Dörfler public: 3177db25ddSAxel Dörfler BNetworkSettingsItem(); 3277db25ddSAxel Dörfler virtual ~BNetworkSettingsItem(); 3377db25ddSAxel Dörfler 3477db25ddSAxel Dörfler virtual BNetworkSettingsType 3577db25ddSAxel Dörfler Type() const = 0; 36*021ff1caSAxel Dörfler virtual BListItem* ListItem() = 0; 37*021ff1caSAxel Dörfler virtual BView* View() = 0; 3877db25ddSAxel Dörfler 3977db25ddSAxel Dörfler virtual status_t ProfileChanged( 4077db25ddSAxel Dörfler const BNetworkProfile* newProfile); 4177db25ddSAxel Dörfler const BNetworkProfile* 4277db25ddSAxel Dörfler Profile() const; 4377db25ddSAxel Dörfler 4477db25ddSAxel Dörfler virtual status_t Save() = 0; 4577db25ddSAxel Dörfler virtual status_t Revert() = 0; 4677db25ddSAxel Dörfler 4777db25ddSAxel Dörfler private: 4877db25ddSAxel Dörfler const BNetworkProfile* 4977db25ddSAxel Dörfler fProfile; 5077db25ddSAxel Dörfler }; 5177db25ddSAxel Dörfler 5277db25ddSAxel Dörfler 5377db25ddSAxel Dörfler class BNetworkSettingsInterfaceItem : public BNetworkSettingsItem { 5477db25ddSAxel Dörfler public: 5577db25ddSAxel Dörfler BNetworkSettingsInterfaceItem( 5677db25ddSAxel Dörfler const char* interface); 5777db25ddSAxel Dörfler 5877db25ddSAxel Dörfler virtual BNetworkSettingsType 5977db25ddSAxel Dörfler Type() const; 6077db25ddSAxel Dörfler const char* Interface() const; 6177db25ddSAxel Dörfler 6277db25ddSAxel Dörfler private: 6377db25ddSAxel Dörfler const char* fInterface; 6477db25ddSAxel Dörfler }; 6577db25ddSAxel Dörfler 6677db25ddSAxel Dörfler 6777db25ddSAxel Dörfler class BNetworkSettingsAddOn { 6877db25ddSAxel Dörfler public: 6977db25ddSAxel Dörfler BNetworkSettingsAddOn(image_id image); 7077db25ddSAxel Dörfler virtual ~BNetworkSettingsAddOn(); 7177db25ddSAxel Dörfler 7277db25ddSAxel Dörfler virtual BNetworkSettingsInterfaceItem* 7377db25ddSAxel Dörfler CreateNextInterfaceItem(uint32& cookie, 7477db25ddSAxel Dörfler const char* interface); 7577db25ddSAxel Dörfler virtual BNetworkSettingsItem* 7677db25ddSAxel Dörfler CreateNextItem(uint32& cookie); 7777db25ddSAxel Dörfler 7877db25ddSAxel Dörfler image_id Image(); 7977db25ddSAxel Dörfler BResources* Resources(); 8077db25ddSAxel Dörfler 8177db25ddSAxel Dörfler private: 8277db25ddSAxel Dörfler image_id fImage; 8377db25ddSAxel Dörfler BResources* fResources; 8477db25ddSAxel Dörfler }; 8577db25ddSAxel Dörfler 8677db25ddSAxel Dörfler 8777db25ddSAxel Dörfler // Your add-on needs to export this hook in order to be picked up 8877db25ddSAxel Dörfler extern "C" BNetworkSettingsAddOn* instantiate_network_settings_add_on( 8977db25ddSAxel Dörfler image_id image); 9077db25ddSAxel Dörfler 9177db25ddSAxel Dörfler 9277db25ddSAxel Dörfler } // namespace BNetworkKit 9377db25ddSAxel Dörfler 9477db25ddSAxel Dörfler 9577db25ddSAxel Dörfler #endif // _NETWORK_SETTINGS_ADD_ON_H 96