Subversion Repositories Scribus

Rev

Rev 23612 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
12824 jghali 1
/*
2
 For general Scribus (>=1.3.2) copyright and licensing information please refer
3
 to the COPYING file provided with the program. Following this notice may exist
4
 a copyright and/or license notice that predates the release of Scribus 1.3.2
5
 for which a new license (GPL+exception) is in place.
6
 */
7
/***************************************************************************
8
*                                                                         *
9
*   This program is free software; you can redistribute it and/or modify  *
10
*   it under the terms of the GNU General Public License as published by  *
11
*   the Free Software Foundation; either version 2 of the License, or     *
12
*   (at your option) any later version.                                   *
13
*                                                                         *
14
***************************************************************************/
15
 
16
 
17
 
18
#ifndef CANVAS_MODE_FRAMELINKS_H
19
#define CANVAS_MODE_FRAMELINKS_H
20
 
21
#include <QObject>
22
#include <QTime>
23
 
24
#include "canvasmode.h"
25
#include "fpointarray.h"
26
 
27
class LineMove;
28
class PageItem;
29
class PageItem_TextFrame;
30
class QTimer;
31
class ResizeGesture;
32
class RulerGesture;
33
class ScribusMainWindow;
34
class ScribusView;
35
 
36
// This class encapsulate the old code for mouse interaction from scribusview.cpp
37
 
38
class CanvasMode_FrameLinks :  public CanvasMode
39
{
19634 jghali 40
        Q_OBJECT
41
 
12824 jghali 42
public:
16856 craig 43
        explicit CanvasMode_FrameLinks(ScribusView* view);
23017 craig 44
        ~CanvasMode_FrameLinks() override = default;
12824 jghali 45
 
22951 craig 46
        void enterEvent(QEvent *) override;
47
        void leaveEvent(QEvent *) override;
12824 jghali 48
 
22951 craig 49
        void activate(bool) override;
50
        void deactivate(bool) override;
24003 jghali 51
        void keyPressEvent(QKeyEvent *e) override;
52
        void keyReleaseEvent(QKeyEvent *e) override;
22951 craig 53
        void mouseDoubleClickEvent(QMouseEvent *m) override;
54
        void mouseReleaseEvent(QMouseEvent *m) override;
55
        void mouseMoveEvent(QMouseEvent *m) override;
56
        void mousePressEvent(QMouseEvent *m) override;
57
        void drawControls(QPainter* p) override;
12824 jghali 58
 
59
// protected:
60
//      void setResizeCursor(int);
61
 
62
private:
63
        inline bool GetItem(PageItem** pi);
64
        void selectPage(QMouseEvent *m);
65
        bool SeleItem(QMouseEvent *m);
66
        void createContextMenu(PageItem *currItem, double mx, double my);
67
 
23612 craig 68
        int m_frameResizeHandle {-1};
69
        double m_Mxp {-1.0};
70
        double m_Myp {-1.0};
71
        ScribusMainWindow* m_ScMW {nullptr};
12824 jghali 72
};
73
 
74
 
75
#endif