Okular

pagetransition.h
1 /*
2  SPDX-FileCopyrightText: 2005 Tobias Koenig <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #ifndef _OKULAR_PAGETRANSITION_H_
8 #define _OKULAR_PAGETRANSITION_H_
9 
10 #include "okularcore_export.h"
11 
12 namespace Okular
13 {
14 /**
15  * @short Information object for the transition effect of a page.
16  *
17  * This class encapsulates the information about the effect of
18  * a page transition. It supports mainly the transition effects as
19  * defined in PDF specification 1.6.
20  */
21 class OKULARCORE_EXPORT PageTransition
22 {
23 public:
24  /**
25  * Describes the type of transition effect.
26  */
27  enum Type { Replace, Split, Blinds, Box, Wipe, Dissolve, Glitter, Fly, Push, Cover, Uncover, Fade };
28 
29  /**
30  * Describes the alignment that is applied to the @ref Type
31  * of transition effect.
32  */
33  enum Alignment { Horizontal, Vertical };
34 
35  /**
36  * Describes the direction that is applied to the @ref Type
37  * of transition effect.
38  */
39  enum Direction { Inward, Outward };
40 
41  /**
42  * Creates a new page transition of the given @p type.
43  *
44  * If no type is given, the normal @ref Replace transition is used.
45  */
46  explicit PageTransition(Type type = Replace);
47 
48  /**
49  * Creates a new page transition from an @p other.
50  */
51  PageTransition(const PageTransition &other);
52  PageTransition &operator=(const PageTransition &other);
53 
54  /**
55  * Destroys the page transition.
56  */
57  ~PageTransition();
58 
59  /**
60  * Returns the type of the transition.
61  */
62  Type type() const;
63 
64  /**
65  * Returns the duration of the transition in seconds.
66  */
67  double duration() const;
68 
69  /**
70  * Returns the alignment of the transition.
71  */
72  Alignment alignment() const;
73 
74  /**
75  * Returns the direction of motion of the transition.
76  */
77  Direction direction() const;
78 
79  /**
80  * Returns the angle of rotation of the transition.
81  */
82  int angle() const;
83 
84  /**
85  * Returns the starting or ending scale (Only if type == 'Fly').
86  */
87  double scale() const;
88 
89  /**
90  * Returns true if the area to be flown is rectangular and opaque (Only if type == 'Fly').
91  */
92  bool isRectangular() const;
93 
94  /**
95  * Sets the @p type of the transition (@ref Type).
96  */
97  void setType(Type type);
98 
99  /**
100  * Sets the @p duration in seconds for the transition.
101  */
102  void setDuration(double duration);
103 
104  /**
105  * Sets the @p alignment of the transition (@ref Alignment).
106  */
107  void setAlignment(Alignment alignment);
108 
109  /**
110  * Sets the @p direction of the transition (@see Direction).
111  */
112  void setDirection(Direction direction);
113 
114  /**
115  * Sets the moving @p angle of the transition.
116  */
117  void setAngle(int angle);
118 
119  /**
120  * Sets the starting or ending scale of the transition (Only if type == 'Fly').
121  */
122  void setScale(double scale);
123 
124  /**
125  * Sets whether the area to be flown is rectangular and opaque (Only if type == 'Fly').
126  */
127  void setIsRectangular(bool rectangular);
128 
129 private:
130  class Private;
131  Private *const d;
132 };
133 
134 }
135 
136 #endif
Direction
Alignment
Describes the alignment that is applied to the Type of transition effect.
The documentation to the global Okular namespace.
Definition: action.h:16
Information object for the transition effect of a page.
Direction
Describes the direction that is applied to the Type of transition effect.
Type
Describes the type of transition effect.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Mar 27 2023 04:09:00 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.