OSDN Git Service

[denncoCreator] minor improvements
[dennco/denncoCreator.git] / Source / visualizer / eventhandler / dcveventhandler.h
1 //  Copyright (c) 2012 Dennco Project
2 //
3 // This program is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, either version 3 of the License, or
6 // (at your option) any later version.
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
16 //
17 //  Created by tkawata on Sep-30, 2012.
18 //
19 #ifndef DCVEVENTHANDLER_H
20 #define DCVEVENTHANDLER_H
21
22 class DCScene;
23 class DCCreator;
24 class DCUIGraphicsScene;
25
26 #include <QtGui>
27
28 class DCVEventHandler
29 {
30     DCUIGraphicsScene   *d_widget;
31     DCCreator           *d_creator;
32     DCScene             *d_scene;
33
34 public:
35     DCVEventHandler(DCUIGraphicsScene *widget, DCCreator *creator, DCScene *scene);
36     virtual ~DCVEventHandler() {}
37
38     inline DCUIGraphicsScene    *getView() const { return d_widget; }
39     inline DCScene              *getScene() const { return d_scene; }
40     inline DCCreator            *getController() const { return d_creator; }
41
42     virtual int  getHandlerType() const = 0;
43     virtual void mousePressEvent(QGraphicsSceneMouseEvent *event) = 0;
44     virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) = 0;
45     virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event, int clickTimeElapsed) = 0;
46     virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event, bool wasDrag) = 0;
47     virtual void wheelEvent(QGraphicsSceneWheelEvent  *event) = 0;
48     virtual void keyPressEvent(QKeyEvent *event) = 0;
49     virtual void keyReleaseEvent(QKeyEvent *event) = 0;
50     virtual void showContextMenu(const QPoint &pos) = 0;
51     virtual void selectedPageChanged(const void *requester) = 0;
52 };
53
54 #endif // DCVEVENTHANDLER_H