diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-03-16 17:19:57 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-03-16 17:19:57 -0700 |
commit | cad92b918bed03be4b822c7579b0f5d1affb9401 (patch) | |
tree | 73117aee864581675bcb120caff847dc8f89fa0d /tests/poppler/cpp/poppler-page-transition.cpp | |
parent | ae5aa844848c071d3ee98130b7f658b423db054c (diff) |
poppler test
Diffstat (limited to 'tests/poppler/cpp/poppler-page-transition.cpp')
-rw-r--r-- | tests/poppler/cpp/poppler-page-transition.cpp | 127 |
1 files changed, 127 insertions, 0 deletions
diff --git a/tests/poppler/cpp/poppler-page-transition.cpp b/tests/poppler/cpp/poppler-page-transition.cpp new file mode 100644 index 00000000..03d33b54 --- /dev/null +++ b/tests/poppler/cpp/poppler-page-transition.cpp @@ -0,0 +1,127 @@ +/* + * Copyright (C) 2009-2010, Pino Toscano <pino@kde.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "poppler-page-transition.h" + +#include "PageTransition.h" + +using namespace poppler; + +class poppler::page_transition_private +{ +public: + page_transition_private(Object *trans) + : pt(trans) + { + } + + PageTransition pt; +}; + +/** + \class poppler::page_transition poppler-page-transition.h "poppler/cpp/poppler-page-transition.h" + + A transition between two pages in a PDF %document. + + Usually shown in a presentation mode of a PDF viewer. + */ + +/** + \enum poppler::page_transition::type_enum + + The possibe types of a %page transition. +*/ + +/** + \enum poppler::page_transition::alignment_enum + + The alignment of a %page transition. +*/ + +/** + \enum poppler::page_transition::direction_enum + + The direction of an animation in a %page transition. +*/ + + +page_transition::page_transition(Object *params) + : d(new page_transition_private(params)) +{ +} + +/** + Copy constructor. + */ +page_transition::page_transition(const page_transition &pt) + : d(new page_transition_private(*pt.d)) +{ +} + +/** + Destructor. + */ +page_transition::~page_transition() +{ + delete d; +} + +page_transition::type_enum page_transition::type() const +{ + return (page_transition::type_enum)d->pt.getType(); +} + +int page_transition::duration() const +{ + return d->pt.getDuration(); +} + +page_transition::alignment_enum page_transition::alignment() const +{ + return (page_transition::alignment_enum)d->pt.getAlignment(); +} + +page_transition::direction_enum page_transition::direction() const +{ + return (page_transition::direction_enum)d->pt.getDirection(); +} + +int page_transition::angle() const +{ + return d->pt.getAngle(); +} + +double page_transition::scale() const +{ + return d->pt.getScale(); +} + +bool page_transition::is_rectangular() const +{ + return d->pt.isRectangular(); +} + +page_transition& page_transition::operator=(const page_transition &pt) +{ + if (&pt != this) { + page_transition_private *new_d = new page_transition_private(*pt.d); + delete d; + new_d = d; + } + return *this; +} |