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
|
|
|
|
|
|
|
// local includes
|
|
|
|
#include "pagetransition.h"
|
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
using namespace Okular;
|
|
|
|
|
2006-09-21 09:33:56 +00:00
|
|
|
/** class Okular::PageTransition **/
|
2005-01-02 20:32:58 +00:00
|
|
|
|
2006-11-27 08:04:41 +00:00
|
|
|
class PageTransition::Private
|
|
|
|
{
|
|
|
|
public:
|
2021-08-21 23:14:34 +00:00
|
|
|
explicit Private(Type type)
|
2006-11-27 08:04:41 +00:00
|
|
|
: m_type(type)
|
|
|
|
, m_duration(1)
|
|
|
|
, m_alignment(Horizontal)
|
|
|
|
, m_direction(Inward)
|
|
|
|
, m_angle(0)
|
|
|
|
, m_scale(1.0)
|
|
|
|
, m_rectangular(false)
|
|
|
|
{
|
|
|
|
}
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-11-27 08:04:41 +00:00
|
|
|
Type m_type;
|
2015-10-14 22:16:55 +00:00
|
|
|
double m_duration;
|
2006-11-27 08:04:41 +00:00
|
|
|
Alignment m_alignment;
|
|
|
|
Direction m_direction;
|
|
|
|
int m_angle;
|
|
|
|
double m_scale;
|
|
|
|
bool m_rectangular;
|
|
|
|
};
|
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
PageTransition::PageTransition(Type type)
|
2006-11-27 08:04:41 +00:00
|
|
|
: d(new Private(type))
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
PageTransition::PageTransition(const PageTransition &other)
|
2007-07-25 14:54:12 +00:00
|
|
|
: d(new Private(*other.d))
|
2006-11-27 08:04:41 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
PageTransition &PageTransition::operator=(const PageTransition &other)
|
2005-01-02 20:32:58 +00:00
|
|
|
{
|
2006-11-27 08:04:41 +00:00
|
|
|
if (this == &other) {
|
|
|
|
return *this;
|
2022-03-08 10:10:43 +00:00
|
|
|
}
|
2006-11-27 08:04:41 +00:00
|
|
|
|
|
|
|
*d = *other.d;
|
|
|
|
|
|
|
|
return *this;
|
2005-01-02 20:32:58 +00:00
|
|
|
}
|
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
PageTransition::~PageTransition()
|
2005-01-02 20:32:58 +00:00
|
|
|
{
|
2006-11-27 08:04:41 +00:00
|
|
|
delete d;
|
|
|
|
}
|
|
|
|
|
|
|
|
PageTransition::Type PageTransition::type() const
|
|
|
|
{
|
|
|
|
return d->m_type;
|
|
|
|
}
|
|
|
|
|
2015-10-14 22:16:55 +00:00
|
|
|
double PageTransition::duration() const
|
2006-11-27 08:04:41 +00:00
|
|
|
{
|
|
|
|
return d->m_duration;
|
|
|
|
}
|
|
|
|
|
|
|
|
PageTransition::Alignment PageTransition::alignment() const
|
|
|
|
{
|
|
|
|
return d->m_alignment;
|
|
|
|
}
|
|
|
|
|
|
|
|
PageTransition::Direction PageTransition::direction() const
|
|
|
|
{
|
|
|
|
return d->m_direction;
|
|
|
|
}
|
|
|
|
|
|
|
|
int PageTransition::angle() const
|
|
|
|
{
|
|
|
|
return d->m_angle;
|
|
|
|
}
|
|
|
|
|
|
|
|
double PageTransition::scale() const
|
|
|
|
{
|
|
|
|
return d->m_scale;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool PageTransition::isRectangular() const
|
|
|
|
{
|
|
|
|
return d->m_rectangular;
|
|
|
|
}
|
|
|
|
|
|
|
|
void PageTransition::setType(Type type)
|
|
|
|
{
|
|
|
|
d->m_type = type;
|
|
|
|
}
|
|
|
|
|
2015-10-14 22:16:55 +00:00
|
|
|
void PageTransition::setDuration(double duration)
|
2006-11-27 08:04:41 +00:00
|
|
|
{
|
|
|
|
d->m_duration = duration;
|
|
|
|
}
|
|
|
|
|
|
|
|
void PageTransition::setAlignment(Alignment alignment)
|
|
|
|
{
|
|
|
|
d->m_alignment = alignment;
|
2005-01-02 20:32:58 +00:00
|
|
|
}
|
2006-11-27 08:04:41 +00:00
|
|
|
|
|
|
|
void PageTransition::setDirection(Direction direction)
|
|
|
|
{
|
|
|
|
d->m_direction = direction;
|
|
|
|
}
|
|
|
|
|
|
|
|
void PageTransition::setAngle(int angle)
|
|
|
|
{
|
|
|
|
d->m_angle = angle;
|
|
|
|
}
|
|
|
|
|
|
|
|
void PageTransition::setScale(double scale)
|
|
|
|
{
|
|
|
|
d->m_scale = scale;
|
|
|
|
}
|
|
|
|
|
|
|
|
void PageTransition::setIsRectangular(bool rectangular)
|
|
|
|
{
|
|
|
|
d->m_rectangular = rectangular;
|
|
|
|
}
|