2 * Copyright (C) 2008 David Greaves
4 * This software is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public License
6 * as published by the Free Software Foundation; either version 2.1 of
7 * the License, or (at your option) any later version.
9 * This software is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this software; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 #ifndef GESTUREREADER_H
21 #define GESTUREREADER_H
23 #include "shopper.h" // automake, i8n, gettext
26 // This class is used to record gesture events
27 // These can be press, release and move
28 // as some gestures may have multiple strokes
36 typedef enum _Type
{ Move
, Release
, Press
, Start
, Invalid
} Type
;
37 typedef enum _Direction
{ None
,
38 Up
, Right
, Down
, Left
,
39 UpRight
, DownRight
, DownLeft
, UpLeft
} Direction
;
42 Point( int _x
, int _y
, int _len
, Point::Direction _dir
, Point::Type _type
);
45 friend class GestureReader
;
48 int len2
; // length squared
57 void start(int x
, int y
);
58 void addPoint(int x
, int y
, Point::Type type
);
60 Gesture
matchOne( QList
<Gesture
> gs
);
64 QString
generateStrokes();
70 #endif //GESTUREREADER_H