Warning, file /office/calligra/libs/pageapp/KoPACanvas.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* This file is part of the KDE project 0002 Copyright (C) 2006-2007 Thorsten Zachmann <zachmann@kde.org> 0003 0004 This library is free software; you can redistribute it and/or 0005 modify it under the terms of the GNU Library General Public 0006 License as published by the Free Software Foundation; either 0007 version 2 of the License, or (at your option) any later version. 0008 0009 This library is distributed in the hope that it will be useful, 0010 but WITHOUT ANY WARRANTY; without even the implied warranty of 0011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0012 Library General Public License for more details. 0013 0014 You should have received a copy of the GNU Library General Public License 0015 along with this library; see the file COPYING.LIB. If not, write to 0016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0017 * Boston, MA 02110-1301, USA. 0018 */ 0019 0020 #ifndef KOPACANVAS_H 0021 #define KOPACANVAS_H 0022 0023 #include <QWidget> 0024 #include <QList> 0025 #include <KoPACanvasBase.h> 0026 0027 #include "kopageapp_export.h" 0028 0029 /// Widget that shows a KoPAPage 0030 class KOPAGEAPP_EXPORT KoPACanvas : public QWidget, public KoPACanvasBase 0031 { 0032 Q_OBJECT 0033 public: 0034 explicit KoPACanvas( KoPAViewBase * view, KoPADocument * doc, QWidget *parent = 0, Qt::WindowFlags f = 0); 0035 0036 void repaint() override; 0037 0038 QWidget* canvasWidget() override; 0039 const QWidget* canvasWidget() const override; 0040 0041 /// reimplemented method 0042 void updateCanvas( const QRectF& rc ) override; 0043 0044 /// reimplemented method 0045 void updateInputMethodInfo() override; 0046 0047 /// Recalculates the size of the canvas (needed when zooming or changing pagelayout) 0048 void updateSize() override; 0049 0050 void setCursor(const QCursor &cursor) override; 0051 0052 public Q_SLOTS: 0053 0054 void slotSetDocumentOffset(const QPoint &offset) { setDocumentOffset(offset); } 0055 0056 Q_SIGNALS: 0057 void documentSize(const QSize &size); 0058 0059 /** 0060 * Emitted when the entire controller size changes 0061 * @param size the size in widget pixels. 0062 */ 0063 void sizeChanged( const QSize & size ); 0064 0065 /// Emitted when updateCanvas has been called. 0066 void canvasUpdated(); 0067 0068 protected: 0069 /// reimplemented method from superclass 0070 bool event(QEvent *) override; 0071 /// reimplemented method from superclass 0072 void paintEvent( QPaintEvent* event ) override; 0073 /// reimplemented method from superclass 0074 void tabletEvent( QTabletEvent *event ) override; 0075 /// reimplemented method from superclass 0076 void mousePressEvent( QMouseEvent *event ) override; 0077 /// reimplemented method from superclass 0078 void mouseDoubleClickEvent( QMouseEvent *event ) override; 0079 /// reimplemented method from superclass 0080 void mouseMoveEvent( QMouseEvent *event ) override; 0081 /// reimplemented method from superclass 0082 void mouseReleaseEvent( QMouseEvent *event ) override; 0083 /// reimplemented method from superclass 0084 void keyPressEvent( QKeyEvent *event ) override; 0085 /// reimplemented method from superclass 0086 void keyReleaseEvent( QKeyEvent *event ) override; 0087 /// reimplemented method from superclass 0088 void wheelEvent ( QWheelEvent * event ) override; 0089 /// reimplemented method from superclass 0090 void closeEvent( QCloseEvent * event ) override; 0091 /// reimplemented method from superclass 0092 QVariant inputMethodQuery(Qt::InputMethodQuery query) const override; 0093 /// reimplemented method from superclass 0094 void inputMethodEvent(QInputMethodEvent *event) override; 0095 0096 /// reimplemented method from superclass 0097 void resizeEvent( QResizeEvent * event ) override; 0098 0099 /** 0100 * Shows the default context menu 0101 * @param globalPos global position to show the menu at. 0102 * @param actionList action list to be inserted into the menu 0103 */ 0104 void showContextMenu( const QPoint& globalPos, const QList<QAction*>& actionList ); 0105 }; 0106 0107 #endif /* KOPACANVAS_H */