1 // Copyright (c) 2012 Dennco Project
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.
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.
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/>.
17 // Created by tkawata on Sep-30, 2012.
19 #ifndef DCVEVENTHANDLER_H
20 #define DCVEVENTHANDLER_H
24 class DCUIGraphicsScene;
30 DCUIGraphicsScene *d_widget;
35 DCVEventHandler(DCUIGraphicsScene *widget, DCCreator *creator, DCScene *scene);
36 virtual ~DCVEventHandler() {}
38 inline DCUIGraphicsScene *getView() const { return d_widget; }
39 inline DCScene *getScene() const { return d_scene; }
40 inline DCCreator *getController() const { return d_creator; }
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;
54 #endif // DCVEVENTHANDLER_H