Warning, file /office/calligra/libs/pageapp/KoPAViewModeNormal.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 ) 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 KOPAVIEWMODENORMAL_H
0021 #define KOPAVIEWMODENORMAL_H
0022 
0023 #include "KoPAViewMode.h"
0024 
0025 class KoPAPage;
0026 class KoPACanvasBase;
0027 class QPainter;
0028 class QRectF;
0029 class KoViewConverter;
0030 
0031 class KOPAGEAPP_EXPORT KoPAViewModeNormal : public KoPAViewMode
0032 {
0033 public:
0034     KoPAViewModeNormal( KoPAViewBase * view, KoPACanvasBase * m_canvas );
0035     ~KoPAViewModeNormal() override;
0036 
0037     void paint(KoPACanvasBase* canvas, QPainter& painter, const QRectF &paintRect) override;
0038     //void paintEvent( KoPACanvas * canvas, QPaintEvent* event );
0039     void tabletEvent( QTabletEvent *event, const QPointF &point ) override;
0040     void mousePressEvent( QMouseEvent *event, const QPointF &point ) override;
0041     void mouseDoubleClickEvent( QMouseEvent *event, const QPointF &point ) override;
0042     void mouseMoveEvent( QMouseEvent *event, const QPointF &point ) override;
0043     void mouseReleaseEvent( QMouseEvent *event, const QPointF &point ) override;
0044     void shortcutOverrideEvent( QKeyEvent *event ) override;
0045     void keyPressEvent( QKeyEvent *event ) override;
0046     void keyReleaseEvent( QKeyEvent *event ) override;
0047     void wheelEvent( QWheelEvent * event, const QPointF &point ) override;
0048 
0049     /**
0050      * @brief Switch the active view mode to work on master/normal pages
0051      *
0052      * When it is switched to master mode the master page of the current active page
0053      * is selected. If it switches back the page which was shown before going into
0054      * the master mode is shown. If the mode is the same nothing happens.
0055      *
0056      * @param master if true work on master pages, if false work on normal pages
0057      */
0058     void setMasterMode( bool master ) override;
0059 
0060     bool masterMode() override;
0061 
0062     void addShape( KoShape *shape ) override;
0063 
0064     void removeShape( KoShape *shape ) override;
0065 
0066     void changePageLayout( const KoPageLayout &pageLayout, bool applyToDocument, KUndo2Command *parent = 0 ) override;
0067 
0068 private:
0069     void paintMargins( QPainter &painter, const KoViewConverter &converter );
0070 
0071     /// if true it works on master pages, if false on normal pages
0072     bool m_masterMode;
0073     /// the page which was active before entering the master mode
0074     KoPAPage * m_savedPage;
0075 };
0076 
0077 #endif /* KOPAVIEWMODENORMAL_H */