anatomist 6.0.4
3D neuroimaging data viewer
control.h
Go to the documentation of this file.
1/* This software and supporting documentation are distributed by
2 * Institut Federatif de Recherche 49
3 * CEA/NeuroSpin, Batiment 145,
4 * 91191 Gif-sur-Yvette cedex
5 * France
6 *
7 * This software is governed by the CeCILL-B license under
8 * French law and abiding by the rules of distribution of free software.
9 * You can use, modify and/or redistribute the software under the
10 * terms of the CeCILL-B license as circulated by CEA, CNRS
11 * and INRIA at the following URL "http://www.cecill.info".
12 *
13 * As a counterpart to the access to the source code and rights to copy,
14 * modify and redistribute granted by the license, users are provided only
15 * with a limited warranty and the software's author, the holder of the
16 * economic rights, and the successive licensors have only limited
17 * liability.
18 *
19 * In this respect, the user's attention is drawn to the risks associated
20 * with loading, using, modifying and/or developing or reproducing the
21 * software by the user in light of its specific status of free software,
22 * that may mean that it is complicated to manipulate, and that also
23 * therefore means that it is reserved for developers and experienced
24 * professionals having in-depth computer knowledge. Users are therefore
25 * encouraged to load and test the software's suitability as regards their
26 * requirements in conditions enabling the security of their systems and/or
27 * data to be ensured and, more generally, to use and operate it in the
28 * same conditions as regards security.
29 *
30 * The fact that you are presently reading this means that you have had
31 * knowledge of the CeCILL-B license and that you accept its terms.
32 */
33
34
35#ifndef ANATOMIST_CONTROLER_CONTROL_H
36#define ANATOMIST_CONTROLER_CONTROL_H
37
39#include <qevent.h>
40#include <qobject.h>
41#include <qtabwidget.h>
42#include <qwidget.h>
43class QGestureEvent;
44class QPinchGesture;
45class QPanGesture;
46class QSwipeGesture;
47class QTapGesture;
48class QTapAndHoldGesture;
49#include <list>
50#include <map>
51#include <set>
52#include <string>
53
54
55class QTimer;
57
58namespace anatomist {
59 class Control;
60 // TO be changed
61 //typedef rc_ptr<Control> ControlPtr;
63
64// class ControlObserver : public QTabWidget
65// {
66
67// public:
68
69// ControlObserver( QWidget * parent, Control * subject );
70
71// //void updateControlLinks();
72
73// void closeEvent( QCloseEvent * );
74
75// private:
76// Control * mySubject;
77// };
78
79
80 class Action;
81 typedef Action * ActionPtr;
82
83 class ActionPool;
85 class LongActions;
86
87 class Control
88 {
89 public:
90
91 static ControlPtr creator( int priority, const std::string& name );
92
93 // Les classes derivees de control doivent redefinir et appeler la methode eventAutoSubscription dans le constructeur;
94 Control( int priority, std::string name );
95 Control( const Control& control );
96
97 virtual ~Control();
98
99 // virtual ControlPtr clone( ) const = 0;
100
101 void doOnSelect( ActionPool * pool );
102 void doOnDeselect( ActionPool * pool );
103
104 // Can be redefined by inherited classes
105 virtual void doAlsoOnDeselect ( ActionPool *) {}
106 virtual void doAlsoOnSelect( ActionPool *) {}
107
108 const std::string& name() const { return myName; }
109 virtual std::string description() const;
110
111 // QPushButton * button( ) {
112 // return myButton;
113 // }
114
115 // bool animateClick() {
116 // #ifdef ANADEBUG
117 // cerr << "Toto" << endl;
118 // cerr << "Is Button Defined" << (void *)this << endl;
119 // #endif
120 // if( myButton->isEnabled() )
121 // myButton->animateClick();
122 // else return false;
123 // return true;
124 // }
125
126 // void enable() { myButton->setEnabled(true);}
127 // void disable() { myButton->setEnabled(false);}
128
129 virtual void eventAutoSubscription( anatomist::ActionPool * actionPool );
130 int userLevel() const { return myUserLevel; }
131 void setUserLevel( int x ) { myUserLevel = x; }
132
133 typedef Qt::DropAction DropAction;
134
136 {
137 KeyMapKey( int k, int s ) : key(k), state(s) {}
138 int key;
139 int state;
140 bool operator==( const KeyMapKey& k ) const {
141 if ( k.key != key || k.state != state )
142 return false;
143 return true;
144 }
145 bool operator != ( const KeyMapKey& k ) const
146 { return( !operator == ( k ) ); }
147 };
148
150 {
151 bool operator()( KeyMapKey entry1, KeyMapKey entry2 ) const {
152 if ( entry1.key == entry2.key )
153 return entry1.state < entry2.state;
154 return entry1.key < entry2.key;
155 }
156 int i;
157 };
158
160 {
161 MouseButtonMapKey( int b, int s ) : button(b), state(s) {}
163 int state;
164 bool operator==( const MouseButtonMapKey& k ) const {
165 if ( k.button != button || k.state != state )
166 return false;
167 return true;
168 }
169 };
170
172 {
173 bool operator()( MouseButtonMapKey entry1, MouseButtonMapKey entry2 ) const
174 {
175 if ( entry1.button == entry2.button )
176 return entry1.state < entry2.state;
177 return entry1.button < entry2.button;
178 }
179 int i;
180 };
181
183 {
184 public:
185 virtual ~KeyActionLink( ) = 0;
186 virtual void execute( ) = 0;
187 virtual KeyActionLink* clone() const = 0;
188 };
189
190 template<typename T>
192 {
193 public:
194 typedef void (T:: * Callback)( );
196 KeyActionLinkOf( anatomist::Action * action, Callback actionCb);
197 virtual ~KeyActionLinkOf() {}
198
199 virtual void execute();
200 virtual KeyActionLink* clone() const;
201
202 private:
203 T * actionInstance;
204 Callback actionCallback;
205 };
206
208 {
209 public:
210 virtual ~MouseActionLink( ) = 0;
211 virtual void execute( int x, int y, int globalX, int globalY ) = 0;
212 virtual Action* action() = 0;
213 virtual MouseActionLink* clone() const = 0;
214 };
215
216 template<typename T>
218 {
219 public:
220 typedef void (T:: * Callback)( int x, int y, int globalX, int globalY );
224
225 virtual void execute( int x, int y, int globalX, int globalY );
226
227 virtual MouseActionLink* clone() const;
228 virtual Action* action();
229
230 private:
231 T * actionInstance;
232 Callback actionCallback;
233 };
234
235
237 {
238 public:
239 virtual ~WheelActionLink( ) = 0;
240 virtual void execute( int delta, int x, int y, int globalX, int globalY ) = 0;
241 virtual WheelActionLink* clone() const = 0;
242 };
243
244 template<typename T>
246 {
247 public:
248 typedef void (T:: * Callback)( int delta, int x, int y, int globalX, int globalY );
250 WheelActionLinkOf( anatomist::Action * action, Callback actionCb);
252
253 virtual void execute( int delta, int x, int y, int globalX, int globalY );
254
255 virtual WheelActionLink* clone() const;
256
257 private:
258 T * actionInstance;
259 Callback actionCallback;
260 };
261
263 {
264 public:
265 virtual ~FocusActionLink( ) = 0;
266 virtual void execute( ) = 0;
267 virtual FocusActionLink* clone() const = 0;
268 };
269
270 template<typename T>
272 {
273 public:
274 typedef void (T:: * Callback)( );
276 FocusActionLinkOf( anatomist::Action * action, Callback actionCb);
278
279 virtual void execute();
280 virtual FocusActionLink* clone() const;
281
282 private:
283 T * actionInstance;
284 Callback actionCallback;
285 };
286
288 {
289 public:
290 virtual ~EnterLeaveActionLink( ) = 0;
291 virtual void execute( ) = 0;
292 virtual EnterLeaveActionLink* clone() const = 0;
293 };
294
295 template<typename T>
297 {
298 public:
299 typedef void (T:: * Callback)( );
303
304 virtual void execute();
305 virtual EnterLeaveActionLink* clone() const;
306
307 private:
308 T * actionInstance;
309 Callback actionCallback;
310 };
311
313 {
314 public:
315 virtual ~PaintActionLink( ) = 0;
316 virtual void execute( int xOffset, int yOffset, int height, int width ) = 0;
317 virtual PaintActionLink* clone() const = 0;
318 };
319
320 template<typename T>
322 {
323 public:
324 typedef void (T:: * Callback)( int xOffset, int yOffset, int height, int width );
326 PaintActionLinkOf( anatomist::Action * action, Callback actionCb);
328
329 virtual void execute( int xOffset, int yOffset, int height, int width );
330 virtual PaintActionLink* clone() const;
331
332 private:
333 T * actionInstance;
334 Callback actionCallback;
335 };
336
338 {
339 public:
340 virtual ~MoveOrDragActionLink( ) = 0;
341 virtual void execute( int posX = 0, int posY = 0, int oldPosX = 0, int oldPosY = 0 ) = 0;
342 virtual MoveOrDragActionLink* clone() const = 0;
343 };
344
345 template<typename T>
347 {
348 public:
349 typedef void (T:: * Callback)( int, int, int, int );
353
354 virtual void execute( int posX = 0, int posY = 0, int oldPosX = 0, int oldPosY = 0 );
355 virtual MoveOrDragActionLink* clone() const;
356
357 private:
358 T * actionInstance;
359 Callback actionCallback;
360 };
361
363 {
364 public:
365 virtual ~DropActionLink( ) = 0;
366 virtual void execute( int posX, int posY, Control::DropAction action ) = 0;
367 virtual DropActionLink* clone() const = 0;
368 };
369
370 template<typename T>
372 {
373 public:
374 typedef void (T:: * Callback)( int posX, int posY, Control::DropAction action );
376 DropActionLinkOf( anatomist::Action * action, Callback actionCb);
378
379 virtual void execute( int posX, int posY, Control::DropAction action );
380 virtual DropActionLink* clone() const;
381 private:
382 T * actionInstance;
383 Callback actionCallback;
384 };
385
387 {
388 public:
389 virtual ~ResizeActionLink( ) = 0;
390 virtual void execute( int height, int width, int oldHeight, int oldWidth ) = 0;
391 virtual ResizeActionLink* clone() const = 0;
392 };
393
394 template<typename T>
396 {
397 public:
398 typedef void (T:: * Callback)( int height, int width, int oldHeight,
399 int oldWidth );
401 ResizeActionLinkOf( anatomist::Action * action, Callback actionCb);
403
404 virtual void execute( int height, int width, int oldHeight,
405 int oldWidth );
406 virtual ResizeActionLink* clone() const;
407
408 private:
409 T * actionInstance;
410 Callback actionCallback;
411 };
412
414 {
415 public:
416 virtual ~ShowHideActionLink( ) = 0;
417 virtual void execute( bool spontaneous ) = 0;
418 virtual ShowHideActionLink* clone() const = 0;
419 };
420
421 template<typename T>
423 {
424 public:
425 typedef void (T:: * Callback)( bool spontaneous );
429
430 virtual void execute( bool spontaneous );
431 virtual ShowHideActionLink* clone() const;
432
433 private:
434 T * actionInstance;
435 Callback actionCallback;
436 };
437
439 {
440 public:
442 virtual void execute() = 0;
443 virtual SelectionChangedActionLink* clone() const = 0;
444 };
445
446 template<typename T>
448 {
449 public:
450 typedef void (T:: * Callback)( bool spontaneous );
453 Callback actionCb );
455
456 virtual void execute();
457 virtual SelectionChangedActionLink* clone() const;
458
459 private:
460 T * actionInstance;
461 Callback actionCallback;
462 };
463
465 {
466 public:
467 virtual ~PinchActionLink() = 0;
468 virtual void execute( QPinchGesture* ) = 0;
469 virtual PinchActionLink* clone() const = 0;
470 };
471
472 template <typename T>
474 {
475 public:
476 typedef void (T:: * Callback)( QPinchGesture* );
479 Callback actioncb );
481
482 virtual void execute( QPinchGesture * );
483 virtual PinchActionLink* clone() const;
484
485 private:
486 T * actionInstance;
487 Callback actionCallback;
488 };
489
491 {
492 public:
493 virtual ~PanActionLink() = 0;
494 virtual void execute( QPanGesture* ) = 0;
495 virtual PanActionLink* clone() const = 0;
496 };
497
498 template <typename T>
500 {
501 public:
502 typedef void (T:: * Callback)( QPanGesture* );
505 Callback actioncb );
506 virtual ~PanActionLinkOf() {}
507
508 virtual void execute( QPanGesture * );
509 virtual PanActionLink* clone() const;
510
511 private:
512 T * actionInstance;
513 Callback actionCallback;
514 };
515
517 {
518 public:
519 virtual ~TapActionLink() = 0;
520 virtual void execute( QTapGesture* ) = 0;
521 virtual TapActionLink* clone() const = 0;
522 };
523
524 template <typename T>
526 {
527 public:
528 typedef void (T:: * Callback)( QTapGesture* );
531 Callback actioncb );
532 virtual ~TapActionLinkOf() {}
533
534 virtual void execute( QTapGesture * );
535 virtual TapActionLink* clone() const;
536
537 private:
538 T * actionInstance;
539 Callback actionCallback;
540 };
541
543 {
544 public:
546 virtual void execute( QTapAndHoldGesture* ) = 0;
547 virtual TapAndHoldActionLink* clone() const = 0;
548 };
549
550 template <typename T>
552 {
553 public:
554 typedef void (T:: * Callback)( QTapAndHoldGesture* );
557 Callback actioncb );
559
560 virtual void execute( QTapAndHoldGesture * );
561 virtual TapAndHoldActionLink* clone() const;
562
563 private:
564 T * actionInstance;
565 Callback actionCallback;
566 };
567
569 {
570 public:
571 virtual ~SwipeActionLink() = 0;
572 virtual void execute( QSwipeGesture* ) = 0;
573 virtual SwipeActionLink* clone() const = 0;
574 };
575
576 template <typename T>
578 {
579 public:
580 typedef void (T:: * Callback)( QSwipeGesture* );
583 Callback actioncb );
585
586 virtual void execute( QSwipeGesture * );
587 virtual SwipeActionLink* clone() const;
588
589 private:
590 T * actionInstance;
591 Callback actionCallback;
592 };
593
595 {
596 public:
597 virtual ~TouchActionLink() = 0;
598 virtual void execute( QTouchEvent* ) = 0;
599 virtual TouchActionLink* clone() const = 0;
600 };
601
602 template <typename T>
604 {
605 public:
606 typedef void (T:: * Callback)( QTouchEvent* );
609 Callback actioncb );
611
612 virtual void execute( QTouchEvent * );
613 virtual TouchActionLink* clone() const;
614
615 private:
616 T * actionInstance;
617 Callback actionCallback;
618 };
619
620 // ----
621
622 int priority( ) { return myPriority; }
623 std::map<std::string, anatomist::ActionPtr> actions( )
624 { return myActions; }
625 void setPriority( int priority ) { myPriority = priority; }
626
627 virtual void keyPressEvent( QKeyEvent *);
628 virtual void keyReleaseEvent( QKeyEvent *);
629 virtual void mousePressEvent ( QMouseEvent * );
630 virtual void mouseReleaseEvent ( QMouseEvent * );
631 virtual void mouseDoubleClickEvent ( QMouseEvent * );
632 virtual void mouseMoveEvent ( QMouseEvent * );
633 virtual void wheelEvent ( QWheelEvent * );
634 virtual void focusInEvent ( );
635 virtual void focusOutEvent ( );
636 virtual void enterEvent ( );
637 virtual void leaveEvent ( );
638 virtual void paintEvent ( QPaintEvent * );
639 virtual void moveEvent ( QMoveEvent * );
640 virtual void resizeEvent ( QResizeEvent * );
641 virtual void dragEnterEvent ( );
642 virtual void dragMoveEvent ( );
643 virtual void dragLeaveEvent ( );
644 virtual void dropEvent ( QDropEvent * );
645 virtual void showEvent ( QShowEvent * event );
646 virtual void hideEvent ( QHideEvent * event );
647 virtual void selectionChangedEvent();
648 //virtual void customEvent ( QCustomEvent * );
649 virtual void gestureEvent( QGestureEvent * event );
650 virtual void touchEvent( QTouchEvent * event );
651 virtual bool pinchGesture( QPinchGesture * gesture );
652 virtual bool panGesture( QPanGesture * gesture );
653 virtual bool tapGesture( QTapGesture* gesture );
654 virtual bool tapAndHoldGesture( QTapAndHoldGesture* gesture );
655 virtual bool swipeGesture( QSwipeGesture* gesture );
656
658 Qt::KeyboardModifiers buttonState,
659 const KeyActionLink& actionMethod,
660 const std::string & name = "" );
661
663 Qt::KeyboardModifiers buttonState,
664 const KeyActionLink& actionMethod,
665 const std::string & name = "" );
666
667 bool mousePressButtonEventSubscribe( Qt::MouseButtons button,
668 Qt::KeyboardModifiers state,
669 const MouseActionLink& actionMethod,
670 const std::string & name = "" );
671
672 bool mouseReleaseButtonEventSubscribe( Qt::MouseButtons button,
673 Qt::KeyboardModifiers state,
674 const MouseActionLink& actionMethod,
675 const std::string & name = "" );
676
677 bool
678 mouseDoubleClickEventSubscribe( Qt::MouseButtons button,
679 Qt::KeyboardModifiers state,
680 const MouseActionLink& actionMethod,
681 const std::string & name = "" );
682
683 bool mouseMoveEventSubscribe( Qt::MouseButtons button,
684 Qt::KeyboardModifiers state,
685 const MouseActionLink& actionMethod,
686 const std::string & name = "" );
687
689 int startingKey, Qt::KeyboardModifiers startingButtonState,
690 const KeyActionLink& startingActionMethod,
691 Qt::MouseButtons longButton, Qt::KeyboardModifiers longState,
692 const MouseActionLink& longActionMethod,
693 int endingKey, Qt::KeyboardModifiers endingButtonState,
694 const KeyActionLink& endingActionMethod,
695 bool exclusiveAction );
696
697 bool mouseLongEventSubscribe( Qt::MouseButtons startingButton,
698 Qt::KeyboardModifiers startingButtonState,
699 const MouseActionLink& startingActionMethod,
700 const MouseActionLink& longActionMethod,
701 const MouseActionLink& endingActionMethod,
702 bool exclusiveAction );
703
704 bool keyRepetitiveEventSubscribe( int startingKey,
705 Qt::KeyboardModifiers startingButtonState,
706 const KeyActionLink& startingActionMethod,
707
708 int endingKey,
709 Qt::KeyboardModifiers endingButtonState,
710 const KeyActionLink& endingActionMethod,
711 bool exclusiveAction,
712 float temporalStep );
713
714 bool wheelEventSubscribe( const WheelActionLink& actionMethod );
716 bool focusInEventSubscribe( const FocusActionLink& actionMethod );
717 bool focusOutEventSubscribe( const FocusActionLink& actionMethod );
718 bool enterEventSubscribe( const EnterLeaveActionLink& actionMethod );
719 bool leaveEventSubscribe( const EnterLeaveActionLink& actionMethod );
720 bool paintEventSubscribe( const PaintActionLink& actionMethod );
721 bool moveEventSubscribe( const MoveOrDragActionLink& actionMethod );
722 bool resizeEventSubscribe( const ResizeActionLink& actionMethod );
725 bool dragMoveEventSubscribe( const MoveOrDragActionLink& actionMethod );
726 bool dropEventSubscribe( const DropActionLink& actionMethod );
727 bool showEventSubscribe( const ShowHideActionLink& actionMethod );
728 bool hideEventSubscribe( const ShowHideActionLink& actionMethod );
730 ( const SelectionChangedActionLink& actionMethod );
731 bool pinchEventSubscribe( const PinchActionLink & startMethod,
732 const PinchActionLink & moveMethod,
733 const PinchActionLink & stopMethod,
734 const PinchActionLink & cancelMethod );
735 bool panEventSubscribe( const PanActionLink & startMethod,
736 const PanActionLink & moveMethod,
737 const PanActionLink & stopMethod,
738 const PanActionLink & cancelMethod );
739 bool swipeEventSubscribe( const SwipeActionLink & startMethod,
740 const SwipeActionLink & moveMethod,
741 const SwipeActionLink & stopMethod,
742 const SwipeActionLink & cancelMethod );
743 bool tapEventSubscribe( const TapActionLink & startMethod,
744 const TapActionLink & moveMethod,
745 const TapActionLink & stopMethod,
746 const TapActionLink & cancelMethod );
748 const TapAndHoldActionLink & moveMethod,
749 const TapAndHoldActionLink & stopMethod,
750 const TapAndHoldActionLink & cancelMethod );
751 bool touchEventSubscribe( Qt::KeyboardModifiers state,
752 const TouchActionLink & startMethod,
753 const TouchActionLink & moveMethod,
754 const TouchActionLink & stopMethod );
755
758 Qt::KeyboardModifiers buttonState,
759 const KeyActionLink& actionMethods);
761 Qt::KeyboardModifiers buttonState);
762
765 Qt::KeyboardModifiers buttonState,
766 const KeyActionLink& actionMethods);
768 Qt::KeyboardModifiers buttonState);
769
771 bool mousePressButtonEventUnsubscribe( Qt::MouseButtons button,
772 Qt::KeyboardModifiers state,
773 const MouseActionLink& actionMethods );
774 bool mousePressButtonEventUnsubscribe( Qt::MouseButtons button,
775 Qt::KeyboardModifiers state );
776
777
779 bool mouseReleaseButtonEventUnsubscribe( Qt::MouseButtons button,
780 Qt::KeyboardModifiers state,
781 const MouseActionLink& actionMethods );
782 bool mouseReleaseButtonEventUnsubscribe( Qt::MouseButtons button,
783 Qt::KeyboardModifiers state );
784
786 bool
787 mouseDoubleClickEventUnsubscribe( Qt::MouseButtons button,
788 Qt::KeyboardModifiers state,
789 const MouseActionLink& actionMethods );
790 bool
791 mouseDoubleClickEventUnsubscribe( Qt::MouseButtons button,
792 Qt::KeyboardModifiers state );
793
795 bool mouseMoveEventUnsubscribe( Qt::MouseButtons button,
796 Qt::KeyboardModifiers state,
797 const MouseActionLink& actionMethods );
798 bool mouseMoveEventUnsubscribe( Qt::MouseButtons button,
799 Qt::KeyboardModifiers state );
800
801 bool keyAndMouseLongEventUnsubscribe( int startingKey,
802 Qt::KeyboardModifiers startingButtonState,
803 Qt::MouseButtons longButton,
804 Qt::KeyboardModifiers longState,
805 int endingKey,
806 Qt::KeyboardModifiers endingButtonState );
807
808 bool mouseLongEventUnsubscribe( Qt::MouseButtons startingButton,
809 Qt::KeyboardModifiers startingButtonState );
810
811 bool keyRepetitiveEventUnsubscribe( int startingKey,
812 Qt::KeyboardModifiers startingButtonState,
813 int endingKey,
814 Qt::KeyboardModifiers endingButtonState );
815
816 bool wheelEventUnsubscribe( const WheelActionLink& actionMethod );
818 bool focusInEventUnsubscribe( const FocusActionLink& actionMethod );
820 bool focusOutEventUnsubscribe( const FocusActionLink& actionMethod );
822 bool enterEventUnsubscribe( const EnterLeaveActionLink& actionMethod );
824 bool leaveEventUnsubscribe( const EnterLeaveActionLink& actionMethod );
826 bool paintEventUnsubscribe( const PaintActionLink& actionMethod );
828 bool moveEventUnsubscribe( const MoveOrDragActionLink& actionMethod );
830 bool resizeEventUnsubscribe( const ResizeActionLink& actionMethod );
838 bool dropEventUnsubscribe( const DropActionLink& actionMethod );
840 bool showEventUnsubscribe( const ShowHideActionLink& actionMethod );
842 bool hideEventUnsubscribe( const ShowHideActionLink& actionMethod );
845 ( const SelectionChangedActionLink& actionMethod );
852 bool touchEventUnsubscribe( Qt::KeyboardModifiers state );
853
854 // static bool controlFusion( const Control& control1, const Control& control2,
855 // Control& controlsFusion );
856
857 KeyActionLink* keyPressActionLinkByName( const std::string & name ) const;
859 const std::string & name ) const;
861 const std::string & name ) const;
863 const std::string & name ) const;
865 const std::string & name ) const;
867 const std::string & name ) const;
871
872 std::set<std::string> keyPressActionLinkNames() const;
873 std::set<std::string> keyReleaseActionLinkNames() const;
874 std::set<std::string> mousePressActionLinkNames() const;
875 std::set<std::string> mouseReleaseActionLinkNames() const;
876 std::set<std::string> mouseDoubleClickActionLinkNames() const;
877 std::set<std::string> mouseMoveActionLinkNames() const;
878
879 void inhibitAction( const std::string & action, bool inhibit );
880 const std::set<std::string> & inhibitedActions() const;
881
882 protected :
883 std::map<std::string, anatomist::ActionPtr> myActions;
884 std::list<std::string> myControlLinksDescription;
885 private:
886 struct Private;
887
888 int myPriority;
889 int myUserLevel;
890 std::string myName;
891
892 //QPushButton * myButton;
893
894 std::map<KeyMapKey, KeyActionLink*, LessKeyMap> myKeyPressActionMap;
895 std::map<KeyMapKey, KeyActionLink*, LessKeyMap> myKeyReleaseActionMap;
896 std::map<MouseButtonMapKey, MouseActionLink*, LessMouseMap>
897 myMousePressButtonActionMap;
898 std::map<MouseButtonMapKey, MouseActionLink*, LessMouseMap>
899 myMouseReleaseButtonActionMap;
900 std::map<MouseButtonMapKey, MouseActionLink*, LessMouseMap>
901 myMouseDoubleClickButtonActionMap;
902 std::map<MouseButtonMapKey, MouseActionLink*, LessMouseMap>
903 myMouseMoveActionMap;
904
905 WheelActionLink *myWheelAction;
906 FocusActionLink *myFocusInAction;
907 FocusActionLink *myFocusOutAction;
908 EnterLeaveActionLink *myEnterAction;
909 EnterLeaveActionLink *myLeaveAction;
910 PaintActionLink *myPaintAction;
911 MoveOrDragActionLink *myMoveAction;
912 ResizeActionLink *myResizeAction;
913 MoveOrDragActionLink *myDragEnterAction;
914 MoveOrDragActionLink *myDragLeaveAction;
915 MoveOrDragActionLink *myDragMoveAction;
916 DropActionLink *myDropAction;
917 ShowHideActionLink *myShowAction;
918 ShowHideActionLink *myHideAction;
919 SelectionChangedActionLink *mySelectionChangedAction;
920 anatomist::LongActions * myLongActions;
921
922 std::map<std::string, KeyActionLink*> _keyPressActionsByName;
923 std::map<std::string, KeyActionLink*> _keyReleaseActionsByName;
924 std::map<std::string, MouseActionLink*> _mousePressActionsByName;
925 std::map<std::string, MouseActionLink*> _mouseReleaseActionsByName;
926 std::map<std::string, MouseActionLink*> _mouseDoubleClickActionsByName;
927 std::map<std::string, MouseActionLink*> _mouseMoveActionsByName;
928 Private *d;
929 };
930
931
933 {
934 public:
941 bool exclusiveAction );
943
945 const Control::KeyMapKey& startingEvent( ) const { return myStartingEvent; }
946 const Control::KeyActionLink * startingAction( ) const { return myStartingAction; }
947 const Control::MouseButtonMapKey& longEvent( ) const { return myLongEvent; }
948 const Control::MouseActionLink * longAction( ) const { return myLongAction; }
949 const Control::KeyMapKey& endingEvent( ) const { return myEndingEvent; }
950 const Control::KeyActionLink * endingAction( ) const { return myEndingAction; }
951 bool exclusiveAction() const { return myExclusiveAction; }
952
954 void executeLong( int x, int y, int globalX, int globalY );
956
957 private:
958 Control::KeyMapKey myStartingEvent;
959 Control::KeyActionLink * myStartingAction;
960 Control::MouseButtonMapKey myLongEvent;
961 Control::MouseActionLink * myLongAction;
962 Control::KeyMapKey myEndingEvent;
963 Control::KeyActionLink * myEndingAction;
964 bool myExclusiveAction;
965 };
966
967
969 {
970 public:
977 bool exclusiveAction );
978
980
982
984 { return myStartingEvent; }
986 { return myStartingAction; }
988 { return myLongEvent; }
990 { return myLongAction; }
992 { return myEndingEvent; }
994 { return myEndingAction; }
995 bool exclusiveAction() const { return myExclusiveAction; }
996
997 void executeStart( int x, int y, int globalX, int globalY );
998 void executeLong( int x, int y, int globalX, int globalY );
999 void executeEnd( int x, int y, int globalX, int globalY );
1000 void setMouseTracking( bool );
1001
1002 private:
1003 Control::MouseButtonMapKey myStartingEvent;
1004 Control::MouseActionLink * myStartingAction;
1005 Control::MouseButtonMapKey myLongEvent;
1006 Control::MouseActionLink * myLongAction;
1007 Control::MouseButtonMapKey myEndingEvent;
1008 Control::MouseActionLink * myEndingAction;
1009 bool myExclusiveAction;
1010 };
1011
1012
1014 {
1015 public:
1018
1019 void reset();
1020
1021 bool submitKeyPressEvent( QKeyEvent * event );
1022 bool submitKeyReleaseEvent( QKeyEvent * event );
1023 bool submitMousePressEvent( QMouseEvent * event );
1024 bool submitMouseReleaseEvent( QMouseEvent * event );
1025 bool submitMouseMoveEvent( QMouseEvent * event );
1026
1028 int startingKey,
1029 Qt::KeyboardModifiers startingButtonState,
1030 const Control::KeyActionLink& startingActionMethod,
1031 Qt::MouseButtons longButton,
1032 Qt::KeyboardModifiers longState,
1033 const Control::MouseActionLink& longActionMethod,
1034 int endingKey,
1035 Qt::KeyboardModifiers endingButtonState,
1036 const Control::KeyActionLink& endingActionMethod,
1037 bool exclusiveAction );
1038
1040 Qt::MouseButtons startingButton,
1041 Qt::KeyboardModifiers startingButtonState,
1042 const Control::MouseActionLink& startingActionMethod,
1043 const Control::MouseActionLink& longActionMethod,
1044 const Control::MouseActionLink& endingActionMethod,
1045 bool exclusiveAction );
1046
1048 int startingKey,
1049 Qt::KeyboardModifiers startingButtonState,
1050 const Control::KeyActionLink& startingActionMethod,
1051 int endingKey,
1052 Qt::KeyboardModifiers endingButtonState,
1053 const Control::KeyActionLink& endingActionMethod,
1054 bool exclusiveAction,
1055 float temporalStep );
1056
1058 int startingKey,
1059 Qt::KeyboardModifiers startingButtonState,
1060 Qt::MouseButtons longButton,
1061 Qt::KeyboardModifiers longState,
1062 int endingKey,
1063 Qt::KeyboardModifiers endingButtonState );
1064
1066 Qt::MouseButtons startingButton,
1067 Qt::KeyboardModifiers startingButtonState );
1068
1070 int startingKey,
1071 Qt::KeyboardModifiers startingButtonState,
1072 int endingKey,
1073 Qt::KeyboardModifiers endingButtonState );
1074
1075 void setMouseTracking( bool );
1076
1077 private:
1078 std::map<Control::KeyMapKey, KeyAndMouseLongEvent*, Control::LessKeyMap>
1079 myKeyAndMouseLongEventMap;
1080 std::map<Control::KeyMapKey, KeyRepetitiveEvent*, Control::LessKeyMap>
1081 myKeyRepetitiveEventMap;
1083 Control::LessMouseMap> myMouseLongEventMap;
1084 std::map<Control::KeyMapKey, KeyRepetitiveEvent*, Control::LessKeyMap>
1085 myActiveKeyRepetitiveEvents;
1086 KeyAndMouseLongEvent* myActiveKeyAndMouseLongEvent;
1087 MouseLongEvent* myActiveMouseLongEvent;
1088
1089 int currentMouseX;
1090 int currentMouseY;
1091 int currentMouseGlobalX;
1092 int currentMouseGlobalY;
1093
1094 };
1095}
1096
1097class KeyRepetitiveEvent : public QObject
1098{
1099 Q_OBJECT
1100
1101public:
1106 bool exclusiveAction,
1107 float temporalStep );
1109
1111 { return myStartingEvent; }
1113 { return myStartingAction; }
1115 void executeEnd( );
1117 { return myEndingEvent; }
1119 { return myEndingAction; }
1120 bool exclusiveAction( ) const { return myExclusiveAction; }
1121 float temporalStep( ) const { return myTemporalStep; }
1122
1123private slots:
1124 void timeout();
1125
1126private:
1127 anatomist::Control::KeyMapKey myStartingEvent;
1128 anatomist::Control::KeyActionLink * myStartingAction;
1129 anatomist::Control::KeyMapKey myEndingEvent;
1130 anatomist::Control::KeyActionLink * myEndingAction;
1131
1132 bool myExclusiveAction;
1133 float myTemporalStep;
1134 QTimer * myTimer;
1135};
1136
1137// class MouseRepetitiveEvent{
1138// public:
1139// MouseRepetitiveEvent( Control::MouseButtonMapKey startingEvent, Control::MouseActionLink * startingAction,
1140// Control::MouseButtonMapKey endingEvent, Control::MouseActionLink * endingAction,
1141// bool exclusiveAction );
1142// private:
1143// void timeOut();
1144// Control::MouseButtonMapKey myStartingEvent;
1145// Control::MouseActionLink * myStartingAction;
1146// Control::MouseButtonMapKey myEndingEvent;
1147// Control::MouseActionLink * myEndingAction;
1148// bool myExclusiveActionnnn;
1149// Qtimer * myTimer;
1150// };
1151
1152#endif
#define slots
const anatomist::Control::KeyActionLink * endingAction() const
Definition control.h:1118
const anatomist::Control::KeyMapKey & endingEvent() const
Definition control.h:1116
const anatomist::Control::KeyMapKey & startingEvent() const
Definition control.h:1110
float temporalStep() const
Definition control.h:1121
bool exclusiveAction() const
Definition control.h:1120
KeyRepetitiveEvent(const anatomist::Control::KeyMapKey &startingEvent, const anatomist::Control::KeyActionLink &startingAction, const anatomist::Control::KeyMapKey &endingEvent, const anatomist::Control::KeyActionLink &endingAction, bool exclusiveAction, float temporalStep)
const anatomist::Control::KeyActionLink * startingAction() const
Definition control.h:1112
void(T::* Callback)(int posX, int posY, Control::DropAction action)
Definition control.h:374
virtual DropActionLink * clone() const
Definition control_d.h:278
virtual void execute(int posX, int posY, Control::DropAction action)
Definition control_d.h:270
virtual EnterLeaveActionLink * clone() const
Definition control_d.h:191
virtual FocusActionLink * clone() const
Definition control_d.h:163
virtual KeyActionLink * clone() const
Definition control_d.h:68
virtual void execute(int x, int y, int globalX, int globalY)
Definition control_d.h:97
virtual MouseActionLink * clone() const
Definition control_d.h:105
void(T::* Callback)(int x, int y, int globalX, int globalY)
Definition control.h:220
void(T::* Callback)(int, int, int, int)
Definition control.h:349
virtual MoveOrDragActionLink * clone() const
Definition control_d.h:249
virtual void execute(int posX=0, int posY=0, int oldPosX=0, int oldPosY=0)
Definition control_d.h:241
void(T::* Callback)(int xOffset, int yOffset, int height, int width)
Definition control.h:324
virtual PaintActionLink * clone() const
Definition control_d.h:220
virtual void execute(int xOffset, int yOffset, int height, int width)
Definition control_d.h:212
virtual PanActionLink * clone() const
Definition control_d.h:433
void(T::* Callback)(QPanGesture *)
Definition control.h:502
virtual void execute(QPanGesture *)
Definition control_d.h:425
virtual PinchActionLink * clone() const
Definition control_d.h:400
void(T::* Callback)(QPinchGesture *)
Definition control.h:476
virtual void execute(QPinchGesture *)
Definition control_d.h:392
virtual void execute(int height, int width, int oldHeight, int oldWidth)
Definition control_d.h:298
virtual ResizeActionLink * clone() const
Definition control_d.h:306
void(T::* Callback)(int height, int width, int oldHeight, int oldWidth)
Definition control.h:398
virtual SelectionChangedActionLink * clone() const
Definition control_d.h:367
void(T::* Callback)(bool spontaneous)
Definition control.h:450
virtual ShowHideActionLink * clone() const
Definition control_d.h:334
virtual void execute(bool spontaneous)
Definition control_d.h:326
void(T::* Callback)(bool spontaneous)
Definition control.h:425
virtual SwipeActionLink * clone() const
Definition control_d.h:466
virtual void execute(QSwipeGesture *)
Definition control_d.h:458
void(T::* Callback)(QSwipeGesture *)
Definition control.h:580
virtual TapActionLink * clone() const
Definition control_d.h:499
virtual void execute(QTapGesture *)
Definition control_d.h:491
void(T::* Callback)(QTapGesture *)
Definition control.h:528
virtual TapAndHoldActionLink * clone() const
Definition control_d.h:532
void(T::* Callback)(QTapAndHoldGesture *)
Definition control.h:554
virtual void execute(QTapAndHoldGesture *)
Definition control_d.h:524
void(T::* Callback)(QTouchEvent *)
Definition control.h:606
virtual void execute(QTouchEvent *)
Definition control_d.h:557
virtual TouchActionLink * clone() const
Definition control_d.h:565
void(T::* Callback)(int delta, int x, int y, int globalX, int globalY)
Definition control.h:248
virtual void execute(int delta, int x, int y, int globalX, int globalY)
Definition control_d.h:126
virtual WheelActionLink * clone() const
Definition control_d.h:134
int userLevel() const
Definition control.h:130
bool dragEnterEventSubscribe(const MoveOrDragActionLink &actionMethod)
bool paintEventUnsubscribe(const PaintActionLink &actionMethod)
bool hideEventUnsubscribe()
virtual void hideEvent(QHideEvent *event)
bool mouseReleaseButtonEventUnsubscribe(Qt::MouseButtons button, Qt::KeyboardModifiers state, const MouseActionLink &actionMethods)
obsolete, use the other one
bool mouseDoubleClickEventSubscribe(Qt::MouseButtons button, Qt::KeyboardModifiers state, const MouseActionLink &actionMethod, const std::string &name="")
virtual void touchEvent(QTouchEvent *event)
bool touchEventSubscribe(Qt::KeyboardModifiers state, const TouchActionLink &startMethod, const TouchActionLink &moveMethod, const TouchActionLink &stopMethod)
bool dragMoveEventSubscribe(const MoveOrDragActionLink &actionMethod)
bool hideEventSubscribe(const ShowHideActionLink &actionMethod)
std::set< std::string > keyPressActionLinkNames() const
bool selectionChangedEventUnsubscribe()
bool tapEventSubscribe(const TapActionLink &startMethod, const TapActionLink &moveMethod, const TapActionLink &stopMethod, const TapActionLink &cancelMethod)
bool dragEnterEventUnsubscribe(const MoveOrDragActionLink &actionMethod)
bool tapEventUnsubscribe()
MouseActionLink * mousePressActionLinkByName(const std::string &name) const
bool selectionChangedEventUnsubscribe(const SelectionChangedActionLink &actionMethod)
virtual void gestureEvent(QGestureEvent *event)
bool mouseMoveEventUnsubscribe(Qt::MouseButtons button, Qt::KeyboardModifiers state)
bool pinchEventSubscribe(const PinchActionLink &startMethod, const PinchActionLink &moveMethod, const PinchActionLink &stopMethod, const PinchActionLink &cancelMethod)
bool tapAndHoldEventSubscribe(const TapAndHoldActionLink &startMethod, const TapAndHoldActionLink &moveMethod, const TapAndHoldActionLink &stopMethod, const TapAndHoldActionLink &cancelMethod)
bool pinchEventUnsubscribe()
bool keyPressEventSubscribe(int key, Qt::KeyboardModifiers buttonState, const KeyActionLink &actionMethod, const std::string &name="")
bool moveEventSubscribe(const MoveOrDragActionLink &actionMethod)
virtual void mousePressEvent(QMouseEvent *)
bool mousePressButtonEventUnsubscribe(Qt::MouseButtons button, Qt::KeyboardModifiers state, const MouseActionLink &actionMethods)
obsolete, use the other one
virtual void eventAutoSubscription(anatomist::ActionPool *actionPool)
Control(const Control &control)
virtual bool tapGesture(QTapGesture *gesture)
bool keyPressEventUnsubscribe(int key, Qt::KeyboardModifiers buttonState, const KeyActionLink &actionMethods)
obsolete, use the other one
bool keyPressEventUnsubscribe(int key, Qt::KeyboardModifiers buttonState)
bool mousePressButtonEventUnsubscribe(Qt::MouseButtons button, Qt::KeyboardModifiers state)
bool dragMoveEventUnsubscribe(const MoveOrDragActionLink &actionMethod)
Qt::DropAction DropAction
Definition control.h:133
bool showEventSubscribe(const ShowHideActionLink &actionMethod)
virtual void mouseReleaseEvent(QMouseEvent *)
bool dropEventUnsubscribe(const DropActionLink &actionMethod)
bool leaveEventSubscribe(const EnterLeaveActionLink &actionMethod)
virtual void keyPressEvent(QKeyEvent *)
virtual void moveEvent(QMoveEvent *)
bool keyReleaseEventUnsubscribe(int key, Qt::KeyboardModifiers buttonState)
bool dragEnterEventUnsubscribe()
bool moveEventUnsubscribe(const MoveOrDragActionLink &actionMethod)
bool mouseReleaseButtonEventUnsubscribe(Qt::MouseButtons button, Qt::KeyboardModifiers state)
virtual void dragEnterEvent()
bool panEventUnsubscribe()
virtual void wheelEvent(QWheelEvent *)
std::set< std::string > mouseDoubleClickActionLinkNames() const
virtual bool panGesture(QPanGesture *gesture)
bool mouseDoubleClickEventUnsubscribe(Qt::MouseButtons button, Qt::KeyboardModifiers state, const MouseActionLink &actionMethods)
obsolete, use the other one
bool mouseLongEventUnsubscribe(Qt::MouseButtons startingButton, Qt::KeyboardModifiers startingButtonState)
std::set< std::string > keyReleaseActionLinkNames() const
std::set< std::string > mouseMoveActionLinkNames() const
bool focusOutEventSubscribe(const FocusActionLink &actionMethod)
bool showEventUnsubscribe()
const std::string & name() const
Definition control.h:108
bool wheelEventUnsubscribe(const WheelActionLink &actionMethod)
bool wheelEventUnsubscribeAll()
virtual bool tapAndHoldGesture(QTapAndHoldGesture *gesture)
std::map< std::string, anatomist::ActionPtr > actions()
Definition control.h:623
bool enterEventSubscribe(const EnterLeaveActionLink &actionMethod)
bool hideEventUnsubscribe(const ShowHideActionLink &actionMethod)
FocusActionLink * focusInActionLink() const
virtual void keyReleaseEvent(QKeyEvent *)
virtual std::string description() const
bool mouseDoubleClickEventUnsubscribe(Qt::MouseButtons button, Qt::KeyboardModifiers state)
bool focusInEventSubscribe(const FocusActionLink &actionMethod)
bool resizeEventUnsubscribe()
bool keyReleaseEventSubscribe(int key, Qt::KeyboardModifiers buttonState, const KeyActionLink &actionMethod, const std::string &name="")
void inhibitAction(const std::string &action, bool inhibit)
bool keyAndMouseLongEventUnsubscribe(int startingKey, Qt::KeyboardModifiers startingButtonState, Qt::MouseButtons longButton, Qt::KeyboardModifiers longState, int endingKey, Qt::KeyboardModifiers endingButtonState)
bool mousePressButtonEventSubscribe(Qt::MouseButtons button, Qt::KeyboardModifiers state, const MouseActionLink &actionMethod, const std::string &name="")
bool wheelEventSubscribe(const WheelActionLink &actionMethod)
Control(int priority, std::string name)
bool showEventUnsubscribe(const ShowHideActionLink &actionMethod)
virtual void selectionChangedEvent()
MouseActionLink * mouseReleaseActionLinkByName(const std::string &name) const
bool resizeEventSubscribe(const ResizeActionLink &actionMethod)
virtual void focusOutEvent()
bool resizeEventUnsubscribe(const ResizeActionLink &actionMethod)
bool swipeEventUnsubscribe()
bool leaveEventUnsubscribe()
bool keyRepetitiveEventSubscribe(int startingKey, Qt::KeyboardModifiers startingButtonState, const KeyActionLink &startingActionMethod, int endingKey, Qt::KeyboardModifiers endingButtonState, const KeyActionLink &endingActionMethod, bool exclusiveAction, float temporalStep)
bool mouseReleaseButtonEventSubscribe(Qt::MouseButtons button, Qt::KeyboardModifiers state, const MouseActionLink &actionMethod, const std::string &name="")
bool swipeEventSubscribe(const SwipeActionLink &startMethod, const SwipeActionLink &moveMethod, const SwipeActionLink &stopMethod, const SwipeActionLink &cancelMethod)
void setUserLevel(int x)
Definition control.h:131
virtual void paintEvent(QPaintEvent *)
std::map< std::string, anatomist::ActionPtr > myActions
Definition control.h:883
virtual void dragLeaveEvent()
bool keyAndMouseLongEventSubscribe(int startingKey, Qt::KeyboardModifiers startingButtonState, const KeyActionLink &startingActionMethod, Qt::MouseButtons longButton, Qt::KeyboardModifiers longState, const MouseActionLink &longActionMethod, int endingKey, Qt::KeyboardModifiers endingButtonState, const KeyActionLink &endingActionMethod, bool exclusiveAction)
bool enterEventUnsubscribe()
KeyActionLink * keyPressActionLinkByName(const std::string &name) const
void setPriority(int priority)
Definition control.h:625
bool dragLeaveEventUnsubscribe(const MoveOrDragActionLink &actionMethod)
virtual void doAlsoOnDeselect(ActionPool *)
Definition control.h:105
bool dropEventUnsubscribe()
std::set< std::string > mousePressActionLinkNames() const
bool dropEventSubscribe(const DropActionLink &actionMethod)
virtual void doAlsoOnSelect(ActionPool *)
Definition control.h:106
virtual void showEvent(QShowEvent *event)
bool wheelEventUnsubscribe()
virtual void dropEvent(QDropEvent *)
bool touchEventUnsubscribe(Qt::KeyboardModifiers state)
bool panEventSubscribe(const PanActionLink &startMethod, const PanActionLink &moveMethod, const PanActionLink &stopMethod, const PanActionLink &cancelMethod)
virtual void focusInEvent()
virtual void resizeEvent(QResizeEvent *)
KeyActionLink * keyReleaseActionLinkByName(const std::string &name) const
bool enterEventUnsubscribe(const EnterLeaveActionLink &actionMethod)
bool keyRepetitiveEventUnsubscribe(int startingKey, Qt::KeyboardModifiers startingButtonState, int endingKey, Qt::KeyboardModifiers endingButtonState)
bool focusInEventUnsubscribe(const FocusActionLink &actionMethod)
WheelActionLink * wheelActionLink() const
bool paintEventUnsubscribe()
virtual void enterEvent()
virtual void mouseMoveEvent(QMouseEvent *)
bool dragLeaveEventUnsubscribe()
bool keyReleaseEventUnsubscribe(int key, Qt::KeyboardModifiers buttonState, const KeyActionLink &actionMethods)
obsolete, use the other one
bool moveEventUnsubscribe()
virtual void mouseDoubleClickEvent(QMouseEvent *)
bool mouseMoveEventSubscribe(Qt::MouseButtons button, Qt::KeyboardModifiers state, const MouseActionLink &actionMethod, const std::string &name="")
virtual void dragMoveEvent()
bool selectionChangedEventSubscribe(const SelectionChangedActionLink &actionMethod)
virtual bool pinchGesture(QPinchGesture *gesture)
void doOnSelect(ActionPool *pool)
MouseActionLink * mouseDoubleClickActionLinkByName(const std::string &name) const
virtual bool swipeGesture(QSwipeGesture *gesture)
const std::set< std::string > & inhibitedActions() const
bool tapAndHoldEventUnsubscribe()
bool focusOutEventUnsubscribe(const FocusActionLink &actionMethod)
bool dragMoveEventUnsubscribe()
FocusActionLink * focusOutActionLink() const
virtual void leaveEvent()
bool dragLeaveEventSubscribe(const MoveOrDragActionLink &actionMethod)
bool mouseLongEventSubscribe(Qt::MouseButtons startingButton, Qt::KeyboardModifiers startingButtonState, const MouseActionLink &startingActionMethod, const MouseActionLink &longActionMethod, const MouseActionLink &endingActionMethod, bool exclusiveAction)
bool paintEventSubscribe(const PaintActionLink &actionMethod)
static ControlPtr creator(int priority, const std::string &name)
void doOnDeselect(ActionPool *pool)
std::list< std::string > myControlLinksDescription
Definition control.h:884
std::set< std::string > mouseReleaseActionLinkNames() const
bool focusInEventUnsubscribe()
bool leaveEventUnsubscribe(const EnterLeaveActionLink &actionMethod)
MouseActionLink * mouseMoveActionLinkByName(const std::string &name) const
bool mouseMoveEventUnsubscribe(Qt::MouseButtons button, Qt::KeyboardModifiers state, const MouseActionLink &actionMethods)
obsolete, use the other one
bool focusOutEventUnsubscribe()
KeyAndMouseLongEvent(const KeyAndMouseLongEvent &)
KeyAndMouseLongEvent(const Control::KeyMapKey &startingEvent, const Control::KeyActionLink &startingAction, const Control::MouseButtonMapKey &longEvent, const Control::MouseActionLink &longAction, const Control::KeyMapKey &endingEvent, const Control::KeyActionLink &endingAction, bool exclusiveAction)
const Control::KeyActionLink * startingAction() const
Definition control.h:946
const Control::KeyMapKey & startingEvent() const
Definition control.h:945
const Control::KeyMapKey & endingEvent() const
Definition control.h:949
const Control::MouseActionLink * longAction() const
Definition control.h:948
const Control::MouseButtonMapKey & longEvent() const
Definition control.h:947
void executeLong(int x, int y, int globalX, int globalY)
const Control::KeyActionLink * endingAction() const
Definition control.h:950
bool submitKeyReleaseEvent(QKeyEvent *event)
bool mouseLongEventSubscribe(Qt::MouseButtons startingButton, Qt::KeyboardModifiers startingButtonState, const Control::MouseActionLink &startingActionMethod, const Control::MouseActionLink &longActionMethod, const Control::MouseActionLink &endingActionMethod, bool exclusiveAction)
bool keyAndMouseLongEventUnsubscribe(int startingKey, Qt::KeyboardModifiers startingButtonState, Qt::MouseButtons longButton, Qt::KeyboardModifiers longState, int endingKey, Qt::KeyboardModifiers endingButtonState)
bool keyAndMouseLongEventSubscribe(int startingKey, Qt::KeyboardModifiers startingButtonState, const Control::KeyActionLink &startingActionMethod, Qt::MouseButtons longButton, Qt::KeyboardModifiers longState, const Control::MouseActionLink &longActionMethod, int endingKey, Qt::KeyboardModifiers endingButtonState, const Control::KeyActionLink &endingActionMethod, bool exclusiveAction)
bool submitMouseReleaseEvent(QMouseEvent *event)
bool submitMouseMoveEvent(QMouseEvent *event)
bool mouseLongEventUnsubscribe(Qt::MouseButtons startingButton, Qt::KeyboardModifiers startingButtonState)
bool submitMousePressEvent(QMouseEvent *event)
void setMouseTracking(bool)
bool keyRepetitiveEventSubscribe(int startingKey, Qt::KeyboardModifiers startingButtonState, const Control::KeyActionLink &startingActionMethod, int endingKey, Qt::KeyboardModifiers endingButtonState, const Control::KeyActionLink &endingActionMethod, bool exclusiveAction, float temporalStep)
bool submitKeyPressEvent(QKeyEvent *event)
bool keyRepetitiveEventUnsubscribe(int startingKey, Qt::KeyboardModifiers startingButtonState, int endingKey, Qt::KeyboardModifiers endingButtonState)
const Control::MouseButtonMapKey & longEvent() const
Definition control.h:987
const Control::MouseActionLink * longAction() const
Definition control.h:989
const Control::MouseActionLink * endingAction() const
Definition control.h:993
MouseLongEvent(const MouseLongEvent &event)
bool exclusiveAction() const
Definition control.h:995
const Control::MouseActionLink * startingAction() const
Definition control.h:985
void executeLong(int x, int y, int globalX, int globalY)
const Control::MouseButtonMapKey & startingEvent() const
Definition control.h:983
MouseLongEvent(const Control::MouseButtonMapKey &startingEvent, const Control::MouseActionLink &startingAction, const Control::MouseButtonMapKey &longEvent, const Control::MouseActionLink &longAction, const Control::MouseButtonMapKey &endingEvent, const Control::MouseActionLink &endingAction, bool exclusiveAction)
const Control::MouseButtonMapKey & endingEvent() const
Definition control.h:991
void executeEnd(int x, int y, int globalX, int globalY)
void executeStart(int x, int y, int globalX, int globalY)
Action * ActionPtr
Definition action.h:47
Control * ControlPtr
Definition control.h:62
bool operator==(const KeyMapKey &k) const
Definition control.h:140
bool operator!=(const KeyMapKey &k) const
Definition control.h:145
bool operator()(KeyMapKey entry1, KeyMapKey entry2) const
Definition control.h:151
bool operator()(MouseButtonMapKey entry1, MouseButtonMapKey entry2) const
Definition control.h:173
bool operator==(const MouseButtonMapKey &k) const
Definition control.h:164