MagicSmoke  $VERSION$
barcode-plugin.h
Go to the documentation of this file.
1 //
2 // C++ Interface: plugin base for 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_H
14 #define MAGICSMOKE_BARCODE_PLUGIN_H
15 
16 #include "commonexport.h"
17 
18 #include <QtPlugin>
19 #include <QStringList>
20 #include <QDialog>
21 #include <QList>
22 
23 class QTabWidget;
24 
27 {
28  Q_OBJECT
29  public:
31  MBarcodeConfiguration(QWidget*parent);
32 
33  public slots:
36  void addTab(QWidget*,QString);
37  private:
38  QTabWidget*mtab;
39 };
40 
43 {
44  Q_OBJECT
45  public:
46  explicit MBarcodeScanner(QObject* parent = 0);
47 
49  virtual QString readableName()const=0;
50 
52  virtual bool isActive()const=0;
53 
54  public slots:
56  virtual void activate()=0;
58  virtual void deactivate()=0;
59  signals:
61  void activated();
63  void deactivated();
65  void newBarcode(QString);
66 };
67 
70 {
71  public:
72  virtual ~MBarcodePlugin();
73 
75  virtual void configure(MBarcodeConfiguration*)=0;
76  protected:
78  static void registerScanner(MBarcodeScanner*);
79 };
80 
84 {
85  Q_OBJECT
86  public:
88  static MBarcodeHub*instance();
89 
91  void initialize();
92 
94  QList<MBarcodeScanner*>allScanners();
95 
96  signals:
98  void newBarcode(QString);
99 
100  private slots:
102  void removePlugin(QObject*);
103  private:
104  MBarcodeHub();
105  virtual ~MBarcodeHub();
106 };
107 
108 #define MBarcodePlugin_IID "de.silmor.MagicSmoke.BarcodePlugin/1.0"
109 
111 
112 
113 #endif
#define MAGICSMOKE_COMMON_EXPORT
Definition: commonexport.h:7
base class of actual scanner implementations
Definition: barcode-plugin.h:42
central barcode scanner hub, this is used by widgets that require barcodes, plugins report (indirectl...
Definition: barcode-plugin.h:83
base class of barcode scanner plugins
Definition: barcode-plugin.h:69
#define MBarcodePlugin_IID
Definition: barcode-plugin.h:108
Scanner Configuration Dialog.
Definition: barcode-plugin.h:26
Q_DECLARE_INTERFACE(MBarcodePlugin, MBarcodePlugin_IID)