Subversion Repositories Scribus

Rev

Rev 11339 | Rev 12610 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
10978 avox 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_CREATE_H
19
#define CANVAS_MODE_CREATE_H
20
 
21
#include "canvasmode.h"
22
#include "fpointarray.h"
23
 
11339 avox 24
class LineMove;
10978 avox 25
class PageItem;
11091 avox 26
class ResizeGesture;
10978 avox 27
class ScribusMainWindow;
28
class ScribusView;
11576 avox 29
class UndoTransaction;
10978 avox 30
 
31
/**
32
  Handles the creation of new pageitems
33
*/
34
class CreateMode : public CanvasMode
35
{
36
public:
37
        CreateMode(ScribusView* view);
38
 
39
        virtual void enterEvent(QEvent *);
40
        virtual void leaveEvent(QEvent *);
41
 
42
        virtual void activate(bool);
43
        virtual void deactivate(bool);
44
        virtual void mouseDoubleClickEvent(QMouseEvent *m);
45
        virtual void mouseReleaseEvent(QMouseEvent *m);
46
        virtual void mouseMoveEvent(QMouseEvent *m);
47
        virtual void mousePressEvent(QMouseEvent *m);
48
        virtual void drawControls(QPainter* p);
49
 
50
protected:
51
        void setResizeCursor(int);
52
 
53
private:
54
        inline bool GetItem(PageItem** pi);
55
        void selectPage(QMouseEvent *m);
56
        void SetupDraw(int Nr);
57
        void SetupDrawNoResize(int nr);
58
 
59
        int Cp, oldCp;
60
        bool inItemCreation, shiftSelItems, FirstPoly;
61
        bool m_MouseButtonPressed;
62
        int frameResizeHandle;
63
        int RotMode;
64
        int dragConstrainInitPtX, dragConstrainInitPtY;
65
        double Mxp, Myp, Dxp, Dyp;
66
        int GxM, GyM;
67
        double SeRx, SeRy;
68
        bool MoveGX, MoveGY;
69
        FPointArray RecordP;
11576 avox 70
        UndoTransaction* m_createTransaction;
11091 avox 71
        ResizeGesture* resizeGesture;
11339 avox 72
        LineMove* lineMoveGesture;
10978 avox 73
};
74
 
75
 
76
#endif