/src/poppler/qt6/src/poppler-page-transition.cc
Line | Count | Source |
1 | | /* PageTransition.cc |
2 | | * Copyright (C) 2005, Net Integration Technologies, Inc. |
3 | | * Copyright (C) 2015, Arseniy Lartsev <arseniy@alumni.chalmers.se> |
4 | | * Copyright (C) 2018, 2021 Albert Astals Cid <aacid@kde.org> |
5 | | * |
6 | | * This program is free software; you can redistribute it and/or modify |
7 | | * it under the terms of the GNU General Public License as published by |
8 | | * the Free Software Foundation; either version 2, or (at your option) |
9 | | * any later version. |
10 | | * |
11 | | * This program is distributed in the hope that it will be useful, |
12 | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | | * GNU General Public License for more details. |
15 | | * |
16 | | * You should have received a copy of the GNU General Public License |
17 | | * along with this program; if not, write to the Free Software |
18 | | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. |
19 | | */ |
20 | | |
21 | | #include "PageTransition.h" |
22 | | #include "poppler-page-transition.h" |
23 | | #include "poppler-page-transition-private.h" |
24 | | |
25 | | namespace Poppler { |
26 | | |
27 | | class PageTransitionData |
28 | | { |
29 | | public: |
30 | 0 | explicit PageTransitionData(Object *trans) { pt = new ::PageTransition(trans); } |
31 | | |
32 | 0 | PageTransitionData(const PageTransitionData &ptd) { pt = new ::PageTransition(*ptd.pt); } |
33 | | |
34 | 0 | ~PageTransitionData() { delete pt; } |
35 | | |
36 | | PageTransitionData &operator=(const PageTransitionData &) = delete; |
37 | | |
38 | | ::PageTransition *pt; |
39 | | }; |
40 | | |
41 | | PageTransition::PageTransition(const PageTransitionParams params) |
42 | 0 | { |
43 | 0 | data = new PageTransitionData(params.dictObj); |
44 | 0 | } |
45 | | |
46 | | PageTransition::PageTransition(const PageTransition &pt) |
47 | 0 | { |
48 | 0 | data = new PageTransitionData(*pt.data); |
49 | 0 | } |
50 | | |
51 | | PageTransition::~PageTransition() |
52 | 0 | { |
53 | 0 | delete data; |
54 | 0 | } |
55 | | |
56 | | PageTransition &PageTransition::operator=(const PageTransition &other) |
57 | 0 | { |
58 | 0 | if (this != &other) { |
59 | 0 | delete data; |
60 | 0 | data = new PageTransitionData(*other.data); |
61 | 0 | } |
62 | |
|
63 | 0 | return *this; |
64 | 0 | } |
65 | | |
66 | | PageTransition::Type PageTransition::type() const |
67 | 0 | { |
68 | 0 | return static_cast<Poppler::PageTransition::Type>(data->pt->getType()); |
69 | 0 | } |
70 | | |
71 | | double PageTransition::durationReal() const |
72 | 0 | { |
73 | 0 | return data->pt->getDuration(); |
74 | 0 | } |
75 | | |
76 | | PageTransition::Alignment PageTransition::alignment() const |
77 | 0 | { |
78 | 0 | return static_cast<Poppler::PageTransition::Alignment>(data->pt->getAlignment()); |
79 | 0 | } |
80 | | |
81 | | PageTransition::Direction PageTransition::direction() const |
82 | 0 | { |
83 | 0 | return static_cast<Poppler::PageTransition::Direction>(data->pt->getDirection()); |
84 | 0 | } |
85 | | |
86 | | int PageTransition::angle() const |
87 | 0 | { |
88 | 0 | return data->pt->getAngle(); |
89 | 0 | } |
90 | | |
91 | | double PageTransition::scale() const |
92 | 0 | { |
93 | 0 | return data->pt->getScale(); |
94 | 0 | } |
95 | | bool PageTransition::isRectangular() const |
96 | 0 | { |
97 | 0 | return data->pt->isRectangular(); |
98 | 0 | } |
99 | | |
100 | | } |