/* * Copyright 2004-2015 Haiku, Inc. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * Alexander von Gluck, kallisti5@unixzen.com * Philippe Houdoin * Fredrik Modéen * John Scipione, jscipione@gmail.com */ #ifndef INTERFACE_LIST_ITEM_H #define INTERFACE_LIST_ITEM_H #include #include #include class BBitmap; class InterfaceListItem : public BListItem, public BNetworkKit::BNetworkConfigurationListener { public: InterfaceListItem(const char* name); ~InterfaceListItem(); void DrawItem(BView* owner, BRect bounds, bool complete); void Update(BView* owner, const BFont* font); inline const char* Name() { return fInterface.Name(); } virtual void ConfigurationUpdated(const BMessage& message); private: void _Init(); void _PopulateBitmaps(const char* mediaType); void _UpdateState(); BBitmap* _StateIcon() const; const char* _StateText() const; private: BBitmap* fIcon; BBitmap* fIconOffline; BBitmap* fIconPending; BBitmap* fIconOnline; BNetworkInterface fInterface; // Hardware Interface float fFirstLineOffset; float fLineOffset; BString fDeviceName; bool fDisabled; bool fHasLink; bool fConnecting; BString fSubtitle; }; #endif // INTERFACE_LIST_ITEM_H