Okular

pagetransition.cpp
1/*
2 SPDX-FileCopyrightText: 2005 Tobias Koenig <tokoe@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7// local includes
8#include "pagetransition.h"
9
10using namespace Okular;
11
12/** class Okular::PageTransition **/
13
14class PageTransition::Private
15{
16public:
17 explicit Private(Type type)
18 : m_type(type)
19 , m_duration(1)
20 , m_alignment(Horizontal)
21 , m_direction(Inward)
22 , m_angle(0)
23 , m_scale(1.0)
24 , m_rectangular(false)
25 {
26 }
27
28 Type m_type;
29 double m_duration;
30 Alignment m_alignment;
31 Direction m_direction;
32 int m_angle;
33 double m_scale;
34 bool m_rectangular;
35};
36
38 : d(new Private(type))
39{
40}
41
43 : d(new Private(*other.d))
44{
45}
46
47PageTransition &PageTransition::operator=(const PageTransition &other)
48{
49 if (this == &other) {
50 return *this;
51 }
52
53 *d = *other.d;
54
55 return *this;
56}
57
59{
60 delete d;
61}
62
64{
65 return d->m_type;
66}
67
69{
70 return d->m_duration;
71}
72
74{
75 return d->m_alignment;
76}
77
79{
80 return d->m_direction;
81}
82
84{
85 return d->m_angle;
86}
87
89{
90 return d->m_scale;
91}
92
94{
95 return d->m_rectangular;
96}
97
99{
100 d->m_type = type;
101}
102
103void PageTransition::setDuration(double duration)
104{
105 d->m_duration = duration;
106}
107
109{
110 d->m_alignment = alignment;
111}
112
114{
115 d->m_direction = direction;
116}
117
119{
120 d->m_angle = angle;
121}
122
123void PageTransition::setScale(double scale)
124{
125 d->m_scale = scale;
126}
127
129{
130 d->m_rectangular = rectangular;
131}
Information object for the transition effect of a page.
Alignment alignment() const
Returns the alignment of the transition.
void setAlignment(Alignment alignment)
Sets the alignment of the transition (Alignment).
void setDirection(Direction direction)
Sets the direction of the transition (.
void setAngle(int angle)
Sets the moving angle of the transition.
Type
Describes the type of transition effect.
bool isRectangular() const
Returns true if the area to be flown is rectangular and opaque (Only if type == 'Fly').
double duration() const
Returns the duration of the transition in seconds.
Direction
Describes the direction that is applied to the Type of transition effect.
void setIsRectangular(bool rectangular)
Sets whether the area to be flown is rectangular and opaque (Only if type == 'Fly').
void setType(Type type)
Sets the type of the transition (Type).
~PageTransition()
Destroys the page transition.
double scale() const
Returns the starting or ending scale (Only if type == 'Fly').
void setDuration(double duration)
Sets the duration in seconds for the transition.
Alignment
Describes the alignment that is applied to the Type of transition effect.
Direction direction() const
Returns the direction of motion of the transition.
void setScale(double scale)
Sets the starting or ending scale of the transition (Only if type == 'Fly').
int angle() const
Returns the angle of rotation of the transition.
PageTransition(Type type=Replace)
Creates a new page transition of the given type.
Type type() const
Returns the type of the transition.
global.h
Definition action.h:17
Horizontal
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:17:35 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.