Coverage Report

Created: 2025-12-31 07:23

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/poppler/cpp/poppler-page-transition.cpp
Line
Count
Source
1
/*
2
 * Copyright (C) 2009-2010, Pino Toscano <pino@kde.org>
3
 * Copyright (C) 2011, 2021, 2022, Albert Astals Cid <aacid@kde.org>
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation; either version 2, or (at your option)
8
 * any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
18
 */
19
20
/**
21
 \file poppler-page-transition.h
22
 */
23
#include "poppler-page-transition.h"
24
25
#include "PageTransition.h"
26
27
using namespace poppler;
28
29
class poppler::page_transition_private
30
{
31
public:
32
0
    explicit page_transition_private(Object *trans) : pt(trans) { }
33
34
    PageTransition pt;
35
};
36
37
/**
38
 \class poppler::page_transition poppler-page-transition.h "poppler/cpp/poppler-page-transition.h"
39
40
 A transition between two pages in a PDF %document.
41
42
 Usually shown in a presentation mode of a PDF viewer.
43
 */
44
45
/**
46
 \enum poppler::page_transition::type_enum
47
48
 The possible types of a %page transition.
49
*/
50
51
/**
52
 \enum poppler::page_transition::alignment_enum
53
54
 The alignment of a %page transition.
55
*/
56
57
/**
58
 \enum poppler::page_transition::direction_enum
59
60
 The direction of an animation in a %page transition.
61
*/
62
63
0
page_transition::page_transition(Object *params) : d(new page_transition_private(params)) { }
64
65
/**
66
 Copy constructor.
67
 */
68
0
page_transition::page_transition(const page_transition &pt) : d(new page_transition_private(*pt.d)) { }
69
70
/**
71
 Destructor.
72
 */
73
page_transition::~page_transition()
74
0
{
75
0
    delete d;
76
0
}
77
78
page_transition::type_enum page_transition::type() const
79
0
{
80
0
    return (page_transition::type_enum)d->pt.getType();
81
0
}
82
83
int page_transition::duration() const
84
0
{
85
0
    return static_cast<int>(d->pt.getDuration());
86
0
}
87
88
double page_transition::durationReal() const
89
0
{
90
0
    return d->pt.getDuration();
91
0
}
92
93
page_transition::alignment_enum page_transition::alignment() const
94
0
{
95
0
    return (page_transition::alignment_enum)d->pt.getAlignment();
96
0
}
97
98
page_transition::direction_enum page_transition::direction() const
99
0
{
100
0
    return (page_transition::direction_enum)d->pt.getDirection();
101
0
}
102
103
int page_transition::angle() const
104
0
{
105
0
    return d->pt.getAngle();
106
0
}
107
108
double page_transition::scale() const
109
0
{
110
0
    return d->pt.getScale();
111
0
}
112
113
bool page_transition::is_rectangular() const
114
0
{
115
0
    return d->pt.isRectangular();
116
0
}
117
118
page_transition &page_transition::operator=(const page_transition &pt)
119
0
{
120
0
    if (&pt != this) {
121
0
        page_transition_private *new_d = new page_transition_private(*pt.d);
122
0
        delete d;
123
0
        d = new_d;
124
0
    }
125
0
    return *this;
126
0
}