2005-01-02 20:32:58 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2005 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. *
|
|
|
|
***************************************************************************/
|
|
|
|
|
2006-11-27 08:04:41 +00:00
|
|
|
#ifndef _OKULAR_PAGETRANSITION_H_
|
|
|
|
#define _OKULAR_PAGETRANSITION_H_
|
2005-01-02 20:32:58 +00:00
|
|
|
|
2007-01-03 14:30:48 +00:00
|
|
|
#include <okular/core/okular_export.h>
|
2006-05-08 20:12:04 +00:00
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
namespace Okular {
|
|
|
|
|
2005-01-02 20:32:58 +00:00
|
|
|
/**
|
|
|
|
* @short Information object for the transition effect of a page.
|
2006-11-27 08:04:41 +00:00
|
|
|
*
|
|
|
|
* This class encapsulates the information about the effect of
|
|
|
|
* a page transition. It supports mainly the transition effects as
|
|
|
|
* defined in PDF specification 1.6.
|
2005-01-02 20:32:58 +00:00
|
|
|
*/
|
2006-09-21 08:45:36 +00:00
|
|
|
class OKULAR_EXPORT PageTransition
|
2005-01-02 20:32:58 +00:00
|
|
|
{
|
|
|
|
public:
|
2006-11-27 08:04:41 +00:00
|
|
|
/**
|
|
|
|
* Describes the type of transition effect.
|
|
|
|
*/
|
2005-01-02 20:32:58 +00:00
|
|
|
enum Type {
|
|
|
|
Replace,
|
|
|
|
Split,
|
|
|
|
Blinds,
|
|
|
|
Box,
|
|
|
|
Wipe,
|
|
|
|
Dissolve,
|
|
|
|
Glitter,
|
|
|
|
Fly,
|
|
|
|
Push,
|
|
|
|
Cover,
|
|
|
|
Uncover,
|
|
|
|
Fade
|
|
|
|
};
|
|
|
|
|
2006-11-27 08:04:41 +00:00
|
|
|
/**
|
2007-01-13 22:55:00 +00:00
|
|
|
* Describes the alignment that is applied to the @ref Type
|
2006-11-27 08:04:41 +00:00
|
|
|
* of transition effect.
|
|
|
|
*/
|
2005-01-02 20:32:58 +00:00
|
|
|
enum Alignment {
|
|
|
|
Horizontal,
|
|
|
|
Vertical
|
|
|
|
};
|
|
|
|
|
2006-11-27 08:04:41 +00:00
|
|
|
/**
|
2007-01-13 22:55:00 +00:00
|
|
|
* Describes the direction that is applied to the @ref Type
|
2006-11-27 08:04:41 +00:00
|
|
|
* of transition effect.
|
|
|
|
*/
|
2005-01-02 20:32:58 +00:00
|
|
|
enum Direction {
|
|
|
|
Inward,
|
|
|
|
Outward
|
|
|
|
};
|
|
|
|
|
2006-11-27 08:04:41 +00:00
|
|
|
/**
|
|
|
|
* Creates a new page transition of the given @p type.
|
|
|
|
*
|
2007-01-13 22:55:00 +00:00
|
|
|
* If no type is given, the normal @ref Replace transition is used.
|
2006-11-27 08:04:41 +00:00
|
|
|
*/
|
2006-09-21 08:45:36 +00:00
|
|
|
PageTransition( Type type = Replace );
|
2005-01-02 20:32:58 +00:00
|
|
|
|
2006-11-27 08:04:41 +00:00
|
|
|
/**
|
|
|
|
* Creates a new page transition from an @p other.
|
|
|
|
*/
|
|
|
|
PageTransition( const PageTransition &other );
|
|
|
|
PageTransition& operator=( const PageTransition &other );
|
2005-01-02 20:32:58 +00:00
|
|
|
|
2006-11-27 08:04:41 +00:00
|
|
|
/**
|
|
|
|
* Destroys the page transition.
|
|
|
|
*/
|
|
|
|
~PageTransition();
|
2005-01-02 20:32:58 +00:00
|
|
|
|
2006-11-27 08:04:41 +00:00
|
|
|
/**
|
|
|
|
* Returns the type of the transition.
|
|
|
|
*/
|
|
|
|
Type type() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the duration of the transition in seconds.
|
|
|
|
*/
|
|
|
|
int duration() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the alignment of the transition.
|
|
|
|
*/
|
|
|
|
Alignment alignment() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the direction of motion of the transition.
|
|
|
|
*/
|
|
|
|
Direction direction() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the angle of rotation of the transition.
|
|
|
|
*/
|
|
|
|
int angle() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the starting or ending scale (Only if type == 'Fly').
|
|
|
|
*/
|
|
|
|
double scale() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns true if the area to be flown is rectangular and opaque (Only if type == 'Fly').
|
|
|
|
*/
|
|
|
|
bool isRectangular() const;
|
|
|
|
|
|
|
|
/**
|
2007-01-13 22:55:00 +00:00
|
|
|
* Sets the @p type of the transition (@ref Type).
|
2006-11-27 08:04:41 +00:00
|
|
|
*/
|
|
|
|
void setType( Type type );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the @p duration in seconds for the transition.
|
|
|
|
*/
|
|
|
|
void setDuration( int duration );
|
|
|
|
|
|
|
|
/**
|
2007-01-13 22:55:00 +00:00
|
|
|
* Sets the @p alignment of the transition (@ref Alignment).
|
2006-11-27 08:04:41 +00:00
|
|
|
*/
|
|
|
|
void setAlignment( Alignment alignment );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the @p direction of the transition (@see Direction).
|
|
|
|
*/
|
|
|
|
void setDirection( Direction direction );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the moving @p angle of the transition.
|
|
|
|
*/
|
|
|
|
void setAngle( int angle );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the starting or ending scale of the transition (Only if type == 'Fly').
|
|
|
|
*/
|
|
|
|
void setScale( double scale );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets whether the area to be flown is rectangular and opaque (Only if type == 'Fly').
|
|
|
|
*/
|
|
|
|
void setIsRectangular( bool rectangular );
|
2005-01-02 20:32:58 +00:00
|
|
|
|
|
|
|
private:
|
2006-11-27 08:04:41 +00:00
|
|
|
class Private;
|
|
|
|
Private* const d;
|
2005-01-02 20:32:58 +00:00
|
|
|
};
|
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
}
|
|
|
|
|
2005-01-02 20:32:58 +00:00
|
|
|
#endif
|