KDEUI
kgesture.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KGESTURE_H
00021 #define KGESTURE_H
00022
00023 #include <kdeui_export.h>
00024
00025 #include <QtCore/QString>
00026 #include <QtGui/QPolygon>
00027
00028
00029
00030
00031
00032
00033
00034
00035 class KShapeGesturePrivate;
00036
00037 class KDEUI_EXPORT KShapeGesture
00038 {
00039 public:
00043 KShapeGesture();
00044
00054 KShapeGesture(const QPolygon &shape);
00055
00060 KShapeGesture(const QString &description);
00061
00066 KShapeGesture(const KShapeGesture &other);
00067
00071 ~KShapeGesture();
00072
00076 void setShape(const QPolygon &shape);
00077
00081 void setShapeName(const QString &friendlyName);
00082
00086 QString shapeName() const;
00087
00092 bool isValid() const;
00093
00101 QString toString() const;
00102
00110 QByteArray toSvg(const QString &attributes = QString()) const;
00111
00118 float distance(const KShapeGesture &other, float abortThreshold) const;
00119
00123 KShapeGesture &operator=(const KShapeGesture &other);
00124
00128 bool operator==(const KShapeGesture &other) const;
00129
00133 bool operator!=(const KShapeGesture &other) const;
00134
00138 uint hashable() const;
00139
00140 private:
00141 KShapeGesturePrivate * const d;
00142 };
00143
00144 uint qHash(int);
00145 inline uint qHash(const KShapeGesture &key)
00146 {
00147 return qHash(key.hashable());
00148 }
00149
00150 class KRockerGesturePrivate;
00151
00152 class KDEUI_EXPORT KRockerGesture
00153 {
00154 public:
00158 KRockerGesture();
00159
00164 KRockerGesture(enum Qt::MouseButton hold, enum Qt::MouseButton thenPush);
00165
00170 KRockerGesture(const QString &description);
00171
00176 KRockerGesture(const KRockerGesture &other);
00177
00181 ~KRockerGesture();
00182
00186 void setButtons(Qt::MouseButton hold, Qt::MouseButton thenPush);
00187
00191 void getButtons(Qt::MouseButton *hold, Qt::MouseButton *thenPush) const;
00192
00196 QString rockerName() const;
00197
00201 static QString mouseButtonName(Qt::MouseButton button);
00202
00206 bool isValid() const;
00207
00215 QString toString() const;
00216
00220 KRockerGesture &operator=(const KRockerGesture &other);
00221
00225 bool operator==(const KRockerGesture &other) const;
00226
00230 bool operator!=(const KRockerGesture &other) const;
00231
00235 uint hashable() const;
00236
00237 private:
00238 KRockerGesturePrivate * const d;
00239 };
00240
00241 inline uint qHash(const KRockerGesture &key)
00242 {
00243 return qHash(key.hashable());
00244 }
00245
00246
00247 #endif