<commit_before>#ifndef QZXING_H
#define QZXING_H

#include "QZXing_global.h"
#include <QObject>
#include <QImage>

#if QT_VERSION >= 0x040700 && QT_VERSION < 0x050000
#include <QtDeclarative>
#elif QT_VERSION >= 0x050000
#include <QtQml/qqml.h>
#include <QQuickView>
#include <QQmlEngine>
#endif

#include "QZXingImageProvider.h"

// forward declaration
namespace zxing {
class MultiFormatReader;
}
class ImageHandler;

/**
  * A class containing a very very small subset of the ZXing library.
  * Created for ease of use.
  *
  * Anyone interested in using more technical stuff
  * from the ZXing library is welcomed to add/edit on free will.
  *
  * Regarding DecoderFormat, by default all of those are enabled (except DataMatrix will is still not supported)
  */
class
        #ifndef DISABLE_LIBRARY_FEATURES
        QZXINGSHARED_EXPORT
        #endif
        QZXing : public QObject {

    Q_OBJECT
    Q_ENUMS(DecoderFormat)
    Q_PROPERTY(int processingTime READ getProcessTimeOfLastDecoding)
    Q_PROPERTY(uint enabledDecoders READ getEnabledFormats WRITE setDecoder NOTIFY enabledFormatsChanged)

public:
    /*
     *
     */
    enum DecoderFormat {
        DecoderFormat_None = 0,
        DecoderFormat_Aztec = 1 << 1,
        DecoderFormat_CODABAR = 1 << 2,
        DecoderFormat_CODE_39 = 1 << 3,
        DecoderFormat_CODE_93 = 1 << 4,
        DecoderFormat_CODE_128 = 1 << 5,
        DecoderFormat_DATA_MATRIX = 1 << 6,
        DecoderFormat_EAN_8 = 1 << 7,
        DecoderFormat_EAN_13 = 1 << 8,
        DecoderFormat_ITF = 1 << 9,
        DecoderFormat_MAXICODE = 1 << 10,
        DecoderFormat_PDF_417 = 1 << 11,
        DecoderFormat_QR_CODE = 1 << 12,
        DecoderFormat_RSS_14 = 1 << 13,
        DecoderFormat_RSS_EXPANDED = 1 << 14,
        DecoderFormat_UPC_A = 1 << 15,
        DecoderFormat_UPC_E = 1 << 16,
        DecoderFormat_UPC_EAN_EXTENSION = 1 << 17
    } ;
    typedef unsigned int DecoderFormatType;

    QZXing(QObject *parent = NULL);
    ~QZXing();

    QZXing(DecoderFormat decodeHints, QObject *parent = NULL);

#if QT_VERSION >= 0x040700
    static void registerQMLTypes()
    {
        qmlRegisterType<QZXing>("QZXing", 2, 3, "QZXing");
    }
#endif

#if  QT_VERSION >= 0x050000
    static void registerQMLImageProvider(const QQuickView& view)
    {
        QQmlEngine *engine = view.engine();
        engine->addImageProvider(QLatin1String("QZXing"), QZXingImageProvider::getInstance());
    }
#endif

    void setTryHarder(bool tryHarder);
    bool getTryHarder();
    static QString decoderFormatToString(int fmt);
    QString foundedFormat() const;
    QString charSet() const;

public slots:<commit_msg>Make QZXing's tryHarder, charSet and foundedFormat accessible from QML<commit_after>#ifndef QZXING_H
#define QZXING_H

#include "QZXing_global.h"
#include <QObject>
#include <QImage>

#if QT_VERSION >= 0x040700 && QT_VERSION < 0x050000
#include <QtDeclarative>
#elif QT_VERSION >= 0x050000
#include <QtQml/qqml.h>
#include <QQuickView>
#include <QQmlEngine>
#endif

#include "QZXingImageProvider.h"

// forward declaration
namespace zxing {
class MultiFormatReader;
}
class ImageHandler;

/**
  * A class containing a very very small subset of the ZXing library.
  * Created for ease of use.
  *
  * Anyone interested in using more technical stuff
  * from the ZXing library is welcomed to add/edit on free will.
  *
  * Regarding DecoderFormat, by default all of those are enabled (except DataMatrix will is still not supported)
  */
class
        #ifndef DISABLE_LIBRARY_FEATURES
        QZXINGSHARED_EXPORT
        #endif
        QZXing : public QObject {

    Q_OBJECT
    Q_ENUMS(DecoderFormat)
    Q_PROPERTY(int processingTime READ getProcessTimeOfLastDecoding)
    Q_PROPERTY(uint enabledDecoders READ getEnabledFormats WRITE setDecoder NOTIFY enabledFormatsChanged)
    Q_PROPERTY(bool tryHarder READ getTryHarder WRITE setTryHarder)

public:
    /*
     *
     */
    enum DecoderFormat {
        DecoderFormat_None = 0,
        DecoderFormat_Aztec = 1 << 1,
        DecoderFormat_CODABAR = 1 << 2,
        DecoderFormat_CODE_39 = 1 << 3,
        DecoderFormat_CODE_93 = 1 << 4,
        DecoderFormat_CODE_128 = 1 << 5,
        DecoderFormat_DATA_MATRIX = 1 << 6,
        DecoderFormat_EAN_8 = 1 << 7,
        DecoderFormat_EAN_13 = 1 << 8,
        DecoderFormat_ITF = 1 << 9,
        DecoderFormat_MAXICODE = 1 << 10,
        DecoderFormat_PDF_417 = 1 << 11,
        DecoderFormat_QR_CODE = 1 << 12,
        DecoderFormat_RSS_14 = 1 << 13,
        DecoderFormat_RSS_EXPANDED = 1 << 14,
        DecoderFormat_UPC_A = 1 << 15,
        DecoderFormat_UPC_E = 1 << 16,
        DecoderFormat_UPC_EAN_EXTENSION = 1 << 17
    } ;
    typedef unsigned int DecoderFormatType;

    QZXing(QObject *parent = NULL);
    ~QZXing();

    QZXing(DecoderFormat decodeHints, QObject *parent = NULL);

#if QT_VERSION >= 0x040700
    static void registerQMLTypes()
    {
        qmlRegisterType<QZXing>("QZXing", 2, 3, "QZXing");
    }
#endif

#if  QT_VERSION >= 0x050000
    static void registerQMLImageProvider(const QQuickView& view)
    {
        QQmlEngine *engine = view.engine();
        engine->addImageProvider(QLatin1String("QZXing"), QZXingImageProvider::getInstance());
    }
#endif

    void setTryHarder(bool tryHarder);
    bool getTryHarder();
    static QString decoderFormatToString(int fmt);
    Q_INVOKABLE QString foundedFormat() const;
    Q_INVOKABLE QString charSet() const;

public slots:
{'fraction_non_alphanumeric': 0.08756182450998351, 'fraction_numerical': 0.035171276790620994, 'mean_word_length': 3.2490272373540856, 'pattern_counts': {'":': 0, '<': 87, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3544216', 'n_tokens_mistral': 2014, 'n_tokens_neox': 1766, 'n_words': 457}