File indexing completed on 2024-05-12 12:58:01

0001 /*
0002  * This file is part of the KDE project
0003  *
0004  * SPDX-FileCopyrightText: 2013 Arjen Hiemstra <ahiemstra@heimr.nl>
0005  * SPDX-FileCopyrightText: 2013 Dan Leinir Turthra Jensen <admin@leinir.dk>
0006  *
0007  * SPDX-License-Identifier: LGPL-2.0-or-later
0008  *
0009  */
0010 
0011 #ifndef LINKAREA_H
0012 #define LINKAREA_H
0013 
0014 #include <QQuickItem>
0015 
0016 #include "Document.h"
0017 
0018 namespace Calligra {
0019 namespace Components {
0020 class LinkArea : public QQuickItem
0021 {
0022     Q_OBJECT
0023     Q_PROPERTY( Calligra::Components::Document* document READ document WRITE setDocument NOTIFY documentChanged )
0024     Q_PROPERTY( float controllerZoom READ controllerZoom WRITE setControllerZoom NOTIFY controllerZoomChanged )
0025 
0026 public:
0027     explicit LinkArea(QQuickItem* parent = 0);
0028     ~LinkArea() override;
0029 
0030     Calligra::Components::Document* document() const;
0031     void setDocument( Calligra::Components::Document* newDocument );
0032 
0033     float controllerZoom() const;
0034     void setControllerZoom(float newZoom);
0035 
0036 Q_SIGNALS:
0037     void clicked();
0038     void doubleClicked();
0039     void linkClicked(QUrl linkTarget);
0040 
0041     void documentChanged();
0042     void controllerZoomChanged();
0043 
0044 protected:
0045     void mousePressEvent(QMouseEvent* event) override;
0046     void mouseReleaseEvent(QMouseEvent* event) override;
0047     void mouseDoubleClickEvent(QMouseEvent* event) override;
0048 
0049 private:
0050     class Private;
0051     Private* d;
0052 };
0053 } // Namespace Components
0054 } // Namespace Calligra
0055 #endif // LINKAREA_H