1025e2c7bSOliver Ruiz Dorantes /* 2025e2c7bSOliver Ruiz Dorantes * Copyright 2009, Oliver Ruiz Dorantes, <oliver.ruiz.dorantes_at_gmail.com> 3025e2c7bSOliver Ruiz Dorantes * All rights reserved. Distributed under the terms of the MIT License. 4025e2c7bSOliver Ruiz Dorantes */ 5025e2c7bSOliver Ruiz Dorantes #ifndef DEVICELISTITEM_H_ 6025e2c7bSOliver Ruiz Dorantes #define DEVICELISTITEM_H_ 7025e2c7bSOliver Ruiz Dorantes 8025e2c7bSOliver Ruiz Dorantes #include <ListItem.h> 9623f4e65SOliver Ruiz Dorantes #include <String.h> 10025e2c7bSOliver Ruiz Dorantes 11623f4e65SOliver Ruiz Dorantes #include <bluetooth/bluetooth.h> 12623f4e65SOliver Ruiz Dorantes #include <bluetooth/DeviceClass.h> 13025e2c7bSOliver Ruiz Dorantes 14623f4e65SOliver Ruiz Dorantes namespace Bluetooth { 15623f4e65SOliver Ruiz Dorantes 16623f4e65SOliver Ruiz Dorantes class DeviceListItem : public BListItem 17025e2c7bSOliver Ruiz Dorantes { 18025e2c7bSOliver Ruiz Dorantes public: 19623f4e65SOliver Ruiz Dorantes DeviceListItem(BluetoothDevice* bDevice); 20623f4e65SOliver Ruiz Dorantes 21623f4e65SOliver Ruiz Dorantes ~DeviceListItem(); 22623f4e65SOliver Ruiz Dorantes 23623f4e65SOliver Ruiz Dorantes void DrawItem(BView*, BRect, bool = false); 24623f4e65SOliver Ruiz Dorantes void Update(BView* owner, const BFont* font); 25623f4e65SOliver Ruiz Dorantes 26025e2c7bSOliver Ruiz Dorantes static int Compare(const void* firstArg, const void* secondArg); 27623f4e65SOliver Ruiz Dorantes void SetDevice(BluetoothDevice* bDevice); 28*c2ee80e5SOliver Ruiz Dorantes BluetoothDevice* Device() const; 29623f4e65SOliver Ruiz Dorantes 30f988be6fSOliver Ruiz Dorantes private: 31623f4e65SOliver Ruiz Dorantes BluetoothDevice* fDevice; 32623f4e65SOliver Ruiz Dorantes bdaddr_t fAddress; 33623f4e65SOliver Ruiz Dorantes DeviceClass fClass; 34623f4e65SOliver Ruiz Dorantes BString fName; 35623f4e65SOliver Ruiz Dorantes int32 fRSSI; 36623f4e65SOliver Ruiz Dorantes 37025e2c7bSOliver Ruiz Dorantes }; 38025e2c7bSOliver Ruiz Dorantes 39025e2c7bSOliver Ruiz Dorantes } 40025e2c7bSOliver Ruiz Dorantes 41025e2c7bSOliver Ruiz Dorantes 42025e2c7bSOliver Ruiz Dorantes #endif 43