00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef DEVICESINFO_H
00030 #define DEVICESINFO_H
00031
00032
00033 #include <opie2/olistview.h>
00034 #include <opie2/olayout.h>
00035
00036
00037 #include <qwidget.h>
00038 #include <qwidgetstack.h>
00039
00040 namespace Opie { namespace Core { class OPcmciaSocket; class OInputDevice; }; };
00041
00042
00043 class DevicesView : public Opie::Ui::OListView
00044 {
00045 Q_OBJECT
00046 public:
00047 DevicesView( QWidget* parent = 0, const char* name = 0, WFlags f = 0 );
00048 ~DevicesView();
00049 public slots:
00050 void selectionChanged( QListViewItem* item );
00051 };
00052
00053
00054 class DevicesInfo : public QWidget
00055 {
00056 Q_OBJECT
00057 public:
00058 DevicesInfo( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
00059 ~DevicesInfo();
00060
00061 void setDetailsWidget( QWidget* w = 0 );
00062
00063 private:
00064 Opie::Ui::OAutoBoxLayout* layout;
00065 Opie::Ui::OListView* view;
00066 QWidget* details;
00067 QWidgetStack* stack;
00068 private slots:
00069 };
00070
00071
00072 class Category : public Opie::Ui::OListViewItem
00073 {
00074 public:
00075 Category( DevicesView* parent, const QString& name );
00076 virtual ~Category();
00077
00078 virtual void populate() = 0;
00079 };
00080
00081
00082 class CpuCategory : public Category
00083 {
00084 public:
00085 CpuCategory( DevicesView* parent );
00086 virtual ~CpuCategory();
00087
00088 virtual void populate();
00089 };
00090
00091
00092 class InputCategory : public Category
00093 {
00094 public:
00095 InputCategory( DevicesView* parent );
00096 virtual ~InputCategory();
00097
00098 virtual void populate();
00099 };
00100
00101
00102 class CardsCategory : public Category
00103 {
00104 public:
00105 CardsCategory( DevicesView* parent );
00106 virtual ~CardsCategory();
00107 virtual void populate();
00108 };
00109
00110
00111 class UsbCategory : public Category
00112 {
00113 public:
00114 UsbCategory( DevicesView* parent );
00115 virtual ~UsbCategory();
00116
00117 virtual void populate();
00118 };
00119
00120
00121 class Device : public Opie::Ui::OListViewItem
00122 {
00123 public:
00124 Device( Category* parent, const QString& name );
00125 Device( Device* parent, const QString& name );
00126 ~Device();
00127
00128 QWidget* devinfo;
00129 QWidget* details;
00130
00131 virtual QWidget* detailsWidget();
00132 };
00133
00134
00135 class CpuDevice : public Device
00136 {
00137 public:
00138 CpuDevice( Category* parent, const QString& name );
00139 ~CpuDevice();
00140
00141 void addInfo( const QString& line );
00142
00143
00144 };
00145
00146
00147 class InputDevice : public Device
00148 {
00149 public:
00150 InputDevice( Category* parent, const QString& name );
00151 ~InputDevice();
00152
00153 void setInfo( const Opie::Core::OInputDevice* dev );
00154
00155
00156 };
00157
00158
00159 class CardDevice : public Device
00160 {
00161 public:
00162 CardDevice( Category* parent, const QString& name );
00163 ~CardDevice();
00164 void setInfo( const Opie::Core::OPcmciaSocket* card );
00165
00166
00167 };
00168
00169
00170 class UsbDevice : public Device
00171 {
00172 public:
00173 UsbDevice( Category* parent, const QString& name );
00174 UsbDevice( UsbDevice* parent, const QString& name );
00175 ~UsbDevice();
00176
00177
00178 };
00179
00180 #endif