diff options
Diffstat (limited to 'src/android/view/animation')
35 files changed, 3256 insertions, 0 deletions
diff --git a/src/android/view/animation/animation.pri b/src/android/view/animation/animation.pri new file mode 100644 index 0000000..0a90fd9 --- /dev/null +++ b/src/android/view/animation/animation.pri @@ -0,0 +1,39 @@ +INCLUDEPATH += $$PWD + +HEADERS += \ + $$PWD/qqmlandroidacceleratedecelerateinterpolator_p.h \ + $$PWD/qqmlandroidaccelerateinterpolator_p.h \ + $$PWD/qqmlandroidalphaanimation_p.h \ + $$PWD/qqmlandroidanimation_p.h \ + $$PWD/qqmlandroidanimationset_p.h \ + $$PWD/qqmlandroidanticipateinterpolator_p.h \ + $$PWD/qqmlandroidanticipateovershootinterpolator_p.h \ + $$PWD/qqmlandroidbounceinterpolator_p.h \ + $$PWD/qqmlandroidcycleinterpolator_p.h \ + $$PWD/qqmlandroiddecelerateinterpolator_p.h \ + $$PWD/qqmlandroidinterpolator_p.h \ + $$PWD/qqmlandroidlinearinterpolator_p.h \ + $$PWD/qqmlandroidovershootinterpolator_p.h \ + $$PWD/qqmlandroidpathinterpolator_p.h \ + $$PWD/qqmlandroidrotateanimation_p.h \ + $$PWD/qqmlandroidscaleanimation_p.h \ + $$PWD/qqmlandroidtranslateanimation_p.h + +SOURCES += \ + $$PWD/qqmlandroidacceleratedecelerateinterpolator.cpp \ + $$PWD/qqmlandroidaccelerateinterpolator.cpp \ + $$PWD/qqmlandroidalphaanimation.cpp \ + $$PWD/qqmlandroidanimation.cpp \ + $$PWD/qqmlandroidanimationset.cpp \ + $$PWD/qqmlandroidanticipateinterpolator.cpp \ + $$PWD/qqmlandroidanticipateovershootinterpolator.cpp \ + $$PWD/qqmlandroidbounceinterpolator.cpp \ + $$PWD/qqmlandroidcycleinterpolator.cpp \ + $$PWD/qqmlandroiddecelerateinterpolator.cpp \ + $$PWD/qqmlandroidinterpolator.cpp \ + $$PWD/qqmlandroidlinearinterpolator.cpp \ + $$PWD/qqmlandroidovershootinterpolator.cpp \ + $$PWD/qqmlandroidpathinterpolator.cpp \ + $$PWD/qqmlandroidrotateanimation.cpp \ + $$PWD/qqmlandroidscaleanimation.cpp \ + $$PWD/qqmlandroidtranslateanimation.cpp diff --git a/src/android/view/animation/qqmlandroidacceleratedecelerateinterpolator.cpp b/src/android/view/animation/qqmlandroidacceleratedecelerateinterpolator.cpp new file mode 100644 index 0000000..43088da --- /dev/null +++ b/src/android/view/animation/qqmlandroidacceleratedecelerateinterpolator.cpp @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qqmlandroidacceleratedecelerateinterpolator_p.h" + +QT_BEGIN_NAMESPACE + +QQmlAndroidAccelerateDecelerateInterpolator::QQmlAndroidAccelerateDecelerateInterpolator(QObject *parent) : + QQmlAndroidInterpolator(parent) +{ +} + +QAndroidJniObject QQmlAndroidAccelerateDecelerateInterpolator::onCreate() +{ + return QAndroidJniObject("android/view/animation/AccelerateDecelerateInterpolator"); +} + +QT_END_NAMESPACE diff --git a/src/android/view/animation/qqmlandroidacceleratedecelerateinterpolator_p.h b/src/android/view/animation/qqmlandroidacceleratedecelerateinterpolator_p.h new file mode 100644 index 0000000..91a9055 --- /dev/null +++ b/src/android/view/animation/qqmlandroidacceleratedecelerateinterpolator_p.h @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQMLANDROIDACCELERATEDECELERATEINTERPOLATOR_P_H +#define QQMLANDROIDACCELERATEDECELERATEINTERPOLATOR_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QtQmlAndroid/private/qtqmlandroidglobal_p.h> +#include <QtQmlAndroid/private/qqmlandroidoptional_p.h> +#include <QtQmlAndroid/private/qqmlandroidinterpolator_p.h> +#include <QtAndroidExtras/qandroidjniobject.h> + +QT_BEGIN_NAMESPACE + +class Q_QMLANDROID_EXPORT QQmlAndroidAccelerateDecelerateInterpolator : public QQmlAndroidInterpolator +{ + Q_OBJECT + +public: + explicit QQmlAndroidAccelerateDecelerateInterpolator(QObject *parent = nullptr); + +Q_SIGNALS: + +protected: + QAndroidJniObject onCreate() override; + +private: +}; + +QT_END_NAMESPACE + +#endif // QQMLANDROIDACCELERATEDECELERATEINTERPOLATOR_P_H diff --git a/src/android/view/animation/qqmlandroidaccelerateinterpolator.cpp b/src/android/view/animation/qqmlandroidaccelerateinterpolator.cpp new file mode 100644 index 0000000..cc983fb --- /dev/null +++ b/src/android/view/animation/qqmlandroidaccelerateinterpolator.cpp @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qqmlandroidaccelerateinterpolator_p.h" + +QT_BEGIN_NAMESPACE + +QQmlAndroidAccelerateInterpolator::QQmlAndroidAccelerateInterpolator(QObject *parent) : + QQmlAndroidInterpolator(parent) +{ +} + +qreal QQmlAndroidAccelerateInterpolator::factor() const +{ + if (m_factor.isNull()) + return 1.0; + return m_factor; +} + +void QQmlAndroidAccelerateInterpolator::setFactor(qreal factor) +{ + if (m_factor.isNull() || m_factor != factor) { + m_factor = factor; + emit factorChanged(); + } +} + +QAndroidJniObject QQmlAndroidAccelerateInterpolator::onCreate() +{ + if (m_factor.isNull()) + return QAndroidJniObject("android/view/animation/AccelerateInterpolator"); + + return QAndroidJniObject("android/view/animation/AccelerateInterpolator", + "(F)V", + m_factor); +} + +QT_END_NAMESPACE diff --git a/src/android/view/animation/qqmlandroidaccelerateinterpolator_p.h b/src/android/view/animation/qqmlandroidaccelerateinterpolator_p.h new file mode 100644 index 0000000..ab2ab14 --- /dev/null +++ b/src/android/view/animation/qqmlandroidaccelerateinterpolator_p.h @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQMLANDROIDACCELERATEINTERPOLATOR_P_H +#define QQMLANDROIDACCELERATEINTERPOLATOR_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QtQmlAndroid/private/qqmlandroidinterpolator_p.h> +#include <QtQmlAndroid/private/qqmlandroidoptional_p.h> + +QT_BEGIN_NAMESPACE + +class Q_QMLANDROID_EXPORT QQmlAndroidAccelerateInterpolator : public QQmlAndroidInterpolator +{ + Q_OBJECT + Q_PROPERTY(qreal factor READ factor WRITE setFactor NOTIFY factorChanged) + +public: + explicit QQmlAndroidAccelerateInterpolator(QObject *parent = nullptr); + + qreal factor() const; + void setFactor(qreal factor); + +Q_SIGNALS: + void factorChanged(); + +protected: + QAndroidJniObject onCreate() override; + +private: + QQmlAndroidOptional<qreal> m_factor; +}; + +QT_END_NAMESPACE + +#endif // QQMLANDROIDACCELERATEINTERPOLATOR_P_H diff --git a/src/android/view/animation/qqmlandroidalphaanimation.cpp b/src/android/view/animation/qqmlandroidalphaanimation.cpp new file mode 100644 index 0000000..833b7fe --- /dev/null +++ b/src/android/view/animation/qqmlandroidalphaanimation.cpp @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qqmlandroidalphaanimation_p.h" + +QT_BEGIN_NAMESPACE + +QQmlAndroidAlphaAnimation::QQmlAndroidAlphaAnimation(QObject *parent) : + QQmlAndroidAnimation(parent), m_fromAlpha(0), m_toAlpha(0) +{ +} + +qreal QQmlAndroidAlphaAnimation::fromAlpha() const +{ + return m_fromAlpha; +} + +void QQmlAndroidAlphaAnimation::setFromAlpha(qreal alpha) +{ + if (m_fromAlpha != alpha) { + m_fromAlpha = alpha; + emit fromAlphaChanged(); + } +} + +qreal QQmlAndroidAlphaAnimation::toAlpha() const +{ + return m_toAlpha; +} + +void QQmlAndroidAlphaAnimation::setToAlpha(qreal alpha) +{ + if (m_toAlpha != alpha) { + m_toAlpha = alpha; + emit toAlphaChanged(); + } +} + +QAndroidJniObject QQmlAndroidAlphaAnimation::onCreate() +{ + return QAndroidJniObject("android/view/animation/AlphaAnimation", + "(FF)V", + m_fromAlpha, m_toAlpha); +} + +QT_END_NAMESPACE diff --git a/src/android/view/animation/qqmlandroidalphaanimation_p.h b/src/android/view/animation/qqmlandroidalphaanimation_p.h new file mode 100644 index 0000000..0bddd50 --- /dev/null +++ b/src/android/view/animation/qqmlandroidalphaanimation_p.h @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQMLANDROIDALPHAANIMATION_P_H +#define QQMLANDROIDALPHAANIMATION_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QtQmlAndroid/private/qqmlandroidanimation_p.h> + +QT_BEGIN_NAMESPACE + +class Q_QMLANDROID_EXPORT QQmlAndroidAlphaAnimation : public QQmlAndroidAnimation +{ + Q_OBJECT + Q_PROPERTY(qreal fromAlpha READ fromAlpha WRITE setFromAlpha NOTIFY fromAlphaChanged) + Q_PROPERTY(qreal toAlpha READ toAlpha WRITE setToAlpha NOTIFY toAlphaChanged) + +public: + explicit QQmlAndroidAlphaAnimation(QObject *parent = nullptr); + + qreal fromAlpha() const; + void setFromAlpha(qreal alpha); + + qreal toAlpha() const; + void setToAlpha(qreal alpha); + +Q_SIGNALS: + void fromAlphaChanged(); + void toAlphaChanged(); + +protected: + QAndroidJniObject onCreate() override; + +private: + qreal m_fromAlpha; + qreal m_toAlpha; +}; + +QT_END_NAMESPACE + +#endif // QQMLANDROIDALPHAANIMATION_P_H diff --git a/src/android/view/animation/qqmlandroidanimation.cpp b/src/android/view/animation/qqmlandroidanimation.cpp new file mode 100644 index 0000000..6dd43c3 --- /dev/null +++ b/src/android/view/animation/qqmlandroidanimation.cpp @@ -0,0 +1,281 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qqmlandroidanimation_p.h" +#include "qtqmlandroidfunctions_p.h" +#include "qqmlandroidinterpolator_p.h" + +QT_BEGIN_NAMESPACE + +QQmlAndroidAnimation::QQmlAndroidAnimation(QObject *parent) : + QQmlAndroidContextual(parent), m_interpolator(0) +{ +} + +int QQmlAndroidAnimation::resource() const +{ + if (m_resource.isNull()) + return 0; + return m_resource; +} + +void QQmlAndroidAnimation::setResource(int resource) +{ + if (m_resource.isNull() || m_resource != resource) { + m_resource = resource; + emit resourceChanged(); + } +} + +int QQmlAndroidAnimation::duration() const +{ + if (m_duration.isNull()) + return 0; + return m_duration; +} + +void QQmlAndroidAnimation::setDuration(int duration) +{ + if (m_duration.isNull() || m_duration != duration) { + m_duration = duration; + QtQmlAndroid::callIntMethod(instance(), "setDuration", duration); + emit durationChanged(); + } +} + +bool QQmlAndroidAnimation::fillAfter() const +{ + if (m_fillAfter.isNull()) + return false; + return m_fillAfter; +} + +void QQmlAndroidAnimation::setFillAfter(bool fill) +{ + if (m_fillAfter.isNull() || m_fillAfter != fill) { + m_fillAfter = fill; + QtQmlAndroid::callBoolMethod(instance(), "setFillAfter", fill); + emit fillAfterChanged(); + } +} + +bool QQmlAndroidAnimation::fillBefore() const +{ + if (m_fillBefore.isNull()) + return true; + return m_fillBefore; +} + +void QQmlAndroidAnimation::setFillBefore(bool fill) +{ + if (m_fillBefore.isNull() || m_fillBefore != fill) { + m_fillBefore = fill; + QtQmlAndroid::callBoolMethod(instance(), "setFillBefore", fill); + emit fillBeforeChanged(); + } +} + +bool QQmlAndroidAnimation::fillEnabled() const +{ + if (!m_fillEnabled.isNull()) + return false; + return m_fillEnabled; +} + +void QQmlAndroidAnimation::setFillEnabled(bool fill) +{ + if (m_fillEnabled.isNull() || m_fillEnabled != fill) { + m_fillEnabled = fill; + QtQmlAndroid::callBoolMethod(instance(), "setFillEnabled", fill); + emit fillEnabledChanged(); + } +} + +QQmlAndroidInterpolator *QQmlAndroidAnimation::interpolator() const +{ + return m_interpolator; +} + +void QQmlAndroidAnimation::setInterpolator(QQmlAndroidInterpolator *interpolator) +{ + if (m_interpolator != interpolator) { + if (m_interpolator) { + disconnect(m_interpolator, &QQmlAndroidObject::instanceChanged, this, &QQmlAndroidAnimation::updateInterpolator); + m_interpolator->destruct(); + } + m_interpolator = interpolator; + if (m_interpolator) { + connect(m_interpolator, &QQmlAndroidObject::instanceChanged, this, &QQmlAndroidAnimation::updateInterpolator); + if (isValid()) + m_interpolator->construct(); + } + } +} + +int QQmlAndroidAnimation::repeatCount() const +{ + if (m_repeatCount.isNull()) + return 0; + return m_repeatCount; +} + +void QQmlAndroidAnimation::setRepeatCount(int count) +{ + if (m_repeatCount.isNull() || m_repeatCount != count) { + m_repeatCount = count; + QtQmlAndroid::callIntMethod(instance(), "setRepeatCount", count); + emit repeatCountChanged(); + } +} + +QQmlAndroidAnimation::RepeatMode QQmlAndroidAnimation::repeatMode() const +{ + if (m_repeatMode.isNull()) + return RESTART; + return m_repeatMode; +} + +void QQmlAndroidAnimation::setRepeatMode(RepeatMode mode) +{ + if (m_repeatMode.isNull() || m_repeatMode != mode) { + m_repeatMode = mode; + QtQmlAndroid::callIntMethod(instance(), "setRepeatMode", mode); + emit repeatModeChanged(); + } +} + +int QQmlAndroidAnimation::startOffset() const +{ + if (m_startOffset.isNull()) + return 0; + return m_startOffset; +} + +void QQmlAndroidAnimation::setStartOffset(int offset) +{ + if (m_startOffset.isNull() || m_startOffset != offset) { + m_startOffset = offset; + QtQmlAndroid::callIntMethod(instance(), "setStartOffset", offset); + emit startOffsetChanged(); + } +} + +QQmlAndroidAnimation::ZAdjustment QQmlAndroidAnimation::zAdjustment() const +{ + if (m_zAdjustment.isNull()) + return ZORDER_NORMAL; + return m_zAdjustment; +} + +void QQmlAndroidAnimation::setZAdjustment(ZAdjustment adjustment) +{ + if (m_zAdjustment.isNull() || m_zAdjustment != adjustment) { + m_zAdjustment = adjustment; + QtQmlAndroid::callIntMethod(instance(), "setZAdjustment", adjustment); + emit zAdjustmentChanged(); + } +} + +void QQmlAndroidAnimation::cancel() +{ + QtQmlAndroid::callVoidMethod(instance(), "cancel"); +} + +void QQmlAndroidAnimation::start() +{ + QtQmlAndroid::callVoidMethod(instance(), "start"); +} + +void QQmlAndroidAnimation::startNow() +{ + QtQmlAndroid::callVoidMethod(instance(), "startNow"); +} + +QAndroidJniObject QQmlAndroidAnimation::onCreate() +{ + if (m_resource.isNull()) + return QAndroidJniObject("android/view/animation/Animation"); + + return QAndroidJniObject::callStaticObjectMethod("android/view/animation/AnimationUtils", + "loadAnimation", + "(Landroid/content/Context;I)Landroid/view/animation/Animation;", + ctx().object(), + m_resource); +} + +void QQmlAndroidAnimation::onInflate(QAndroidJniObject &instance) +{ + QQmlAndroidContextual::onInflate(instance); + + if (m_resource.isNull()) { + if (!m_duration.isNull()) + instance.callMethod<void>("setDuration", "(J)V", static_cast<jlong>(m_duration)); + if (!m_fillAfter.isNull()) + instance.callMethod<void>("setFillAfter", "(Z)V", m_fillAfter); + if (!m_fillBefore.isNull()) + instance.callMethod<void>("setFillBefore", "(Z)V", m_fillBefore); + if (!m_fillEnabled.isNull()) + instance.callMethod<void>("setFillEnabled", "(Z)V", m_fillEnabled); + if (!m_repeatCount.isNull()) + instance.callMethod<void>("setRepeatCount", "(I)V", m_repeatCount); + if (!m_repeatMode.isNull()) + instance.callMethod<void>("setRepeatMode", "(I)V", m_repeatMode); + if (!m_startOffset.isNull()) + instance.callMethod<void>("setStartOffset", "(J)V", static_cast<jlong>(m_startOffset)); + if (!m_zAdjustment.isNull()) + instance.callMethod<void>("setZAdjustment", "(I)V", m_zAdjustment); + } +} + +void QQmlAndroidAnimation::objectChange(ObjectChange change) +{ + if (change == InstanceChange) + updateInterpolator(); +} + +void QQmlAndroidAnimation::updateInterpolator() +{ + if (!isValid() || !m_interpolator || !m_interpolator->isValid()) + return; + + QAndroidJniObject animation = instance(); + QAndroidJniObject interpolator = m_interpolator->instance(); + QtQmlAndroid::callFunction([=]() { + animation.callMethod<void>("setInterpolator", "(Landroid/view/animation/Interpolator;)V", interpolator.object()); + }); +} + +QT_END_NAMESPACE diff --git a/src/android/view/animation/qqmlandroidanimation_p.h b/src/android/view/animation/qqmlandroidanimation_p.h new file mode 100644 index 0000000..47717e6 --- /dev/null +++ b/src/android/view/animation/qqmlandroidanimation_p.h @@ -0,0 +1,168 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQMLANDROIDANIMATION_P_H +#define QQMLANDROIDANIMATION_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QtQmlAndroid/private/qqmlandroidcontextual_p.h> +#include <QtQmlAndroid/private/qqmlandroidoptional_p.h> + +QT_BEGIN_NAMESPACE + +class QQmlAndroidInterpolator; + +class Q_QMLANDROID_EXPORT QQmlAndroidAnimation : public QQmlAndroidContextual +{ + Q_OBJECT + Q_PROPERTY(int resource READ resource WRITE setResource NOTIFY resourceChanged) + Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged) + Q_PROPERTY(bool fillAfter READ fillAfter WRITE setFillAfter NOTIFY fillAfterChanged) + Q_PROPERTY(bool fillBefore READ fillBefore WRITE setFillBefore NOTIFY fillBeforeChanged) + Q_PROPERTY(bool fillEnabled READ fillEnabled WRITE setFillEnabled NOTIFY fillEnabledChanged) + Q_PROPERTY(QQmlAndroidInterpolator *interpolator READ interpolator WRITE setInterpolator NOTIFY interpolatorChanged) + Q_PROPERTY(int repeatCount READ repeatCount WRITE setRepeatCount NOTIFY repeatCountChanged) + Q_PROPERTY(RepeatMode repeatMode READ repeatMode WRITE setRepeatMode NOTIFY repeatModeChanged) + Q_PROPERTY(int startOffset READ startOffset WRITE setStartOffset NOTIFY startOffsetChanged) + Q_PROPERTY(ZAdjustment zAdjustment READ zAdjustment WRITE setZAdjustment NOTIFY zAdjustmentChanged) + Q_ENUMS(RepeatMode ZAdjustment Infinity Relation) + +public: + explicit QQmlAndroidAnimation(QObject *parent = nullptr); + + int resource() const; + void setResource(int resource); + + enum Relation { + ABSOLUTE = 0, + RELATIVE_TO_SELF = 1, + RELATIVE_TO_PARENT = 2 + }; + + enum Infinity { + INFINITE = -1 + }; + + int duration() const; + void setDuration(int duration); + + bool fillAfter() const; + void setFillAfter(bool fill); + + bool fillBefore() const; + void setFillBefore(bool fill); + + bool fillEnabled() const; + void setFillEnabled(bool enabled); + + QQmlAndroidInterpolator *interpolator() const; + void setInterpolator(QQmlAndroidInterpolator *interpolator); + + int repeatCount() const; + void setRepeatCount(int count); + + enum RepeatMode { + RESTART = 1, + REVERSE = 2 + }; + + RepeatMode repeatMode() const; + void setRepeatMode(RepeatMode mode); + + int startOffset() const; + void setStartOffset(int offset); + + enum ZAdjustment { + ZORDER_NORMAL = 0, + ZORDER_TOP = 1, + ZORDER_BOTTOM = -1 + }; + + ZAdjustment zAdjustment() const; + void setZAdjustment(ZAdjustment adjustment); + +public Q_SLOTS: + void cancel(); + void start(); + void startNow(); + +Q_SIGNALS: + void resourceChanged(); + void durationChanged(); + void fillAfterChanged(); + void fillBeforeChanged(); + void fillEnabledChanged(); + void interpolatorChanged(); + void repeatCountChanged(); + void repeatModeChanged(); + void startOffsetChanged(); + void zAdjustmentChanged(); + +protected: + QAndroidJniObject onCreate() override; + void onInflate(QAndroidJniObject &instance) override; + + void objectChange(ObjectChange change) override; + +private Q_SLOTS: + void updateInterpolator(); + +private: + QQmlAndroidOptional<int> m_resource; + QQmlAndroidOptional<int> m_duration; + QQmlAndroidOptional<bool> m_fillAfter; + QQmlAndroidOptional<bool> m_fillBefore; + QQmlAndroidOptional<bool> m_fillEnabled; + QQmlAndroidInterpolator *m_interpolator; + QQmlAndroidOptional<int> m_repeatCount; + QQmlAndroidOptional<RepeatMode> m_repeatMode; + QQmlAndroidOptional<int> m_startOffset; + QQmlAndroidOptional<ZAdjustment> m_zAdjustment; +}; + +QT_END_NAMESPACE + +#endif // QQMLANDROIDANIMATION_P_H diff --git a/src/android/view/animation/qqmlandroidanimationset.cpp b/src/android/view/animation/qqmlandroidanimationset.cpp new file mode 100644 index 0000000..f5c85b5 --- /dev/null +++ b/src/android/view/animation/qqmlandroidanimationset.cpp @@ -0,0 +1,80 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qqmlandroidanimationset_p.h" + +QT_BEGIN_NAMESPACE + +QQmlAndroidAnimationSet::QQmlAndroidAnimationSet(QObject *parent) : + QQmlAndroidAnimation(parent), m_shareInterpolator(false) +{ +} + +bool QQmlAndroidAnimationSet::shareInterpolator() const +{ + return m_shareInterpolator; +} + +void QQmlAndroidAnimationSet::setShareInterpolator(bool share) +{ + if (m_shareInterpolator != share) { + m_shareInterpolator = share; + emit shareInterpolatorChanged(); + } +} + +QAndroidJniObject QQmlAndroidAnimationSet::onCreate() +{ + return QAndroidJniObject("android/view/animation/AnimationSet", + "(Z)V", + m_shareInterpolator); +} + +void QQmlAndroidAnimationSet::onInflate(QAndroidJniObject &instance) +{ + QQmlAndroidAnimation::onInflate(instance); + + foreach (QObject *object, children()) { + QQmlAndroidAnimation *child = qobject_cast<QQmlAndroidAnimation *>(object); + if (child) { + QAndroidJniObject animation = child->instance(); + if (animation.isValid()) + instance.callMethod<void>("addAnimation", "(Landroid/view/animation/Animation;)V", animation.object()); + } + } +} + +QT_END_NAMESPACE diff --git a/src/android/view/animation/qqmlandroidanimationset_p.h b/src/android/view/animation/qqmlandroidanimationset_p.h new file mode 100644 index 0000000..2891e86 --- /dev/null +++ b/src/android/view/animation/qqmlandroidanimationset_p.h @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQMLANDROIDANIMATIONSET_P_H +#define QQMLANDROIDANIMATIONSET_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QtQmlAndroid/private/qqmlandroidanimation_p.h> + +QT_BEGIN_NAMESPACE + +class Q_QMLANDROID_EXPORT QQmlAndroidAnimationSet : public QQmlAndroidAnimation +{ + Q_OBJECT + Q_PROPERTY(bool shareInterpolator READ shareInterpolator WRITE setShareInterpolator NOTIFY shareInterpolatorChanged) + +public: + explicit QQmlAndroidAnimationSet(QObject *parent = nullptr); + + bool shareInterpolator() const; + void setShareInterpolator(bool share); + +Q_SIGNALS: + void shareInterpolatorChanged(); + +protected: + QAndroidJniObject onCreate() override; + void onInflate(QAndroidJniObject &instance) override; + +private: + bool m_shareInterpolator; +}; + +QT_END_NAMESPACE + +#endif // QQMLANDROIDANIMATIONSET_P_H diff --git a/src/android/view/animation/qqmlandroidanticipateinterpolator.cpp b/src/android/view/animation/qqmlandroidanticipateinterpolator.cpp new file mode 100644 index 0000000..5588dec --- /dev/null +++ b/src/android/view/animation/qqmlandroidanticipateinterpolator.cpp @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qqmlandroidanticipateinterpolator_p.h" + +QT_BEGIN_NAMESPACE + +QQmlAndroidAnticipateInterpolator::QQmlAndroidAnticipateInterpolator(QObject *parent) : + QQmlAndroidInterpolator(parent) +{ +} + +qreal QQmlAndroidAnticipateInterpolator::tension() const +{ + if (m_tension.isNull()) + return 1.0; + return m_tension; +} + +void QQmlAndroidAnticipateInterpolator::setTension(qreal tension) +{ + if (m_tension.isNull() || m_tension != tension) { + m_tension = tension; + emit tensionChanged(); + } +} + +QAndroidJniObject QQmlAndroidAnticipateInterpolator::onCreate() +{ + if (m_tension.isNull()) + return QAndroidJniObject("android/view/animation/AnticipateInterpolator"); + + return QAndroidJniObject("android/view/animation/AnticipateInterpolator", + "(F)V", + m_tension); +} + +QT_END_NAMESPACE diff --git a/src/android/view/animation/qqmlandroidanticipateinterpolator_p.h b/src/android/view/animation/qqmlandroidanticipateinterpolator_p.h new file mode 100644 index 0000000..2a524b8 --- /dev/null +++ b/src/android/view/animation/qqmlandroidanticipateinterpolator_p.h @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQMLANDROIDANTICIPATEINTERPOLATOR_P_H +#define QQMLANDROIDANTICIPATEINTERPOLATOR_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QtQmlAndroid/private/qqmlandroidinterpolator_p.h> +#include <QtQmlAndroid/private/qqmlandroidoptional_p.h> + +QT_BEGIN_NAMESPACE + +class Q_QMLANDROID_EXPORT QQmlAndroidAnticipateInterpolator : public QQmlAndroidInterpolator +{ + Q_OBJECT + Q_PROPERTY(qreal tension READ tension WRITE setTension NOTIFY tensionChanged) + +public: + explicit QQmlAndroidAnticipateInterpolator(QObject *parent = nullptr); + + qreal tension() const; + void setTension(qreal tension); + +Q_SIGNALS: + void tensionChanged(); + +protected: + QAndroidJniObject onCreate() override; + +private: + QQmlAndroidOptional<qreal> m_tension; +}; + +QT_END_NAMESPACE + +#endif // QQMLANDROIDANTICIPATEINTERPOLATOR_P_H diff --git a/src/android/view/animation/qqmlandroidanticipateovershootinterpolator.cpp b/src/android/view/animation/qqmlandroidanticipateovershootinterpolator.cpp new file mode 100644 index 0000000..6e2b21b --- /dev/null +++ b/src/android/view/animation/qqmlandroidanticipateovershootinterpolator.cpp @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qqmlandroidanticipateovershootinterpolator_p.h" + +QT_BEGIN_NAMESPACE + +QQmlAndroidAnticipateOvershootInterpolator::QQmlAndroidAnticipateOvershootInterpolator(QObject *parent) : + QQmlAndroidInterpolator(parent) +{ +} + +qreal QQmlAndroidAnticipateOvershootInterpolator::tension() const +{ + if (m_tension.isNull()) + return 1.0; + return m_tension; +} + +void QQmlAndroidAnticipateOvershootInterpolator::setTension(qreal tension) +{ + if (m_tension.isNull() || m_tension != tension) { + m_tension = tension; + emit tensionChanged(); + } +} + +qreal QQmlAndroidAnticipateOvershootInterpolator::extraTension() const +{ + if (m_extraTension.isNull()) + return 1.0; + return m_extraTension; +} + +void QQmlAndroidAnticipateOvershootInterpolator::setExtraTension(qreal tension) +{ + if (m_extraTension.isNull() || m_extraTension != tension) { + m_extraTension = tension; + emit extraTensionChanged(); + } +} + +QAndroidJniObject QQmlAndroidAnticipateOvershootInterpolator::onCreate() +{ + if (m_tension.isNull() && m_extraTension.isNull()) + return QAndroidJniObject("android/view/animation/AnticipateOvershootInterpolator"); + + if (!m_tension.isNull()) + return QAndroidJniObject("android/view/animation/AnticipateOvershootInterpolator", + "(F)V", + m_tension); + + return QAndroidJniObject("android/view/animation/AnticipateOvershootInterpolator", + "(FF)V", + m_tension, + m_extraTension); +} + +QT_END_NAMESPACE diff --git a/src/android/view/animation/qqmlandroidanticipateovershootinterpolator_p.h b/src/android/view/animation/qqmlandroidanticipateovershootinterpolator_p.h new file mode 100644 index 0000000..05a4092 --- /dev/null +++ b/src/android/view/animation/qqmlandroidanticipateovershootinterpolator_p.h @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQMLANDROIDANTICIPATEOVERSHOOTINTERPOLATOR_P_H +#define QQMLANDROIDANTICIPATEOVERSHOOTINTERPOLATOR_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QtQmlAndroid/private/qqmlandroidinterpolator_p.h> +#include <QtQmlAndroid/private/qqmlandroidoptional_p.h> + +QT_BEGIN_NAMESPACE + +class Q_QMLANDROID_EXPORT QQmlAndroidAnticipateOvershootInterpolator : public QQmlAndroidInterpolator +{ + Q_OBJECT + Q_PROPERTY(qreal tension READ tension WRITE setTension NOTIFY tensionChanged) + Q_PROPERTY(qreal extraTension READ extraTension WRITE setExtraTension NOTIFY extraTensionChanged) + +public: + explicit QQmlAndroidAnticipateOvershootInterpolator(QObject *parent = nullptr); + + qreal tension() const; + void setTension(qreal tension); + + qreal extraTension() const; + void setExtraTension(qreal tension); + +Q_SIGNALS: + void tensionChanged(); + void extraTensionChanged(); + +protected: + QAndroidJniObject onCreate() override; + +private: + QQmlAndroidOptional<qreal> m_tension; + QQmlAndroidOptional<qreal> m_extraTension; +}; + +QT_END_NAMESPACE + +#endif // QQMLANDROIDANTICIPATEOVERSHOOTINTERPOLATOR_P_H diff --git a/src/android/view/animation/qqmlandroidbounceinterpolator.cpp b/src/android/view/animation/qqmlandroidbounceinterpolator.cpp new file mode 100644 index 0000000..c615d2d --- /dev/null +++ b/src/android/view/animation/qqmlandroidbounceinterpolator.cpp @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qqmlandroidbounceinterpolator_p.h" + +QT_BEGIN_NAMESPACE + +QQmlAndroidBounceInterpolator::QQmlAndroidBounceInterpolator(QObject *parent) : + QQmlAndroidInterpolator(parent) +{ +} + +QAndroidJniObject QQmlAndroidBounceInterpolator::onCreate() +{ + return QAndroidJniObject("android/view/animation/BounceInterpolator"); +} + +QT_END_NAMESPACE diff --git a/src/android/view/animation/qqmlandroidbounceinterpolator_p.h b/src/android/view/animation/qqmlandroidbounceinterpolator_p.h new file mode 100644 index 0000000..4a9da71 --- /dev/null +++ b/src/android/view/animation/qqmlandroidbounceinterpolator_p.h @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQMLANDROIDBOUNCEINTERPOLATOR_P_H +#define QQMLANDROIDBOUNCEINTERPOLATOR_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QtQmlAndroid/private/qtqmlandroidglobal_p.h> +#include <QtQmlAndroid/private/qqmlandroidoptional_p.h> +#include <QtQmlAndroid/private/qqmlandroidinterpolator_p.h> +#include <QtAndroidExtras/qandroidjniobject.h> + +QT_BEGIN_NAMESPACE + +class Q_QMLANDROID_EXPORT QQmlAndroidBounceInterpolator : public QQmlAndroidInterpolator +{ + Q_OBJECT + +public: + explicit QQmlAndroidBounceInterpolator(QObject *parent = nullptr); + +Q_SIGNALS: + +protected: + QAndroidJniObject onCreate() override; + +private: +}; + +QT_END_NAMESPACE + +#endif // QQMLANDROIDBOUNCEINTERPOLATOR_P_H diff --git a/src/android/view/animation/qqmlandroidcycleinterpolator.cpp b/src/android/view/animation/qqmlandroidcycleinterpolator.cpp new file mode 100644 index 0000000..6c88540 --- /dev/null +++ b/src/android/view/animation/qqmlandroidcycleinterpolator.cpp @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qqmlandroidcycleinterpolator_p.h" + +QT_BEGIN_NAMESPACE + +QQmlAndroidCycleInterpolator::QQmlAndroidCycleInterpolator(QObject *parent) : + QQmlAndroidInterpolator(parent) +{ +} + +qreal QQmlAndroidCycleInterpolator::cycles() const +{ + if (m_cycles.isNull()) + return 1.0; + return m_cycles; +} + +void QQmlAndroidCycleInterpolator::setCycles(qreal cycles) +{ + if (m_cycles.isNull() || m_cycles != cycles) { + m_cycles = cycles; + emit cyclesChanged(); + } +} + +QAndroidJniObject QQmlAndroidCycleInterpolator::onCreate() +{ + if (m_cycles.isNull()) + return QAndroidJniObject("android/view/animation/CycleInterpolator"); + + return QAndroidJniObject("android/view/animation/CycleInterpolator", + "(F)V", + m_cycles); +} + +QT_END_NAMESPACE diff --git a/src/android/view/animation/qqmlandroidcycleinterpolator_p.h b/src/android/view/animation/qqmlandroidcycleinterpolator_p.h new file mode 100644 index 0000000..6fbeeeb --- /dev/null +++ b/src/android/view/animation/qqmlandroidcycleinterpolator_p.h @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQMLANDROIDCYCLEINTERPOLATOR_P_H +#define QQMLANDROIDCYCLEINTERPOLATOR_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QtQmlAndroid/private/qqmlandroidinterpolator_p.h> +#include <QtQmlAndroid/private/qqmlandroidoptional_p.h> + +QT_BEGIN_NAMESPACE + +class Q_QMLANDROID_EXPORT QQmlAndroidCycleInterpolator : public QQmlAndroidInterpolator +{ + Q_OBJECT + Q_PROPERTY(qreal cycles READ cycles WRITE setCycles NOTIFY cyclesChanged) + +public: + explicit QQmlAndroidCycleInterpolator(QObject *parent = nullptr); + + qreal cycles() const; + void setCycles(qreal cycles); + +Q_SIGNALS: + void cyclesChanged(); + +protected: + QAndroidJniObject onCreate() override; + +private: + QQmlAndroidOptional<qreal> m_cycles; +}; + +QT_END_NAMESPACE + +#endif // QQMLANDROIDCYCLEINTERPOLATOR_P_H diff --git a/src/android/view/animation/qqmlandroiddecelerateinterpolator.cpp b/src/android/view/animation/qqmlandroiddecelerateinterpolator.cpp new file mode 100644 index 0000000..e634367 --- /dev/null +++ b/src/android/view/animation/qqmlandroiddecelerateinterpolator.cpp @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qqmlandroiddecelerateinterpolator_p.h" + +QT_BEGIN_NAMESPACE + +QQmlAndroidDecelerateInterpolator::QQmlAndroidDecelerateInterpolator(QObject *parent) : + QQmlAndroidInterpolator(parent) +{ +} + +qreal QQmlAndroidDecelerateInterpolator::factor() const +{ + if (m_factor.isNull()) + return 1.0; + return m_factor; +} + +void QQmlAndroidDecelerateInterpolator::setFactor(qreal factor) +{ + if (m_factor.isNull() || m_factor != factor) { + m_factor = factor; + emit factorChanged(); + } +} + +QAndroidJniObject QQmlAndroidDecelerateInterpolator::onCreate() +{ + if (m_factor.isNull()) + return QAndroidJniObject("android/view/animation/DecelerateInterpolator"); + + return QAndroidJniObject("android/view/animation/DecelerateInterpolator", + "(F)V", + m_factor); +} + +QT_END_NAMESPACE diff --git a/src/android/view/animation/qqmlandroiddecelerateinterpolator_p.h b/src/android/view/animation/qqmlandroiddecelerateinterpolator_p.h new file mode 100644 index 0000000..3fa2800 --- /dev/null +++ b/src/android/view/animation/qqmlandroiddecelerateinterpolator_p.h @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQMLANDROIDDECELERATEINTERPOLATOR_P_H +#define QQMLANDROIDDECELERATEINTERPOLATOR_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QtQmlAndroid/private/qqmlandroidinterpolator_p.h> +#include <QtQmlAndroid/private/qqmlandroidoptional_p.h> + +QT_BEGIN_NAMESPACE + +class Q_QMLANDROID_EXPORT QQmlAndroidDecelerateInterpolator : public QQmlAndroidInterpolator +{ + Q_OBJECT + Q_PROPERTY(qreal factor READ factor WRITE setFactor NOTIFY factorChanged) + +public: + explicit QQmlAndroidDecelerateInterpolator(QObject *parent = nullptr); + + qreal factor() const; + void setFactor(qreal factor); + +Q_SIGNALS: + void factorChanged(); + +protected: + QAndroidJniObject onCreate() override; + +private: + QQmlAndroidOptional<qreal> m_factor; +}; + +QT_END_NAMESPACE + +#endif // QQMLANDROIDDECELERATEINTERPOLATOR_P_H diff --git a/src/android/view/animation/qqmlandroidinterpolator.cpp b/src/android/view/animation/qqmlandroidinterpolator.cpp new file mode 100644 index 0000000..9764bda --- /dev/null +++ b/src/android/view/animation/qqmlandroidinterpolator.cpp @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qqmlandroidinterpolator_p.h" + +QT_BEGIN_NAMESPACE + +QQmlAndroidInterpolator::QQmlAndroidInterpolator(QObject *parent) : + QQmlAndroidObject(parent) +{ +} + +QAndroidJniObject QQmlAndroidInterpolator::onCreate() +{ + return QAndroidJniObject(); +} + +QT_END_NAMESPACE diff --git a/src/android/view/animation/qqmlandroidinterpolator_p.h b/src/android/view/animation/qqmlandroidinterpolator_p.h new file mode 100644 index 0000000..cd27e0b --- /dev/null +++ b/src/android/view/animation/qqmlandroidinterpolator_p.h @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQMLANDROIDINTERPOLATOR_P_H +#define QQMLANDROIDINTERPOLATOR_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QtQmlAndroid/private/qqmlandroidobject_p.h> + +QT_BEGIN_NAMESPACE + +class Q_QMLANDROID_EXPORT QQmlAndroidInterpolator : public QQmlAndroidObject +{ + Q_OBJECT + +public: + explicit QQmlAndroidInterpolator(QObject *parent = nullptr); + +protected: + QAndroidJniObject onCreate() override; +}; + +QT_END_NAMESPACE + +#endif // QQMLANDROIDINTERPOLATOR_P_H diff --git a/src/android/view/animation/qqmlandroidlinearinterpolator.cpp b/src/android/view/animation/qqmlandroidlinearinterpolator.cpp new file mode 100644 index 0000000..57dcfa6 --- /dev/null +++ b/src/android/view/animation/qqmlandroidlinearinterpolator.cpp @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qqmlandroidlinearinterpolator_p.h" + +QT_BEGIN_NAMESPACE + +QQmlAndroidLinearInterpolator::QQmlAndroidLinearInterpolator(QObject *parent) : + QQmlAndroidInterpolator(parent) +{ +} + +QAndroidJniObject QQmlAndroidLinearInterpolator::onCreate() +{ + return QAndroidJniObject("android/view/animation/LinearInterpolator"); +} + +QT_END_NAMESPACE diff --git a/src/android/view/animation/qqmlandroidlinearinterpolator_p.h b/src/android/view/animation/qqmlandroidlinearinterpolator_p.h new file mode 100644 index 0000000..4ccc2d3 --- /dev/null +++ b/src/android/view/animation/qqmlandroidlinearinterpolator_p.h @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQMLANDROIDLINEARINTERPOLATOR_P_H +#define QQMLANDROIDLINEARINTERPOLATOR_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QtQmlAndroid/private/qtqmlandroidglobal_p.h> +#include <QtQmlAndroid/private/qqmlandroidoptional_p.h> +#include <QtQmlAndroid/private/qqmlandroidinterpolator_p.h> +#include <QtAndroidExtras/qandroidjniobject.h> + +QT_BEGIN_NAMESPACE + +class Q_QMLANDROID_EXPORT QQmlAndroidLinearInterpolator : public QQmlAndroidInterpolator +{ + Q_OBJECT + +public: + explicit QQmlAndroidLinearInterpolator(QObject *parent = nullptr); + +Q_SIGNALS: + +protected: + QAndroidJniObject onCreate() override; + +private: +}; + +QT_END_NAMESPACE + +#endif // QQMLANDROIDLINEARINTERPOLATOR_P_H diff --git a/src/android/view/animation/qqmlandroidovershootinterpolator.cpp b/src/android/view/animation/qqmlandroidovershootinterpolator.cpp new file mode 100644 index 0000000..595a209 --- /dev/null +++ b/src/android/view/animation/qqmlandroidovershootinterpolator.cpp @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qqmlandroidovershootinterpolator_p.h" + +QT_BEGIN_NAMESPACE + +QQmlAndroidOvershootInterpolator::QQmlAndroidOvershootInterpolator(QObject *parent) : + QQmlAndroidInterpolator(parent) +{ +} + +qreal QQmlAndroidOvershootInterpolator::tension() const +{ + if (m_tension.isNull()) + return 2.0; + return m_tension; +} + +void QQmlAndroidOvershootInterpolator::setTension(qreal tension) +{ + if (m_tension.isNull() || m_tension != tension) { + m_tension = tension; + emit tensionChanged(); + } +} + +QAndroidJniObject QQmlAndroidOvershootInterpolator::onCreate() +{ + if (m_tension.isNull()) + return QAndroidJniObject("android/view/animation/OvershootInterpolator"); + + return QAndroidJniObject("android/view/animation/OvershootInterpolator", + "(F)V", + m_tension); +} + +QT_END_NAMESPACE diff --git a/src/android/view/animation/qqmlandroidovershootinterpolator_p.h b/src/android/view/animation/qqmlandroidovershootinterpolator_p.h new file mode 100644 index 0000000..b7eebb0 --- /dev/null +++ b/src/android/view/animation/qqmlandroidovershootinterpolator_p.h @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQMLANDROIDOVERSHOOTINTERPOLATOR_P_H +#define QQMLANDROIDOVERSHOOTINTERPOLATOR_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QtQmlAndroid/private/qqmlandroidinterpolator_p.h> +#include <QtQmlAndroid/private/qqmlandroidoptional_p.h> + +QT_BEGIN_NAMESPACE + +class Q_QMLANDROID_EXPORT QQmlAndroidOvershootInterpolator : public QQmlAndroidInterpolator +{ + Q_OBJECT + Q_PROPERTY(qreal tension READ tension WRITE setTension NOTIFY tensionChanged) + +public: + explicit QQmlAndroidOvershootInterpolator(QObject *parent = nullptr); + + qreal tension() const; + void setTension(qreal tension); + +Q_SIGNALS: + void tensionChanged(); + +protected: + QAndroidJniObject onCreate() override; + +private: + QQmlAndroidOptional<qreal> m_tension; +}; + +QT_END_NAMESPACE + +#endif // QQMLANDROIDOVERSHOOTINTERPOLATOR_P_H diff --git a/src/android/view/animation/qqmlandroidpathinterpolator.cpp b/src/android/view/animation/qqmlandroidpathinterpolator.cpp new file mode 100644 index 0000000..ae6a56c --- /dev/null +++ b/src/android/view/animation/qqmlandroidpathinterpolator.cpp @@ -0,0 +1,125 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qqmlandroidpathinterpolator_p.h" + +QT_BEGIN_NAMESPACE + +QQmlAndroidPathInterpolator::QQmlAndroidPathInterpolator(QObject *parent) : + QQmlAndroidInterpolator(parent) +{ +} + +qreal QQmlAndroidPathInterpolator::controlX() const +{ + if (m_controlX.isNull()) + return 0.0; + return m_controlX; +} + +void QQmlAndroidPathInterpolator::setControlX(qreal x) +{ + if (m_controlX.isNull() || m_controlX != x) { + m_controlX = x; + emit controlXChanged(); + } +} + +qreal QQmlAndroidPathInterpolator::controlY() const +{ + if (m_controlY.isNull()) + return 0.0; + return m_controlY; +} + +void QQmlAndroidPathInterpolator::setControlY(qreal y) +{ + if (m_controlY.isNull() || m_controlY != y) { + m_controlY = y; + emit controlYChanged(); + } +} + +qreal QQmlAndroidPathInterpolator::controlX2() const +{ + if (m_controlX2.isNull()) + return 0.0; + return m_controlX2; +} + +void QQmlAndroidPathInterpolator::setControlX2(qreal x) +{ + if (m_controlX2.isNull() || m_controlX2 != x) { + m_controlX2 = x; + emit controlX2Changed(); + } +} + +qreal QQmlAndroidPathInterpolator::controlY2() const +{ + if (m_controlY2.isNull()) + return 0.0; + return m_controlY2; +} + +void QQmlAndroidPathInterpolator::setControlY2(qreal y) +{ + if (m_controlY2.isNull() || m_controlY2 != y) { + m_controlY2 = y; + emit controlY2Changed(); + } +} + +QAndroidJniObject QQmlAndroidPathInterpolator::onCreate() +{ + if (!m_controlX.isNull() && !m_controlY.isNull() && !m_controlX2.isNull() && !m_controlY2.isNull()) + return QAndroidJniObject("android/view/animation/PathInterpolator", + "(FFFF)V", + m_controlX, + m_controlY, + m_controlX2, + m_controlY2); + + if (!m_controlX.isNull() && !m_controlY.isNull()) + return QAndroidJniObject("android/view/animation/PathInterpolator", + "(FF)V", + m_controlX, + m_controlY); + + return QAndroidJniObject(); +} + +QT_END_NAMESPACE diff --git a/src/android/view/animation/qqmlandroidpathinterpolator_p.h b/src/android/view/animation/qqmlandroidpathinterpolator_p.h new file mode 100644 index 0000000..7e80fcf --- /dev/null +++ b/src/android/view/animation/qqmlandroidpathinterpolator_p.h @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQMLANDROIDAPATHINTERPOLATOR_P_H +#define QQMLANDROIDAPATHINTERPOLATOR_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QtQmlAndroid/private/qqmlandroidinterpolator_p.h> +#include <QtQmlAndroid/private/qqmlandroidoptional_p.h> + +QT_BEGIN_NAMESPACE + +class Q_QMLANDROID_EXPORT QQmlAndroidPathInterpolator : public QQmlAndroidInterpolator +{ + Q_OBJECT + Q_PROPERTY(qreal controlX READ controlX WRITE setControlX NOTIFY controlXChanged) + Q_PROPERTY(qreal controlY READ controlY WRITE setControlY NOTIFY controlYChanged) + Q_PROPERTY(qreal controlX2 READ controlX2 WRITE setControlX2 NOTIFY controlX2Changed) + Q_PROPERTY(qreal controlY2 READ controlY2 WRITE setControlY2 NOTIFY controlY2Changed) + +public: + explicit QQmlAndroidPathInterpolator(QObject *parent = nullptr); + + qreal controlX() const; + void setControlX(qreal x); + + qreal controlY() const; + void setControlY(qreal y); + + qreal controlX2() const; + void setControlX2(qreal x); + + qreal controlY2() const; + void setControlY2(qreal y); + +Q_SIGNALS: + void controlXChanged(); + void controlYChanged(); + void controlX2Changed(); + void controlY2Changed(); + +protected: + QAndroidJniObject onCreate() override; + +private: + QQmlAndroidOptional<qreal> m_controlX; + QQmlAndroidOptional<qreal> m_controlY; + QQmlAndroidOptional<qreal> m_controlX2; + QQmlAndroidOptional<qreal> m_controlY2; +}; + +QT_END_NAMESPACE + +#endif // QQMLANDROIDAPATHINTERPOLATOR_P_H diff --git a/src/android/view/animation/qqmlandroidrotateanimation.cpp b/src/android/view/animation/qqmlandroidrotateanimation.cpp new file mode 100644 index 0000000..03c921f --- /dev/null +++ b/src/android/view/animation/qqmlandroidrotateanimation.cpp @@ -0,0 +1,133 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qqmlandroidrotateanimation_p.h" + +QT_BEGIN_NAMESPACE + +QQmlAndroidRotateAnimation::QQmlAndroidRotateAnimation(QObject *parent) : + QQmlAndroidAnimation(parent), m_from(0), m_to(0), + m_pivotX(0), m_pivotY(0), m_pivotXType(ABSOLUTE), m_pivotYType(ABSOLUTE) +{ +} + +qreal QQmlAndroidRotateAnimation::fromDegrees() const +{ + return m_from; +} + +void QQmlAndroidRotateAnimation::setFromDegrees(qreal degrees) +{ + if (m_from != degrees) { + m_from = degrees; + emit fromDegreesChanged(); + } +} + +qreal QQmlAndroidRotateAnimation::toDegrees() const +{ + return m_to; +} + +void QQmlAndroidRotateAnimation::setToDegrees(qreal degrees) +{ + if (m_to != degrees) { + m_to = degrees; + emit toDegreesChanged(); + } +} + +qreal QQmlAndroidRotateAnimation::pivotX() const +{ + return m_pivotX; +} + +void QQmlAndroidRotateAnimation::setPivotX(qreal pivotX) +{ + if (m_pivotX != pivotX) { + m_pivotX = pivotX; + emit pivotXChanged(); + } +} + +qreal QQmlAndroidRotateAnimation::pivotY() const +{ + return m_pivotY; +} + +void QQmlAndroidRotateAnimation::setPivotY(qreal pivotY) +{ + if (m_pivotY != pivotY) { + m_pivotY = pivotY; + emit pivotYChanged(); + } +} + +QQmlAndroidRotateAnimation::Relation QQmlAndroidRotateAnimation::pivotXType() const +{ + return m_pivotXType; +} + +void QQmlAndroidRotateAnimation::setPivotXType(Relation type) +{ + if (m_pivotXType != type) { + m_pivotXType = type; + emit pivotXTypeChanged(); + } +} + +QQmlAndroidRotateAnimation::Relation QQmlAndroidRotateAnimation::pivotYType() const +{ + return m_pivotYType; +} + +void QQmlAndroidRotateAnimation::setPivotYType(Relation type) +{ + if (m_pivotYType != type) { + m_pivotYType = type; + emit pivotYTypeChanged(); + } +} + +QAndroidJniObject QQmlAndroidRotateAnimation::onCreate() +{ + return QAndroidJniObject("android/view/animation/RotateAnimation", + "(FFIFIF)V", + m_from, m_to, + m_pivotXType, m_pivotX, m_pivotYType, m_pivotY); +} + +QT_END_NAMESPACE diff --git a/src/android/view/animation/qqmlandroidrotateanimation_p.h b/src/android/view/animation/qqmlandroidrotateanimation_p.h new file mode 100644 index 0000000..7615a42 --- /dev/null +++ b/src/android/view/animation/qqmlandroidrotateanimation_p.h @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQMLANDROIDROTATEANIMATION_P_H +#define QQMLANDROIDROTATEANIMATION_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QtQmlAndroid/private/qqmlandroidanimation_p.h> + +QT_BEGIN_NAMESPACE + +class Q_QMLANDROID_EXPORT QQmlAndroidRotateAnimation : public QQmlAndroidAnimation +{ + Q_OBJECT + Q_PROPERTY(qreal fromDegrees READ fromDegrees WRITE setFromDegrees NOTIFY fromDegreesChanged) + Q_PROPERTY(qreal toDegrees READ toDegrees WRITE setToDegrees NOTIFY toDegreesChanged) + Q_PROPERTY(qreal pivotX READ pivotX WRITE setPivotX NOTIFY pivotXChanged) + Q_PROPERTY(qreal pivotY READ pivotY WRITE setPivotY NOTIFY pivotYChanged) + Q_PROPERTY(Relation pivotXType READ pivotXType WRITE setPivotXType NOTIFY pivotXTypeChanged) + Q_PROPERTY(Relation pivotYType READ pivotYType WRITE setPivotYType NOTIFY pivotYTypeChanged) + Q_ENUMS(Relation) + +public: + explicit QQmlAndroidRotateAnimation(QObject *parent = nullptr); + + qreal fromDegrees() const; + void setFromDegrees(qreal degrees); + + qreal toDegrees() const; + void setToDegrees(qreal degrees); + + qreal pivotX() const; + void setPivotX(qreal x); + + qreal pivotY() const; + void setPivotY(qreal y); + + Relation pivotXType() const; + void setPivotXType(Relation type); + + Relation pivotYType() const; + void setPivotYType(Relation type); + +Q_SIGNALS: + void fromDegreesChanged(); + void toDegreesChanged(); + void pivotXChanged(); + void pivotYChanged(); + void pivotXTypeChanged(); + void pivotYTypeChanged(); + +protected: + QAndroidJniObject onCreate() override; + +private: + qreal m_from; + qreal m_to; + qreal m_pivotX; + qreal m_pivotY; + Relation m_pivotXType; + Relation m_pivotYType; +}; + +QT_END_NAMESPACE + +#endif // QQMLANDROIDROTATEANIMATION_P_H diff --git a/src/android/view/animation/qqmlandroidscaleanimation.cpp b/src/android/view/animation/qqmlandroidscaleanimation.cpp new file mode 100644 index 0000000..4c21bdc --- /dev/null +++ b/src/android/view/animation/qqmlandroidscaleanimation.cpp @@ -0,0 +1,159 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qqmlandroidscaleanimation_p.h" + +QT_BEGIN_NAMESPACE + +QQmlAndroidScaleAnimation::QQmlAndroidScaleAnimation(QObject *parent) : + QQmlAndroidAnimation(parent), m_fromX(0), m_fromY(0), m_toX(0), m_toY(0), + m_pivotX(0), m_pivotY(0), m_pivotXType(ABSOLUTE), m_pivotYType(ABSOLUTE) +{ +} + +qreal QQmlAndroidScaleAnimation::fromXScale() const +{ + return m_fromX; +} + +void QQmlAndroidScaleAnimation::setFromXScale(qreal x) +{ + if (m_fromX != x) { + m_fromX = x; + emit fromXScaleChanged(); + } +} + +qreal QQmlAndroidScaleAnimation::fromYScale() const +{ + return m_fromY; +} + +void QQmlAndroidScaleAnimation::setFromYScale(qreal y) +{ + if (m_fromY != y) { + m_fromY = y; + emit fromYScaleChanged(); + } +} + +qreal QQmlAndroidScaleAnimation::toXScale() const +{ + return m_toX; +} + +void QQmlAndroidScaleAnimation::setToXScale(qreal x) +{ + if (m_toX != x) { + m_toX = x; + emit toXScaleChanged(); + } +} + +qreal QQmlAndroidScaleAnimation::toYScale() const +{ + return m_toY; +} + +void QQmlAndroidScaleAnimation::setToYScale(qreal y) +{ + if (m_toY != y) { + m_toY = y; + emit toYScaleChanged(); + } +} + +qreal QQmlAndroidScaleAnimation::pivotX() const +{ + return m_pivotX; +} + +void QQmlAndroidScaleAnimation::setPivotX(qreal pivotX) +{ + if (m_pivotX != pivotX) { + m_pivotX = pivotX; + emit pivotXChanged(); + } +} + +qreal QQmlAndroidScaleAnimation::pivotY() const +{ + return m_pivotY; +} + +void QQmlAndroidScaleAnimation::setPivotY(qreal pivotY) +{ + if (m_pivotY != pivotY) { + m_pivotY = pivotY; + emit pivotYChanged(); + } +} + +QQmlAndroidAnimation::Relation QQmlAndroidScaleAnimation::pivotXType() const +{ + return m_pivotXType; +} + +void QQmlAndroidScaleAnimation::setPivotXType(Relation type) +{ + if (m_pivotXType != type) { + m_pivotXType = type; + emit pivotXTypeChanged(); + } +} + +QQmlAndroidAnimation::Relation QQmlAndroidScaleAnimation::pivotYType() const +{ + return m_pivotYType; +} + +void QQmlAndroidScaleAnimation::setPivotYType(Relation type) +{ + if (m_pivotYType != type) { + m_pivotYType = type; + emit pivotYTypeChanged(); + } +} + +QAndroidJniObject QQmlAndroidScaleAnimation::onCreate() +{ + return QAndroidJniObject("android/view/animation/ScaleAnimation", + "(FFFFIFIF)V", + m_fromX, m_toX, m_fromY, m_toY, + m_pivotXType, m_pivotX, m_pivotYType, m_pivotY); +} + +QT_END_NAMESPACE diff --git a/src/android/view/animation/qqmlandroidscaleanimation_p.h b/src/android/view/animation/qqmlandroidscaleanimation_p.h new file mode 100644 index 0000000..7dd118d --- /dev/null +++ b/src/android/view/animation/qqmlandroidscaleanimation_p.h @@ -0,0 +1,120 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQMLANDROIDSCALEANIMATION_P_H +#define QQMLANDROIDSCALEANIMATION_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QtQmlAndroid/private/qqmlandroidanimation_p.h> + +QT_BEGIN_NAMESPACE + +class Q_QMLANDROID_EXPORT QQmlAndroidScaleAnimation : public QQmlAndroidAnimation +{ + Q_OBJECT + Q_PROPERTY(qreal fromXScale READ fromXScale WRITE setFromXScale NOTIFY fromXScaleChanged) + Q_PROPERTY(qreal fromYScale READ fromYScale WRITE setFromYScale NOTIFY fromYScaleChanged) + Q_PROPERTY(qreal toXScale READ toXScale WRITE setToXScale NOTIFY toXScaleChanged) + Q_PROPERTY(qreal toYScale READ toYScale WRITE setToYScale NOTIFY toYScaleChanged) + Q_PROPERTY(qreal pivotX READ pivotX WRITE setPivotX NOTIFY pivotXChanged) + Q_PROPERTY(qreal pivotY READ pivotY WRITE setPivotY NOTIFY pivotYChanged) + Q_PROPERTY(Relation pivotXType READ pivotXType WRITE setPivotXType NOTIFY pivotXTypeChanged) + Q_PROPERTY(Relation pivotYType READ pivotYType WRITE setPivotYType NOTIFY pivotYTypeChanged) + +public: + explicit QQmlAndroidScaleAnimation(QObject *parent = nullptr); + + qreal fromXScale() const; + void setFromXScale(qreal scale); + + qreal fromYScale() const; + void setFromYScale(qreal scale); + + qreal toXScale() const; + void setToXScale(qreal scale); + + qreal toYScale() const; + void setToYScale(qreal scale); + + qreal pivotX() const; + void setPivotX(qreal x); + + qreal pivotY() const; + void setPivotY(qreal y); + + Relation pivotXType() const; + void setPivotXType(Relation type); + + Relation pivotYType() const; + void setPivotYType(Relation type); + +Q_SIGNALS: + void fromXScaleChanged(); + void fromYScaleChanged(); + void toXScaleChanged(); + void toYScaleChanged(); + void pivotXChanged(); + void pivotYChanged(); + void pivotXTypeChanged(); + void pivotYTypeChanged(); + +protected: + QAndroidJniObject onCreate() override; + +private: + qreal m_fromX; + qreal m_fromY; + qreal m_toX; + qreal m_toY; + qreal m_pivotX; + qreal m_pivotY; + Relation m_pivotXType; + Relation m_pivotYType; +}; + +QT_END_NAMESPACE + +#endif // QQMLANDROIDSCALEANIMATION_P_H diff --git a/src/android/view/animation/qqmlandroidtranslateanimation.cpp b/src/android/view/animation/qqmlandroidtranslateanimation.cpp new file mode 100644 index 0000000..f432c22 --- /dev/null +++ b/src/android/view/animation/qqmlandroidtranslateanimation.cpp @@ -0,0 +1,159 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qqmlandroidtranslateanimation_p.h" + +QT_BEGIN_NAMESPACE + +QQmlAndroidTranslateAnimation::QQmlAndroidTranslateAnimation(QObject *parent) : + QQmlAndroidAnimation(parent), m_fromX(0), m_fromY(0), m_toX(0), m_toY(0), + m_fromXType(ABSOLUTE), m_fromYType(ABSOLUTE), m_toXType(ABSOLUTE), m_toYType(ABSOLUTE) +{ +} + +qreal QQmlAndroidTranslateAnimation::fromX() const +{ + return m_fromX; +} + +void QQmlAndroidTranslateAnimation::setFromX(qreal x) +{ + if (m_fromX != x) { + m_fromX = x; + emit fromXChanged(); + } +} + +qreal QQmlAndroidTranslateAnimation::fromY() const +{ + return m_fromY; +} + +void QQmlAndroidTranslateAnimation::setFromY(qreal y) +{ + if (m_fromY != y) { + m_fromY = y; + emit fromYChanged(); + } +} + +qreal QQmlAndroidTranslateAnimation::toX() const +{ + return m_toX; +} + +void QQmlAndroidTranslateAnimation::setToX(qreal x) +{ + if (m_toX != x) { + m_toX = x; + emit toXChanged(); + } +} + +qreal QQmlAndroidTranslateAnimation::toY() const +{ + return m_toY; +} + +void QQmlAndroidTranslateAnimation::setToY(qreal y) +{ + if (m_toY != y) { + m_toY = y; + emit toYChanged(); + } +} + +QQmlAndroidAnimation::Relation QQmlAndroidTranslateAnimation::fromXType() const +{ + return m_fromXType; +} + +void QQmlAndroidTranslateAnimation::setFromXType(Relation type) +{ + if (m_fromXType != type) { + m_fromXType = type; + emit fromXTypeChanged(); + } +} + +QQmlAndroidAnimation::Relation QQmlAndroidTranslateAnimation::fromYType() const +{ + return m_fromYType; +} + +void QQmlAndroidTranslateAnimation::setFromYType(Relation type) +{ + if (m_fromYType != type) { + m_fromYType = type; + emit fromYTypeChanged(); + } +} + +QQmlAndroidAnimation::Relation QQmlAndroidTranslateAnimation::toXType() const +{ + return m_toXType; +} + +void QQmlAndroidTranslateAnimation::setToXType(Relation type) +{ + if (m_toXType != type) { + m_toXType = type; + emit toXTypeChanged(); + } +} + +QQmlAndroidAnimation::Relation QQmlAndroidTranslateAnimation::toYType() const +{ + return m_toYType; +} + +void QQmlAndroidTranslateAnimation::setToYType(Relation type) +{ + if (m_toYType != type) { + m_toYType = type; + emit toYTypeChanged(); + } +} + +QAndroidJniObject QQmlAndroidTranslateAnimation::onCreate() +{ + return QAndroidJniObject("android/view/animation/TranslateAnimation", + "(IFIFIFIF)V", + m_fromXType, m_fromX, m_toXType, m_toX, + m_fromYType, m_fromY, m_toYType, m_toY); +} + +QT_END_NAMESPACE diff --git a/src/android/view/animation/qqmlandroidtranslateanimation_p.h b/src/android/view/animation/qqmlandroidtranslateanimation_p.h new file mode 100644 index 0000000..6c3859b --- /dev/null +++ b/src/android/view/animation/qqmlandroidtranslateanimation_p.h @@ -0,0 +1,120 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt QML Android module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQMLANDROIDTRANSLATEANIMATION_P_H +#define QQMLANDROIDTRANSLATEANIMATION_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QtQmlAndroid/private/qqmlandroidanimation_p.h> + +QT_BEGIN_NAMESPACE + +class Q_QMLANDROID_EXPORT QQmlAndroidTranslateAnimation : public QQmlAndroidAnimation +{ + Q_OBJECT + Q_PROPERTY(qreal fromX READ fromX WRITE setFromX NOTIFY fromXChanged) + Q_PROPERTY(qreal fromY READ fromY WRITE setFromY NOTIFY fromYChanged) + Q_PROPERTY(qreal toX READ toX WRITE setToX NOTIFY toXChanged) + Q_PROPERTY(qreal toY READ toY WRITE setToY NOTIFY toYChanged) + Q_PROPERTY(Relation fromXType READ fromXType WRITE setFromXType NOTIFY fromXTypeChanged) + Q_PROPERTY(Relation fromYType READ fromYType WRITE setFromYType NOTIFY fromYTypeChanged) + Q_PROPERTY(Relation toXType READ toXType WRITE setToXType NOTIFY toXTypeChanged) + Q_PROPERTY(Relation toYType READ toYType WRITE setToYType NOTIFY toYTypeChanged) + +public: + explicit QQmlAndroidTranslateAnimation(QObject *parent = nullptr); + + qreal fromX() const; + void setFromX(qreal x); + + qreal fromY() const; + void setFromY(qreal y); + + qreal toX() const; + void setToX(qreal x); + + qreal toY() const; + void setToY(qreal y); + + Relation fromXType() const; + void setFromXType(Relation type); + + Relation fromYType() const; + void setFromYType(Relation type); + + Relation toXType() const; + void setToXType(Relation type); + + Relation toYType() const; + void setToYType(Relation type); + +Q_SIGNALS: + void fromXChanged(); + void fromYChanged(); + void toXChanged(); + void toYChanged(); + void fromXTypeChanged(); + void fromYTypeChanged(); + void toXTypeChanged(); + void toYTypeChanged(); + +protected: + QAndroidJniObject onCreate() override; + +private: + qreal m_fromX; + qreal m_fromY; + qreal m_toX; + qreal m_toY; + Relation m_fromXType; + Relation m_fromYType; + Relation m_toXType; + Relation m_toYType; +}; + +QT_END_NAMESPACE + +#endif // QQMLANDROIDTRANSLATEANIMATION_P_H |