1 /* 2 * Copyright 2004-2015 Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Alexander von Gluck, kallisti5@unixzen.com 7 * Philippe Houdoin 8 * Fredrik Modéen 9 * John Scipione, jscipione@gmail.com 10 */ 11 #ifndef INTERFACE_LIST_ITEM_H 12 #define INTERFACE_LIST_ITEM_H 13 14 15 #include <ListItem.h> 16 #include <NetworkInterface.h> 17 #include <NetworkSettingsAddOn.h> 18 19 20 class BBitmap; 21 22 23 class InterfaceListItem : public BListItem, 24 public BNetworkKit::BNetworkConfigurationListener { 25 public: 26 InterfaceListItem(const char* name); 27 ~InterfaceListItem(); 28 29 void DrawItem(BView* owner, 30 BRect bounds, bool complete); 31 void Update(BView* owner, const BFont* font); 32 33 inline const char* Name() const { return fInterface.Name(); } 34 35 virtual void ConfigurationUpdated(const BMessage& message); 36 37 private: 38 void _Init(); 39 void _PopulateBitmaps(const char* mediaType); 40 void _UpdateState(); 41 BBitmap* _StateIcon() const; 42 const char* _StateText() const; 43 44 private: 45 BBitmap* fIcon; 46 BBitmap* fIconOffline; 47 BBitmap* fIconPending; 48 BBitmap* fIconOnline; 49 50 BNetworkInterface fInterface; 51 // Hardware Interface 52 53 float fFirstLineOffset; 54 float fLineOffset; 55 56 BString fDeviceName; 57 bool fDisabled; 58 bool fHasLink; 59 bool fConnecting; 60 BString fSubtitle; 61 }; 62 63 64 #endif // INTERFACE_LIST_ITEM_H 65