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