1 /* 2 * Copyright 2009, Oliver Ruiz Dorantes, <oliver.ruiz.dorantes_at_gmail.com> 3 * All rights reserved. Distributed under the terms of the MIT License. 4 */ 5 #ifndef DEVICELISTITEM_H_ 6 #define DEVICELISTITEM_H_ 7 8 #include <ListItem.h> 9 #include <String.h> 10 11 #include <bluetooth/bluetooth.h> 12 #include <bluetooth/DeviceClass.h> 13 14 class BluetoothDevice; 15 16 namespace Bluetooth { 17 18 class DeviceListItem : public BListItem 19 { 20 public: 21 DeviceListItem(BluetoothDevice* bDevice); 22 DeviceListItem(bdaddr_t bdaddr, DeviceClass dClass, int32 rssi = 0); 23 24 ~DeviceListItem(); 25 26 void DrawItem(BView *, BRect, bool = false); 27 void Update(BView *owner, const BFont *font); 28 29 static int Compare(const void *firstArg, const void *secondArg); 30 void SetDevice(BluetoothDevice* bDevice); 31 32 private: 33 BluetoothDevice* fDevice; 34 bdaddr_t fAddress; 35 DeviceClass fClass; 36 BString fName; 37 int32 fRSSI; 38 39 }; 40 41 } 42 43 44 #endif 45