/*
 * "lpinfo" command for CUPS.
 *
 * Copyright © 2007-2018 by Apple Inc.
 * Copyright © 1997-2006 by Easy Software Products.
 *
 * Licensed under Apache License v2.0.  See the file "LICENSE" for more
 * information.
 */

#ifndef LPINFO_BROWSER_H
#define LPINFO_BROWSER_H

#include <QObject>
#include <QString>
#include <QList>
#include <cups/http.h>

/**
 * @brief lpinfo -v 获取信息接口 以后可能会和ippfind合并
 * 
 */

struct usb_device_info
{
    QString device_id;
    QString uri;
};

class LpinfoBrowser: public QObject
{
    Q_OBJECT
private:
    int	show_devices(int long_status, int timeout,
                     const char *include_schemes,
                     const char *exclude_schemes);
    LpinfoBrowser(/* args */);

public:
    static LpinfoBrowser *getInstance();
    QList<usb_device_info> listUsbDevices();
    static QStringList findRemotePrinter(const QString &host, const int port);
    ~LpinfoBrowser();

signals:
    void browse();
    void findLpinfoDevice(const QString &);
};

#endif // LPINFO_BROWSER_H