File indexing completed on 2024-04-28 16:13:35
0001 /* 0002 * This file is part of the KDE project 0003 * 0004 * Copyright (C) 2013 Arjen Hiemstra <ahiemstra@heimr.nl> 0005 * Copyright (C) 2013 Dan Leinir Turthra Jensen <admin@leinir.dk> 0006 * 0007 * This library is free software; you can redistribute it and/or 0008 * modify it under the terms of the GNU Library General Public 0009 * License as published by the Free Software Foundation; either 0010 * version 2 of the License, or (at your option) any later version. 0011 * 0012 * This library is distributed in the hope that it will be useful, 0013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0015 * Library General Public License for more details. 0016 * 0017 * You should have received a copy of the GNU Library General Public License 0018 * along with this library; see the file COPYING.LIB. If not, write to 0019 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0020 * Boston, MA 02110-1301, USA. 0021 * 0022 */ 0023 0024 #ifndef LINKAREA_H 0025 #define LINKAREA_H 0026 0027 #include <QQuickItem> 0028 0029 #include "Document.h" 0030 0031 namespace Calligra { 0032 namespace Components { 0033 class LinkArea : public QQuickItem 0034 { 0035 Q_OBJECT 0036 Q_PROPERTY( Calligra::Components::Document* document READ document WRITE setDocument NOTIFY documentChanged ) 0037 Q_PROPERTY( float controllerZoom READ controllerZoom WRITE setControllerZoom NOTIFY controllerZoomChanged ) 0038 0039 public: 0040 explicit LinkArea(QQuickItem* parent = 0); 0041 ~LinkArea() override; 0042 0043 Calligra::Components::Document* document() const; 0044 void setDocument( Calligra::Components::Document* newDocument ); 0045 0046 float controllerZoom() const; 0047 void setControllerZoom(float newZoom); 0048 0049 Q_SIGNALS: 0050 void clicked(); 0051 void doubleClicked(); 0052 void linkClicked(QUrl linkTarget); 0053 0054 void documentChanged(); 0055 void controllerZoomChanged(); 0056 0057 protected: 0058 void mousePressEvent(QMouseEvent* event) override; 0059 void mouseReleaseEvent(QMouseEvent* event) override; 0060 void mouseDoubleClickEvent(QMouseEvent* event) override; 0061 0062 private: 0063 class Private; 0064 Private* d; 0065 }; 0066 } // Namespace Components 0067 } // Namespace Calligra 0068 #endif // LINKAREA_H