The class declaration should be the first header in the cc file for
[shopper.git] / src / ui / Gesture.h
blob9b6ab9a35c10674a461ab439b7bd2eab6e7abb98
1 /* Shopper
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
17 * 02110-1301 USA
21 #ifndef GESTURE_H
22 #define GESTURE_H
23 #include <QObject>
25 class GestureConnectionStore : public QObject
27 Q_OBJECT;
28 GestureConnectionStore();
29 signals:
30 void activated();
31 friend class Gesture;
34 // A Gesture is a shape
35 class Gesture
37 public:
38 Gesture(QString shape);
39 Gesture(const Gesture &g); // Copy constructor
40 ~Gesture();
42 void addStroke(QString stroke);
43 QString shape() const;
45 protected:
46 friend class GestureWatcher; // Can see these methods
47 friend bool operator==(const Gesture &A, const Gesture &B);
48 friend uint qHash(const Gesture &A);
50 Gesture(Gesture *g); // Copy constructor
51 void connect(QObject* receiver, const char* method);
52 bool disconnect(QObject* receiver, const char* method);
53 void invoke();
55 private:
56 struct Private;
57 struct Connection;
58 Private *p;
62 bool operator==(const Gesture &A, const Gesture &B);
63 uint qHash(const Gesture &A);
65 #endif //GESTURE_H