/usr/include/zbar/QZBar.h is in libzbarqt-dev 0.10+doc-10.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | //------------------------------------------------------------------------
// Copyright 2008-2009 (c) Jeff Brown <spadix@users.sourceforge.net>
//
// This file is part of the ZBar Bar Code Reader.
//
// The ZBar Bar Code Reader is free software; you can redistribute it
// and/or modify it under the terms of the GNU Lesser Public License as
// published by the Free Software Foundation; either version 2.1 of
// the License, or (at your option) any later version.
//
// The ZBar Bar Code Reader is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser Public License for more details.
//
// You should have received a copy of the GNU Lesser Public License
// along with the ZBar Bar Code Reader; if not, write to the Free
// Software Foundation, Inc., 51 Franklin St, Fifth Floor,
// Boston, MA 02110-1301 USA
//
// http://sourceforge.net/projects/zbar
//------------------------------------------------------------------------
#ifndef _QZBAR_H_
#define _QZBAR_H_
/// @file
/// Barcode Reader Qt4 Widget
#include <qwidget.h>
namespace zbar {
class QZBarThread;
/// barcode reader Qt4 widget.
/// embeds a barcode reader directly into a Qt4 based GUI. the widget
/// can process barcodes from a video source (using the QZBar::videoDevice
/// and QZBar::videoEnabled properties) or from individual QImages
/// supplied to the QZBar::scanImage() slot
/// @since 1.5
class QZBar : public QWidget
{
Q_OBJECT
/// the currently opened video device.
///
/// setting a new device opens it and automatically sets
/// QZBar::videoEnabled
///
/// @see videoDevice(), setVideoDevice()
Q_PROPERTY(QString videoDevice
READ videoDevice
WRITE setVideoDevice
DESIGNABLE false)
/// video device streaming state.
///
/// use to pause/resume video scanning.
///
/// @see isVideoEnabled(), setVideoEnabled()
Q_PROPERTY(bool videoEnabled
READ isVideoEnabled
WRITE setVideoEnabled
DESIGNABLE false)
/// video device opened state.
///
/// (re)setting QZBar::videoDevice should eventually cause it
/// to be opened or closed. any errors while streaming/scanning
/// will also cause the device to be closed
///
/// @see isVideoOpened()
Q_PROPERTY(bool videoOpened
READ isVideoOpened
DESIGNABLE false)
public:
/// constructs a barcode reader widget with the given @a parent
QZBar(QWidget *parent = NULL);
~QZBar();
/// retrieve the currently opened video device.
/// @returns the current video device or the empty string if no
/// device is opened
QString videoDevice() const;
/// retrieve the current video enabled state.
/// @returns true if video scanning is currently enabled, false
/// otherwise
bool isVideoEnabled() const;
/// retrieve the current video opened state.
/// @returns true if video device is currently opened, false otherwise
bool isVideoOpened() const;
/// @{
/// @internal
QSize sizeHint() const;
int heightForWidth(int) const;
QPaintEngine *paintEngine() const;
/// @}
public Q_SLOTS:
/// open a new video device.
///
/// use an empty string to close a currently opened device.
///
/// @note since opening a device may take some time, this call will
/// return immediately and the device will be opened asynchronously
void setVideoDevice(const QString &videoDevice);
/// enable/disable video scanning.
/// has no effect unless a video device is opened
void setVideoEnabled(bool videoEnabled = true);
/// scan for barcodes in a QImage.
void scanImage(const QImage &image);
Q_SIGNALS:
/// emitted when when a video device is opened or closed.
///
/// (re)setting QZBar::videoDevice should eventually cause it
/// to be opened or closed. any errors while streaming/scanning
/// will also cause the device to be closed
void videoOpened(bool videoOpened);
/// emitted when a barcode is decoded from an image.
/// the symbol type and contained data are provided as separate
/// parameters.
void decoded(int type, const QString &data);
/// emitted when a barcode is decoded from an image.
/// the symbol type name is prefixed to the data, separated by a
/// colon
void decodedText(const QString &text);
/// @{
/// @internal
protected:
void attach();
void showEvent(QShowEvent*);
void paintEvent(QPaintEvent*);
void resizeEvent(QResizeEvent*);
void changeEvent(QEvent*);
void dragEnterEvent(QDragEnterEvent*);
void dropEvent(QDropEvent*);
protected Q_SLOTS:
void sizeChange();
/// @}
private:
QZBarThread *thread;
QString _videoDevice;
bool _videoEnabled;
bool _attached;
};
};
#endif
|