MagicSmoke  $VERSION$
bcs-plugin.h
Go to the documentation of this file.
1 //
2 // C++ Interface: plugin for USB barcode scanners
3 //
4 // Description:
5 //
6 //
7 // Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2013-2014
8 //
9 // Copyright: See README/COPYING.GPL files that come with this distribution
10 //
11 //
12 
13 #ifndef MAGICSMOKE_BARCODE_PLUGIN_HID_H
14 #define MAGICSMOKE_BARCODE_PLUGIN_HID_H
15 
16 #include "barcode-plugin.h"
17 
18 #include <QPointer>
19 
20 class QTimer;
21 class MHidBarcodeScanner;
22 class QSettings;
23 class MHidBarcodePlugin:public QObject,public MBarcodePlugin
24 {
25  Q_OBJECT
26  Q_PLUGIN_METADATA(IID MBarcodePlugin_IID)
27  Q_INTERFACES(MBarcodePlugin)
28  public:
30  virtual ~MHidBarcodePlugin();
31  virtual void configure(MBarcodeConfiguration*)override;
32  private slots:
33  void detectScanners();
34  void restartDetect();
35  void removeScanner(QObject*);
36  private:
37  bool misopen;
38  QTimer*mdetecttmr=nullptr;
39  struct Config{
40  int vendor=0,product=0,iface=0;
41  bool useserial=false,isactive=false;
42  QString serial,group;
43  Config(){}
44  Config(const Config&)=default;
45  Config(Config&&)=default;
46  Config(QSettings&,QString);
47  Config& operator=(const Config&)=default;
48  Config& operator=(Config&&)=default;
49  };
50  QList<Config>mconfig;
51  Config findCfgMatch(int vendor,int product,int iface,QString serial);
52  QList<QPointer<MHidBarcodeScanner>>mscanners;
53  MHidBarcodeScanner*findScanner(QString path);
54 };
55 
56 #endif
virtual void configure(MBarcodeConfiguration *) override
called whenever the user opens a configuration dialog
Definition: bcs-plugin.cpp:49
Definition: bcs-plugin.h:23
base class of barcode scanner plugins
Definition: barcode-plugin.h:69
MHidBarcodePlugin()
Definition: bcs-plugin.cpp:21
virtual ~MHidBarcodePlugin()
Definition: bcs-plugin.cpp:37
Definition: hidscanner.h:23
#define MBarcodePlugin_IID
Definition: barcode-plugin.h:108
Scanner Configuration Dialog.
Definition: barcode-plugin.h:26