2021-05-24 09:28:38 +00:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2008 Tobias Koenig <tokoe@kde.org>
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2008-09-19 09:21:20 +00:00
|
|
|
|
|
|
|
#ifndef FAXDOCUMENT_H
|
|
|
|
#define FAXDOCUMENT_H
|
|
|
|
|
2018-08-31 09:23:45 +00:00
|
|
|
#include <QImage>
|
2008-09-19 09:21:20 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Loads a G3/G4 fax document and provides methods
|
|
|
|
* to convert it into a QImage.
|
|
|
|
*/
|
|
|
|
class FaxDocument
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Describes the type of the fax document.
|
|
|
|
*/
|
|
|
|
enum DocumentType {
|
|
|
|
G3, ///< G3 encoded fax document
|
|
|
|
G4 ///< G4 encoded fax document
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a new fax document from the given @p fileName.
|
|
|
|
*
|
2018-10-19 06:00:06 +00:00
|
|
|
* @param fileName The name of the fax file.
|
2008-09-19 09:21:20 +00:00
|
|
|
* @param type The type of the fax document.
|
|
|
|
*/
|
2010-04-02 19:03:57 +00:00
|
|
|
explicit FaxDocument(const QString &fileName, DocumentType type = G3);
|
2008-09-19 09:21:20 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Destroys the fax document.
|
|
|
|
*/
|
|
|
|
~FaxDocument();
|
|
|
|
|
2019-12-18 11:51:13 +00:00
|
|
|
FaxDocument(const FaxDocument &) = delete;
|
|
|
|
FaxDocument &operator=(const FaxDocument &) = delete;
|
|
|
|
|
2008-09-19 09:21:20 +00:00
|
|
|
/**
|
|
|
|
* Loads the document.
|
|
|
|
*
|
|
|
|
* @return @c true if the document can be loaded successfully, @c false otherwise.
|
|
|
|
*/
|
|
|
|
bool load();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the document as an image.
|
|
|
|
*/
|
|
|
|
QImage image() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
class Private;
|
|
|
|
Private *const d;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|