/src/poppler/poppler/PageTransition.h
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) 2019, 2021, 2026, 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 | | #ifndef PAGE_TRANSITION_H |
22 | | #define PAGE_TRANSITION_H |
23 | | |
24 | | #include "poppler_private_export.h" |
25 | | |
26 | | class Object; |
27 | | |
28 | | //------------------------------------------------------------------------ |
29 | | // PageTransition |
30 | | //------------------------------------------------------------------------ |
31 | | |
32 | | // if changed remember to keep in sync with frontend enums |
33 | | enum PageTransitionType |
34 | | { |
35 | | transitionReplace = 0, |
36 | | transitionSplit, |
37 | | transitionBlinds, |
38 | | transitionBox, |
39 | | transitionWipe, |
40 | | transitionDissolve, |
41 | | transitionGlitter, |
42 | | transitionFly, |
43 | | transitionPush, |
44 | | transitionCover, |
45 | | transitionUncover, |
46 | | transitionFade |
47 | | }; |
48 | | |
49 | | // if changed remember to keep in sync with frontend enums |
50 | | enum PageTransitionAlignment |
51 | | { |
52 | | transitionHorizontal = 0, |
53 | | transitionVertical |
54 | | }; |
55 | | |
56 | | // if changed remember to keep in sync with frontend enums |
57 | | enum PageTransitionDirection |
58 | | { |
59 | | transitionInward = 0, |
60 | | transitionOutward |
61 | | }; |
62 | | |
63 | | class POPPLER_PRIVATE_EXPORT PageTransition |
64 | | { |
65 | | public: |
66 | | // Construct a Page Transition. |
67 | | explicit PageTransition(Object *trans); |
68 | | |
69 | | // Destructor. |
70 | | ~PageTransition() = default; |
71 | | |
72 | | // Was the Page Transition created successfully? |
73 | 0 | bool isOk() const { return ok; } |
74 | | |
75 | | // Get type |
76 | 0 | PageTransitionType getType() const { return type; } |
77 | | |
78 | | // Get duration |
79 | 0 | double getDuration() const { return duration; } |
80 | | |
81 | | // Get alignment |
82 | 0 | PageTransitionAlignment getAlignment() const { return alignment; } |
83 | | |
84 | | // Get direction |
85 | 0 | PageTransitionDirection getDirection() const { return direction; } |
86 | | |
87 | | // Get angle |
88 | 0 | int getAngle() const { return angle; } |
89 | | |
90 | | // Get scale |
91 | 0 | double getScale() const { return scale; } |
92 | | |
93 | | // Is rectangular? |
94 | 0 | bool isRectangular() const { return rectangular; } |
95 | | |
96 | | private: |
97 | | PageTransitionType type; // transition style |
98 | | double duration; // duration of the effect in seconds |
99 | | PageTransitionAlignment alignment; // dimension of the effect |
100 | | PageTransitionDirection direction; // direction of motion |
101 | | int angle; // direction in degrees |
102 | | double scale; // scale |
103 | | bool rectangular; // is the area to be flown in rectangular? |
104 | | bool ok; // set if created successfully |
105 | | }; |
106 | | |
107 | | #endif /* PAGE_TRANSITION_H */ |