Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / apps / kinfocenter / usbview / usbdevices.h
blobcac59d201e4a099b7ad7cc40954b991702f022b0
1 /***************************************************************************
2 * Copyright (C) 2001 by Matthias Hoelzer-Kluepfel <mhk@caldera.de> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 ***************************************************************************/
12 #ifndef __USB_DEVICES_H__
13 #define __USB_DEVICES_H__
17 #include <Qt3Support/Q3PtrList>
19 #if defined(__DragonFly__)
20 #include <bus/usb/usb.h>
21 #elif defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD)
22 #include <dev/usb/usb.h>
23 #endif
25 class USBDB;
28 class USBDevice
30 public:
32 USBDevice();
34 void parseLine(const QString &line);
35 void parseSysDir(int bus, int parent, int level, const QString &line);
37 int level() const { return _level; }
38 int device() const { return _device; }
39 int parent() const { return _parent; }
40 int bus() const { return _bus; }
41 QString product();
43 QString dump();
45 static Q3PtrList<USBDevice> &devices() { return _devices; }
46 static USBDevice *find(int bus, int device);
47 static bool parse(const QString& fname);
48 static bool parseSys(const QString& fname);
51 private:
53 static Q3PtrList<USBDevice> _devices;
55 static USBDB *_db;
57 int _bus, _level, _parent, _port, _count, _device, _channels, _power;
58 float _speed;
60 QString _manufacturer, _product, _serial;
62 int _bwTotal, _bwUsed, _bwPercent, _bwIntr, _bwIso;
63 bool _hasBW;
65 unsigned int _verMajor, _verMinor, _class, _sub, _prot, _maxPacketSize, _configs;
66 QString _className;
68 unsigned int _vendorID, _prodID, _revMajor, _revMinor;
70 #if defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD)
71 void collectData( int fd, int level, usb_device_info &di, int parent );
72 QStringList _devnodes;
73 #endif
77 #endif