1ee834bb8SAxel Dörfler /* 2ee834bb8SAxel Dörfler * Copyright 2015 Haiku, Inc. All rights reserved. 3ee834bb8SAxel Dörfler * Distributed under the terms of the MIT License. 4ee834bb8SAxel Dörfler * 5ee834bb8SAxel Dörfler * Authors: 6ee834bb8SAxel Dörfler * Axel Dörfler, <axeld@pinc-software.de> 7ee834bb8SAxel Dörfler */ 8ee834bb8SAxel Dörfler #ifndef SERVICE_LIST_ITEM_H 9ee834bb8SAxel Dörfler #define SERVICE_LIST_ITEM_H 10ee834bb8SAxel Dörfler 11ee834bb8SAxel Dörfler 12ee834bb8SAxel Dörfler #include <ListItem.h> 13ee834bb8SAxel Dörfler #include <NetworkSettings.h> 14ee834bb8SAxel Dörfler #include <NetworkSettingsAddOn.h> 15ee834bb8SAxel Dörfler 16ee834bb8SAxel Dörfler 17ee834bb8SAxel Dörfler using namespace BNetworkKit; 18ee834bb8SAxel Dörfler 19ee834bb8SAxel Dörfler 20ee834bb8SAxel Dörfler class ServiceListItem : public BListItem, 21ee834bb8SAxel Dörfler public BNetworkKit::BNetworkSettingsListener { 22ee834bb8SAxel Dörfler public: 23ee834bb8SAxel Dörfler ServiceListItem(const char* name, 24ee834bb8SAxel Dörfler const char* label, 25ee834bb8SAxel Dörfler const BNetworkSettings& settings); 26ee834bb8SAxel Dörfler virtual ~ServiceListItem(); 27ee834bb8SAxel Dörfler Label()28*23557153SAxel Dörfler const char* Label() const { return fLabel; } 29*23557153SAxel Dörfler 30ee834bb8SAxel Dörfler virtual void DrawItem(BView* owner, 31ee834bb8SAxel Dörfler BRect bounds, bool complete); 32ee834bb8SAxel Dörfler virtual void Update(BView* owner, const BFont* font); 33ee834bb8SAxel Dörfler Name()34ee834bb8SAxel Dörfler inline const char* Name() const { return fName; } 35ee834bb8SAxel Dörfler 36ee834bb8SAxel Dörfler virtual void SettingsUpdated(uint32 type); 37ee834bb8SAxel Dörfler 38ee834bb8SAxel Dörfler protected: 39ee834bb8SAxel Dörfler virtual bool IsEnabled(); 40ee834bb8SAxel Dörfler 41ee834bb8SAxel Dörfler private: 42ee834bb8SAxel Dörfler const char* fName; 43ee834bb8SAxel Dörfler const char* fLabel; 44ee834bb8SAxel Dörfler const BNetworkSettings& 45ee834bb8SAxel Dörfler fSettings; 46ee834bb8SAxel Dörfler 47ee834bb8SAxel Dörfler BView* fOwner; 48ee834bb8SAxel Dörfler float fLineOffset; 49ee834bb8SAxel Dörfler bool fEnabled; 50ee834bb8SAxel Dörfler }; 51ee834bb8SAxel Dörfler 52ee834bb8SAxel Dörfler 53ee834bb8SAxel Dörfler #endif // SERVICE_LIST_ITEM_H 54