]> git.proxmox.com Git - sencha-touch.git/blob - src/src/event/recognizer/Recognizer.js
import Sencha Touch 2.4.2 source
[sencha-touch.git] / src / src / event / recognizer / Recognizer.js
1 /**
2 * A base class for all event recognizers in Sencha Touch.
3 *
4 * Sencha Touch, by default, includes various different {@link Ext.event.recognizer.Recognizer} subclasses to recognize
5 * events happening in your application.
6 *
7 * ## Default recognizers
8 *
9 * * {@link Ext.event.recognizer.Tap}
10 * * {@link Ext.event.recognizer.DoubleTap}
11 * * {@link Ext.event.recognizer.LongPress}
12 * * {@link Ext.event.recognizer.Drag}
13 * * {@link Ext.event.recognizer.HorizontalSwipe}
14 * * {@link Ext.event.recognizer.Pinch}
15 * * {@link Ext.event.recognizer.Rotate}
16 *
17 * ## Additional recognizers
18 *
19 * * {@link Ext.event.recognizer.VerticalSwipe}
20 *
21 * If you want to create custom recognizers, or disable recognizers in your Sencha Touch application, please refer to the
22 * documentation in {@link Ext#setup}.
23 *
24 * @private
25 */
26 Ext.define('Ext.event.recognizer.Recognizer', {
27 mixins: ['Ext.mixin.Identifiable'],
28
29 handledEvents: [],
30
31 config: {
32 onRecognized: Ext.emptyFn,
33 onFailed: Ext.emptyFn,
34 callbackScope: null
35 },
36
37 constructor: function(config) {
38 this.initConfig(config);
39
40 return this;
41 },
42
43 getHandledEvents: function() {
44 return this.handledEvents;
45 },
46
47 onStart: Ext.emptyFn,
48
49 onEnd: Ext.emptyFn,
50
51 fail: function() {
52 this.getOnFailed().apply(this.getCallbackScope(), arguments);
53
54 return false;
55 },
56
57 fire: function() {
58 this.getOnRecognized().apply(this.getCallbackScope(), arguments);
59 }
60 });