TDE graphics utilities
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

147 lines
3.6KB

  1. /* PageTransition.h
  2. * Copyright (C) 2005, Net Integration Technologies, Inc.
  3. * Copyright (C) 2005, Brad Hards <bradh@frogmouth.net>
  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. #ifndef __PAGETRANSITION_X_H__
  20. #define __PAGETRANSITION_X_H__
  21. namespace Poppler {
  22. class PageTransitionParams;
  23. class PageTransitionData;
  24. /**
  25. \brief Describes how a PDF file viewer shall perform the transition
  26. from one page to another
  27. In PDF files there is a way to specify if the viewer shall use
  28. certain effects to perform the transition from one page to
  29. another. This feature can be used, e.g., in a PDF-based beamer
  30. presentation.
  31. This utility class represents the transition effect, and can be
  32. used to extract the information from a PDF object.
  33. */
  34. class PageTransition {
  35. public:
  36. /** \brief transition effect that shall be used
  37. */
  38. // if changed remember to keep in sync with PageTransition.h enum
  39. enum Type {
  40. Replace = 0,
  41. Split,
  42. Blinds,
  43. Box,
  44. Wipe,
  45. Dissolve,
  46. Glitter,
  47. Fly,
  48. Push,
  49. Cover,
  50. Uncover,
  51. Fade
  52. };
  53. /** \brief alignment of the transition effect that shall be used
  54. */
  55. // if changed remember to keep in sync with PageTransition.h enum
  56. enum Alignment {
  57. Horizontal = 0,
  58. Vertical
  59. };
  60. /** \brief direction of the transition effect that shall be used
  61. */
  62. // if changed remember to keep in sync with PageTransition.h enum
  63. enum Direction {
  64. Inward = 0,
  65. Outward
  66. };
  67. /** \brief Construct a new PageTransition object from a page dictionary.
  68. Users of the library will rarely need to construct a
  69. PageTransition object themselves. Instead, the method
  70. Poppler::Page::transition() can be used to find out if a certain
  71. transition effect is specified.
  72. @warning In case or error, this method will print an error message to stderr,
  73. and construct a default object.
  74. @param params an object whose dictionary will be read and
  75. parsed. This must be a valid object, whose dictionaries are
  76. accessed by the constructor. The object is only accessed by this
  77. constructor, and may be deleted after the constructor returns.
  78. */
  79. PageTransition(const PageTransitionParams &params);
  80. /** \brief copy constructor */
  81. PageTransition(const PageTransition &pt);
  82. /**
  83. Destructor
  84. */
  85. ~PageTransition();
  86. /**
  87. \brief Get type of the transition.
  88. */
  89. Type type() const;
  90. /**
  91. \brief Get duration of the transition in seconds.
  92. */
  93. int duration() const;
  94. /**
  95. \brief Get dimension in which the transition effect occurs.
  96. */
  97. Alignment alignment() const;
  98. /**
  99. \brief Get direction of motion of the transition effect.
  100. */
  101. Direction direction() const;
  102. /**
  103. \brief Get direction in which the transition effect moves.
  104. */
  105. int angle() const;
  106. /**
  107. \brief Get starting or ending scale.
  108. */
  109. double scale() const;
  110. /**
  111. \brief Returns true if the area to be flown is rectangular and
  112. opaque.
  113. */
  114. bool isRectangular() const;
  115. private:
  116. PageTransitionData *data;
  117. };
  118. }
  119. #endif