2021-05-24 07:25:56 +00:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2005 Tobias Koenig <tokoe@kde.org>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2005-01-02 20:32:58 +00:00
|
|
|
|
2006-11-27 08:04:41 +00:00
|
|
|
#ifndef _OKULAR_PAGETRANSITION_H_
|
|
|
|
#define _OKULAR_PAGETRANSITION_H_
|
2005-01-02 20:32:58 +00:00
|
|
|
|
2014-10-27 21:35:06 +00:00
|
|
|
#include "okularcore_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
|
|
|
*/
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_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 };
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2005-01-02 20:32:58 +00:00
|
|
|
* Describes the alignment that is applied to the @ref Type
|
|
|
|
* of transition effect.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2007-01-13 22:55:00 +00:00
|
|
|
enum Alignment { Horizontal, Vertical };
|
2020-07-10 22:15:05 +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 };
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-27 08:04:41 +00:00
|
|
|
/**
|
2007-01-13 22:55:00 +00:00
|
|
|
* Creates a new page transition of the given @p type.
|
2020-07-10 22:15:05 +00:00
|
|
|
*
|
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
|
|
|
*/
|
2021-08-21 23:14:34 +00:00
|
|
|
explicit PageTransition(Type type = Replace);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-27 08:04:41 +00:00
|
|
|
/**
|
|
|
|
* Creates a new page transition from an @p other.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-11-27 08:04:41 +00:00
|
|
|
PageTransition(const PageTransition &other);
|
|
|
|
PageTransition &operator=(const PageTransition &other);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-11-27 08:04:41 +00:00
|
|
|
* Destroys the page transition.
|
|
|
|
*/
|
|
|
|
~PageTransition();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-27 08:04:41 +00:00
|
|
|
/**
|
2007-01-13 22:55:00 +00:00
|
|
|
* Returns the type of the transition.
|
2006-11-27 08:04:41 +00:00
|
|
|
*/
|
2006-09-21 08:45:36 +00:00
|
|
|
Type type() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-27 08:04:41 +00:00
|
|
|
/**
|
|
|
|
* Returns the duration of the transition in seconds.
|
|
|
|
*/
|
|
|
|
double duration() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-27 08:04:41 +00:00
|
|
|
/**
|
|
|
|
* Returns the alignment of the transition.
|
|
|
|
*/
|
|
|
|
Alignment alignment() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-27 08:04:41 +00:00
|
|
|
/**
|
|
|
|
* Returns the direction of motion of the transition.
|
|
|
|
*/
|
|
|
|
Direction direction() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-27 08:04:41 +00:00
|
|
|
/**
|
|
|
|
* Returns the angle of rotation of the transition.
|
|
|
|
*/
|
|
|
|
int angle() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-27 08:04:41 +00:00
|
|
|
/**
|
|
|
|
* Returns the starting or ending scale (Only if type == 'Fly').
|
|
|
|
*/
|
|
|
|
double scale() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-27 08:04:41 +00:00
|
|
|
/**
|
|
|
|
* Returns true if the area to be flown is rectangular and opaque (Only if type == 'Fly').
|
|
|
|
*/
|
|
|
|
bool isRectangular() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-27 08:04:41 +00:00
|
|
|
/**
|
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);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-27 08:04:41 +00:00
|
|
|
/**
|
|
|
|
* Sets the @p duration in seconds for the transition.
|
|
|
|
*/
|
2015-10-14 22:16:55 +00:00
|
|
|
void setDuration(double duration);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-27 08:04:41 +00:00
|
|
|
/**
|
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);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-27 08:04:41 +00:00
|
|
|
/**
|
|
|
|
* Sets the @p direction of the transition (@see Direction).
|
|
|
|
*/
|
|
|
|
void setDirection(Direction direction);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-27 08:04:41 +00:00
|
|
|
/**
|
|
|
|
* Sets the moving @p angle of the transition.
|
|
|
|
*/
|
|
|
|
void setAngle(int angle);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-27 08:04:41 +00:00
|
|
|
/**
|
|
|
|
* Sets the starting or ending scale of the transition (Only if type == 'Fly').
|
|
|
|
*/
|
|
|
|
void setScale(double scale);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-27 08:04:41 +00:00
|
|
|
/**
|
|
|
|
* Sets whether the area to be flown is rectangular and opaque (Only if type == 'Fly').
|
|
|
|
*/
|
|
|
|
void setIsRectangular(bool rectangular);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
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
|