]> git.sesse.net Git - kdenlive/blob - src/trackpanelfunction.h
Reindent all source files
[kdenlive] / src / trackpanelfunction.h
1 /***************************************************************************
2                           trackpanelfunction.h  -  description
3                              -------------------
4     begin                : Sun May 18 2003
5     copyright            : (C) 2003 by Jason Wood
6     email                : jasonwood@blueyonder.co.uk
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 #ifndef TRACKPANELFUNCTION_H
18 #define TRACKPANELFUNCTION_H
19
20 #include "qcursor.h"
21 #include "qobject.h"
22
23 #include "documenttrack.h"
24 #include "gentime.h"
25
26 class QMouseEvent;
27
28 /**
29 Abstract Base Class for track panel functionality decorators. This and it's
30 derived classes allow different behaviours to be added to panels as required.
31
32 @author Jason Wood
33 */
34 class TrackPanelFunction: public QObject {
35 Q_OBJECT public:
36     TrackPanelFunction();
37
38     virtual ~ TrackPanelFunction();
39
40     /**
41     Returns true if the specified position should cause this function to activate,
42     otherwise returns false.
43     */
44     virtual bool mouseApplies(DocumentTrack * panel,
45                               QMouseEvent * event) const = 0;
46
47     /**
48     Returns a relevant mouse cursor for the given mouse position
49     */
50     virtual QCursor getMouseCursor(DocumentTrack * panel,
51                                    QMouseEvent * event) = 0;
52
53     /**
54     A mouse button has been pressed. Returns true if we want to handle this event
55     */
56     virtual bool mousePressed(DocumentTrack * panel,
57                               QMouseEvent * event) = 0;
58
59     virtual bool mouseDoubleClicked(DocumentTrack * panel, QMouseEvent * event) = 0;
60
61     /**
62     Mouse Release Events in the track view area. Returns true if we have finished
63     an operation now.
64     */
65     virtual bool mouseReleased(DocumentTrack * panel,
66                                QMouseEvent * event) = 0;
67
68     /**
69     Processes Mouse Move events in the track view area. Returns true if we are
70     continuing with the drag.*/
71     virtual bool mouseMoved(DocumentTrack * panel,
72                             QMouseEvent * event) = 0;
73
74     /**
75     Process Drag events*/
76     virtual bool dragEntered(DocumentTrack * , QDragEnterEvent *) {
77         return false;
78     };
79     virtual bool dragMoved(DocumentTrack * , QDragMoveEvent *) {
80         return false;
81     };
82     virtual bool dragLeft(DocumentTrack * , QDragLeaveEvent *) {
83         return false;
84     };
85     virtual bool dragDropped(DocumentTrack * , QDropEvent *) {
86         return false;
87     };
88
89 };
90
91 #endif