add more spacing
[personal-kdebase.git] / apps / kinfocenter / usbview / usbdevices.h
blob61e3980787926b44b7896c274e35e2ec57073f20
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 ***************************************************************************/
11 #ifndef __USB_DEVICES_H__
12 #define __USB_DEVICES_H__
14 #include <QList>
15 #include <QString>
17 #if defined(__DragonFly__)
18 #include <bus/usb/usb.h>
19 #include <QStringList>
20 #elif defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD)
21 #include <dev/usb/usb.h>
22 #include <QStringList>
23 #endif
25 class USBDB;
27 class USBDevice {
28 public:
30 USBDevice();
32 ~USBDevice();
34 void parseLine(const QString &line);
35 void parseSysDir(int bus, int parent, int level, const QString &line);
37 int level() const {
38 return _level;
40 int device() const {
41 return _device;
43 int parent() const {
44 return _parent;
46 int bus() const {
47 return _bus;
49 QString product();
51 QString dump();
53 static QList<USBDevice*> &devices() {
54 return _devices;
56 static USBDevice *find(int bus, int device);
57 static bool parse(const QString& fname);
58 static bool parseSys(const QString& fname);
60 private:
62 static QList<USBDevice*> _devices;
64 static USBDB *_db;
66 int _bus, _level, _parent, _port, _count, _device, _channels, _power;
67 float _speed;
69 QString _manufacturer, _product, _serial;
71 int _bwTotal, _bwUsed, _bwPercent, _bwIntr, _bwIso;
72 bool _hasBW;
74 unsigned int _verMajor, _verMinor, _class, _sub, _prot, _maxPacketSize, _configs;
75 QString _className;
77 unsigned int _vendorID, _prodID, _revMajor, _revMinor;
79 #if defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD)
80 void collectData( int fd, int level, usb_device_info &di, int parent );
81 QStringList _devnodes;
82 #endif
85 #endif