Scribus
Open source desktop publishing at your fingertips
nodeeditcontext.h
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  noeeditcontext.h - description
9  -------------------
10  begin : 2015
11  copyright : (C) 2015 by Scribus Team
12  email :
13  ***************************************************************************/
14 
15 /***************************************************************************
16  * *
17  * This program is free software; you can redistribute it and/or modify *
18  * it under the terms of the GNU General Public License as published by *
19  * the Free Software Foundation; either version 2 of the License, or *
20  * (at your option) any later version. *
21  * *
22  ***************************************************************************/
23 #ifndef NODEEDITCONTEXT_H
24 #define NODEEDITCONTEXT_H
25 
26 #ifdef HAVE_CONFIG_H
27 #include "scconfig.h"
28 #endif
29 
30 #include <QList>
31 #include <QPair>
32 
33 #include "fpoint.h"
34 #include "fpointarray.h"
35 #include "observable.h"
36 #include "undostate.h"
37 #include "undotransaction.h"
38 
39 class SCRIBUS_API NodeEditContext : public MassObservable<QPointF>
40 {
41  public:
43  bool isContourLine() { return m_isContourLine; }
44  void setIsContourLine(bool b) { m_isContourLine = b; }
45  int clre() { return m_ClRe; }
46  void setClre(int i) { m_ClRe = i; }
47  int clre2() { return m_ClRe2; }
48  void setClre2(int i) { m_ClRe2 = i; }
49  int segP1() { return m_SegP1; }
50  void setSegP1(int i) { m_SegP1 = i; }
51  int segP2() { return m_SegP2; }
52  void setSegP2(int i) { m_SegP2 = i; }
53  bool edPoints() { return m_EdPoints; }
54  void setEdPoints(bool b) { m_EdPoints = b; }
55  bool moveSym() { return m_MoveSym; }
56  void setMoveSym(bool b) { m_MoveSym = b; }
57  QList<int>& selNode() { return m_SelNode; }
58  bool hasNodeSelected();
59  void deselect();
60  void reset();
61  int submode() { return m_submode; }
62  void setSubMode(int i) { m_submode = i; }
63  void reset1Control(PageItem* currItem);
64  void resetControl(PageItem* currItem);
65  FPointArray beginTransaction(PageItem* currItem);
66  void finishTransaction(PageItem* currItem);
67  ScItemState<QPair<FPointArray, FPointArray> >* finishTransaction1(PageItem* currItem);
68  void finishTransaction2(PageItem* currItem, ScItemState<QPair<FPointArray, FPointArray> >* state);
69  void moveClipPoint(PageItem *currItem, FPoint ip);
70 
71  FPointArray *oldClip;
72  UndoTransaction nodeTransaction;
73 
74  enum SubMode { MOVE_POINT = 0, ADD_POINT = 1, DEL_POINT = 2, SPLIT_PATH = 3 };
75 
76  protected:
77  int m_submode;
78  bool m_isContourLine;
79 
80  int m_ClRe;
81  int m_ClRe2;
82  int m_SegP1;
83  int m_SegP2;
84  bool m_EdPoints;
85  bool m_MoveSym;
86  QList<int> m_SelNode;
87  double m_oldItemX;
88  double m_oldItemY;
89 };
90 #endif
Definition: undotransaction.h:45
Definition: nodeeditcontext.h:39
A point with floating point precision.
Definition: fpoint.h:43
Definition: undostate.h:291
Definition: observable.h:111
Definition: pageitem.h:92
Definition: fpointarray.h:42