• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • sources
  • kde-4.14
  • kdelibs
  • kdeui
  • shortcuts
kgesture.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (C) 2006,2007 Andreas Hartmetz (ahartmetz@gmail.com)
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef KGESTURE_H
21 #define KGESTURE_H
22 
23 #include <kdeui_export.h>
24 
25 #include <QtCore/QString>
26 #include <QtGui/QPolygon>
27 
28 /*
29  kinds of gestures:
30  -shapes like triangle, right angle, line
31  -"rocker" (i.e. two mouse button) gestures
32  */
33 
34 
35 class KShapeGesturePrivate;
36 //TODO: implement operator== for special situations like in KKeyChooser.
37 class KDEUI_EXPORT KShapeGesture
38 {
39 public:
43  KShapeGesture();
44 
54  KShapeGesture(const QPolygon &shape);
55 
60  KShapeGesture(const QString &description);
61 
66  KShapeGesture(const KShapeGesture &other);
67 
71  ~KShapeGesture();
72 
76  void setShape(const QPolygon &shape);
77 
81  void setShapeName(const QString &friendlyName);
82 
86  QString shapeName() const;
87 
92  bool isValid() const;
93 
101  QString toString() const;
102 
110  QByteArray toSvg(const QString &attributes = QString()) const;
111 
118  float distance(const KShapeGesture &other, float abortThreshold) const;
119 
123  KShapeGesture &operator=(const KShapeGesture &other);
124 
128  bool operator==(const KShapeGesture &other) const;
129 
133  bool operator!=(const KShapeGesture &other) const;
134 
138  uint hashable() const;
139 
140 private:
141  KShapeGesturePrivate * const d;
142 };
143 
144 uint qHash(int);
145 inline uint qHash(const KShapeGesture &key)
146 {
147  return qHash(key.hashable());
148 }
149 
150 class KRockerGesturePrivate;
151 
152 class KDEUI_EXPORT KRockerGesture
153 {
154 public:
158  KRockerGesture();
159 
164  KRockerGesture(enum Qt::MouseButton hold, enum Qt::MouseButton thenPush);
165 
170  KRockerGesture(const QString &description);
171 
176  KRockerGesture(const KRockerGesture &other);
177 
181  ~KRockerGesture();
182 
186  void setButtons(Qt::MouseButton hold, Qt::MouseButton thenPush);
187 
191  void getButtons(Qt::MouseButton *hold, Qt::MouseButton *thenPush) const;
192 
196  QString rockerName() const;
197 
201  static QString mouseButtonName(Qt::MouseButton button);
202 
206  bool isValid() const;
207 
215  QString toString() const;
216 
220  KRockerGesture &operator=(const KRockerGesture &other);
221 
225  bool operator==(const KRockerGesture &other) const;
226 
230  bool operator!=(const KRockerGesture &other) const;
231 
235  uint hashable() const;
236 
237 private:
238  KRockerGesturePrivate * const d;
239 };
240 
241 inline uint qHash(const KRockerGesture &key)
242 {
243  return qHash(key.hashable());
244 }
245 
246 //KGESTURE_H
247 #endif
QByteArray
KRockerGesture::hashable
uint hashable() const
Return an opaque value for use in hash tables.
Definition: kgesture.cpp:602
KRockerGesture
Definition: kgesture.h:152
operator!=
bool operator!=(const KEntry &k1, const KEntry &k2)
QPolygon
operator==
bool operator==(const KEntry &k1, const KEntry &k2)
qHash
uint qHash(int)
QString
KShapeGesture::hashable
uint hashable() const
Return an opaque value for use in hash tables.
Definition: kgesture.cpp:384
KShapeGesture
Definition: kgesture.h:37
kdeui_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal