2006-11-03 17:57:32 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2006 by Tobias Koenig <tokoe@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. *
|
|
|
|
***************************************************************************/
|
|
|
|
|
2007-07-15 13:53:26 +00:00
|
|
|
#ifndef _OKULAR_ROTATIONJOB_P_H_
|
|
|
|
#define _OKULAR_ROTATIONJOB_P_H_
|
2006-11-03 17:57:32 +00:00
|
|
|
|
|
|
|
#include <QtGui/QImage>
|
2007-09-03 18:16:27 +00:00
|
|
|
#include <QtGui/QMatrix>
|
2006-11-03 17:57:32 +00:00
|
|
|
|
2007-07-04 16:55:33 +00:00
|
|
|
#include <threadweaver/Job.h>
|
|
|
|
|
2007-01-05 17:09:47 +00:00
|
|
|
#include "core/global.h"
|
|
|
|
|
2006-11-03 17:57:32 +00:00
|
|
|
namespace Okular {
|
|
|
|
|
2007-03-24 10:47:22 +00:00
|
|
|
class PagePrivate;
|
|
|
|
|
2007-07-04 16:55:33 +00:00
|
|
|
class RotationJob : public ThreadWeaver::Job
|
2006-11-03 17:57:32 +00:00
|
|
|
{
|
2007-03-24 10:47:22 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
2006-11-03 17:57:32 +00:00
|
|
|
public:
|
2006-11-20 07:53:32 +00:00
|
|
|
RotationJob( const QImage &image, Rotation oldRotation, Rotation newRotation, int id );
|
2006-11-03 17:57:32 +00:00
|
|
|
|
2007-03-24 10:47:22 +00:00
|
|
|
void setPage( PagePrivate * pd );
|
|
|
|
|
2006-11-03 17:57:32 +00:00
|
|
|
QImage image() const;
|
2006-11-20 07:53:32 +00:00
|
|
|
Rotation rotation() const;
|
2006-11-03 17:57:32 +00:00
|
|
|
int id() const;
|
2007-03-24 10:47:22 +00:00
|
|
|
PagePrivate * page() const;
|
2006-11-03 17:57:32 +00:00
|
|
|
|
2007-09-03 18:16:27 +00:00
|
|
|
static QMatrix rotationMatrix( Rotation from, Rotation to );
|
|
|
|
|
2006-11-03 17:57:32 +00:00
|
|
|
protected:
|
|
|
|
virtual void run();
|
|
|
|
|
|
|
|
private:
|
|
|
|
const QImage mImage;
|
2006-11-20 07:53:32 +00:00
|
|
|
Rotation mOldRotation;
|
|
|
|
Rotation mNewRotation;
|
2006-11-03 17:57:32 +00:00
|
|
|
int mId;
|
|
|
|
QImage mRotatedImage;
|
2007-03-24 10:47:22 +00:00
|
|
|
PagePrivate * m_pd;
|
2006-11-03 17:57:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|