diff options
Diffstat (limited to 'src/pdf/qpdflink.h')
-rw-r--r-- | src/pdf/qpdflink.h | 55 |
1 files changed, 15 insertions, 40 deletions
diff --git a/src/pdf/qpdflink.h b/src/pdf/qpdflink.h index 81053b42a..63389afe6 100644 --- a/src/pdf/qpdflink.h +++ b/src/pdf/qpdflink.h @@ -1,55 +1,20 @@ -/**************************************************************************** -** -** Copyright (C) 2022 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtPDF module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 https://www.qt.io/terms-conditions. For further -** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QPDFLINK_H #define QPDFLINK_H #include <QtPdf/qtpdfglobal.h> -#include <QtCore/qdebug.h> #include <QtCore/qlist.h> #include <QtCore/qobject.h> #include <QtCore/qpoint.h> #include <QtCore/qrect.h> #include <QtCore/qshareddata.h> +#include <QtGui/qclipboard.h> QT_BEGIN_NAMESPACE +class QDebug; class QPdfLinkPrivate; class QPdfLink @@ -59,6 +24,7 @@ class QPdfLink Q_PROPERTY(int page READ page) Q_PROPERTY(QPointF location READ location) Q_PROPERTY(qreal zoom READ zoom) + Q_PROPERTY(QUrl url READ url) Q_PROPERTY(QString contextBefore READ contextBefore) Q_PROPERTY(QString contextAfter READ contextAfter) Q_PROPERTY(QList<QRectF> rectangles READ rectangles) @@ -78,17 +44,22 @@ public: Q_PDF_EXPORT int page() const; Q_PDF_EXPORT QPointF location() const; Q_PDF_EXPORT qreal zoom() const; + Q_PDF_EXPORT QUrl url() const; Q_PDF_EXPORT QString contextBefore() const; Q_PDF_EXPORT QString contextAfter() const; Q_PDF_EXPORT QList<QRectF> rectangles() const; + Q_PDF_EXPORT Q_INVOKABLE QString toString() const; + Q_PDF_EXPORT Q_INVOKABLE void copyToClipboard(QClipboard::Mode mode = QClipboard::Clipboard) const; private: // methods QPdfLink(int page, QPointF location, qreal zoom); QPdfLink(int page, QList<QRectF> rects, QString contextBefore, QString contextAfter); QPdfLink(QPdfLinkPrivate *d); friend class QPdfDocument; + friend class QPdfLinkModelPrivate; friend class QPdfSearchModelPrivate; - friend class QQuickPdfNavigationStack; + friend class QPdfPageNavigator; + friend class QQuickPdfPageNavigator; private: // storage QExplicitlySharedDataPointer<QPdfLinkPrivate> d; @@ -96,8 +67,12 @@ private: // storage }; Q_DECLARE_SHARED(QPdfLink) +#ifndef QT_NO_DEBUG_STREAM Q_PDF_EXPORT QDebug operator<<(QDebug, const QPdfLink &); +#endif QT_END_NAMESPACE +Q_DECLARE_METATYPE(QPdfLink) + #endif // QPDFLINK_H |