okular/generators/kimgio/generator_kimgio.h
Alex Richardson bb22f7d3f1 Don't rotate images with Qt 5.4.0 and 5.4.1
There was behaviour change that automatically rotated jpeg images based
on exif metadata that was reverted in 5.4.2.
We now skip rotating with those two version to prevent rotating twice.

Also shared some code so that the #ifdef does not need to be added to
both methods

REVIEW: 123895
2015-08-15 19:28:06 +01:00

50 lines
1.8 KiB
C++

/***************************************************************************
* Copyright (C) 2005 by Albert Astals Cid <aacid@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#ifndef _OKULAR_GENERATOR_KIMGIO_H_
#define _OKULAR_GENERATOR_KIMGIO_H_
#include <core/generator.h>
#include <core/document.h>
#include <QtGui/QImage>
class KIMGIOGenerator : public Okular::Generator
{
Q_OBJECT
Q_INTERFACES( Okular::Generator )
public:
KIMGIOGenerator( QObject *parent, const QVariantList &args );
virtual ~KIMGIOGenerator();
// [INHERITED] load a document and fill up the pagesVector
bool loadDocument( const QString & fileName, QVector<Okular::Page*> & pagesVector );
bool loadDocumentFromData( const QByteArray & fileData, QVector<Okular::Page*> & pagesVector );
// [INHERITED] print document using already configured kprinter
bool print( QPrinter& printer );
// [INHERITED] document information
Okular::DocumentInfo generateDocumentInfo( const QSet<Okular::DocumentInfo::Key> &keys ) const;
protected:
bool doCloseDocument();
QImage image( Okular::PixmapRequest * request );
private:
bool loadDocumentInternal(const QByteArray & fileData, const QString & fileName,
QVector<Okular::Page*> & pagesVector );
private:
QImage m_img;
Okular::DocumentInfo docInfo;
};
#endif