My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mouseactions.h
Go to the documentation of this file.
1 /***************************************************************************
2  mouseactions.h
3  ----------------
4  begin : Thu Aug 28 2003
5  copyright : (C) 2003 by Michael Margraf
6  email : michael.margraf@alumni.tu-berlin.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef MOUSEACTIONS_H
19 #define MOUSEACTIONS_H
20 
21 #include "element.h"
22 
23 #include <qptrlist.h>
24 
25 
26 class Wire;
27 class Schematic;
28 class QPainter;
29 class QPopupMenu;
30 class QMouseEvent;
31 
32 extern QAction *formerAction;
33 
34 
35 class MouseActions {
36 public:
37  MouseActions();
38  virtual ~MouseActions();
39 
40  void setPainter(Schematic*, QPainter*);
41  bool pasteElements(Schematic*);
42  void editElement(Schematic*, QMouseEvent*);
43  void editLabel(Schematic*, WireLabel*);
44 
45  bool drawn; // indicates whether the scheme element was drawn last time
46  Element *selElem; // component/diagram/painting selected in IconView
48  QMouseEvent *focusMEvent;
49 
50  int MAx1, MAy1,MAx2, MAy2, MAx3, MAy3; // cache for mouse movements
51  QPtrList<Element> movingElements;
53 
54  // menu appearing by right mouse button click on component
55  QPopupMenu *ComponentMenu;
56 
57 private:
58  bool isMoveEqual;
59 
60  // -------------------------------------------------------------------
61 public:
62  void MMoveSelect(Schematic*, QMouseEvent*);
63  void MMoveElement(Schematic*, QMouseEvent*);
64  void MMoveWire1(Schematic*, QMouseEvent*);
65  void MMoveWire2(Schematic*, QMouseEvent*);
66  void MMoveMoving(Schematic*, QMouseEvent*);
67  void MMoveMoving2(Schematic*, QMouseEvent*);
68  void MMovePaste(Schematic*, QMouseEvent*);
69  void MMoveDelete(Schematic*, QMouseEvent*);
70  void MMoveLabel(Schematic*, QMouseEvent*);
71  void MMoveMarker(Schematic*, QMouseEvent*);
72  void MMoveMirrorY(Schematic*, QMouseEvent*);
73  void MMoveMirrorX(Schematic*, QMouseEvent*);
74  void MMoveRotate(Schematic*, QMouseEvent*);
75  void MMoveActivate(Schematic*, QMouseEvent*);
76  void MMoveOnGrid(Schematic*, QMouseEvent*);
77  void MMoveResizePainting(Schematic*, QMouseEvent*);
78  void MMoveMoveText(Schematic*, QMouseEvent*);
79  void MMoveMoveTextB(Schematic*, QMouseEvent*);
80  void MMoveZoomIn(Schematic*, QMouseEvent*);
81  void MMoveScrollBar(Schematic*, QMouseEvent*);
82 
83  void MPressSelect(Schematic*, QMouseEvent*, float, float);
84  void MPressDelete(Schematic*, QMouseEvent*, float, float);
85  void MPressActivate(Schematic*, QMouseEvent*, float, float);
86  void MPressMirrorX(Schematic*, QMouseEvent*, float, float);
87  void MPressMirrorY(Schematic*, QMouseEvent*, float, float);
88  void MPressRotate(Schematic*, QMouseEvent*, float, float);
89  void MPressElement(Schematic*, QMouseEvent*, float, float);
90  void MPressLabel(Schematic*, QMouseEvent*, float, float);
91  void MPressWire1(Schematic*, QMouseEvent*, float, float);
92  void MPressWire2(Schematic*, QMouseEvent*, float, float);
93  void MPressPainting(Schematic*, QMouseEvent*, float, float);
94  void MPressMarker(Schematic*, QMouseEvent*, float, float);
95  void MPressOnGrid(Schematic*, QMouseEvent*, float, float);
96  void MPressMoveText(Schematic*, QMouseEvent*, float, float);
97  void MPressZoomIn(Schematic*, QMouseEvent*, float, float);
98 
99  void MDoubleClickSelect(Schematic*, QMouseEvent*);
100  void MDoubleClickWire2(Schematic*, QMouseEvent*);
101 
102  void MReleaseSelect(Schematic*, QMouseEvent*);
103  void MReleaseSelect2(Schematic*, QMouseEvent*);
104  void MReleaseActivate(Schematic*, QMouseEvent*);
105  void MReleaseMoving(Schematic*, QMouseEvent*);
106  void MReleaseResizeDiagram(Schematic*, QMouseEvent*);
107  void MReleasePaste(Schematic*, QMouseEvent*);
108  void MReleaseResizePainting(Schematic*, QMouseEvent*);
109  void MReleaseMoveText(Schematic*, QMouseEvent*);
110  void MReleaseZoomIn(Schematic*, QMouseEvent*);
111 
112  void paintElementsScheme(QPainter*);
113  void rotateElements(Schematic*, int&, int&);
114  void moveElements(Schematic*, int&, int&);
115  void moveElements(QPtrList<Element>*, int, int);
116  void endElementMoving(Schematic*, QPtrList<Element>*);
117  void rightPressMenu(Schematic*, QMouseEvent*, float, float);
118 };
119 
120 #endif