OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008, The Android Open Source Project | 2 * Copyright 2008, The Android Open Source Project |
3 * Copyright (C) 2012 Research In Motion Limited. All rights reserved. | 3 * Copyright (C) 2012 Research In Motion Limited. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above copyright | 10 * * Redistributions in binary form must reproduce the above copyright |
(...skipping 27 matching lines...) Expand all Loading... |
38 public: | 38 public: |
39 virtual ~TouchEvent(); | 39 virtual ~TouchEvent(); |
40 | 40 |
41 static PassRefPtrWillBeRawPtr<TouchEvent> create() | 41 static PassRefPtrWillBeRawPtr<TouchEvent> create() |
42 { | 42 { |
43 return adoptRefWillBeNoop(new TouchEvent); | 43 return adoptRefWillBeNoop(new TouchEvent); |
44 } | 44 } |
45 static PassRefPtrWillBeRawPtr<TouchEvent> create(TouchList* touches, | 45 static PassRefPtrWillBeRawPtr<TouchEvent> create(TouchList* touches, |
46 TouchList* targetTouches, TouchList* changedTouches, | 46 TouchList* targetTouches, TouchList* changedTouches, |
47 const AtomicString& type, PassRefPtrWillBeRawPtr<AbstractView> view, | 47 const AtomicString& type, PassRefPtrWillBeRawPtr<AbstractView> view, |
48 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool cancelable, | 48 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool cancelable,
bool causesScrollingIfUncanceled, |
49 double uiCreateTime = 0) | 49 double uiCreateTime = 0) |
50 { | 50 { |
51 return adoptRefWillBeNoop(new TouchEvent(touches, targetTouches, changed
Touches, type, view, | 51 return adoptRefWillBeNoop(new TouchEvent(touches, targetTouches, changed
Touches, type, view, |
52 ctrlKey, altKey, shiftKey, metaKey, cancelable, uiCreateTime)); | 52 ctrlKey, altKey, shiftKey, metaKey, cancelable, causesScrollingIfUnc
anceled, uiCreateTime)); |
53 } | 53 } |
54 | 54 |
55 void initTouchEvent(TouchList* touches, TouchList* targetTouches, | 55 void initTouchEvent(TouchList* touches, TouchList* targetTouches, |
56 TouchList* changedTouches, const AtomicString& type, | 56 TouchList* changedTouches, const AtomicString& type, |
57 PassRefPtrWillBeRawPtr<AbstractView>, | 57 PassRefPtrWillBeRawPtr<AbstractView>, |
58 int, int, int, int, // unused useless members of web exposed API | 58 int, int, int, int, // unused useless members of web exposed API |
59 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey); | 59 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey); |
60 | 60 |
61 TouchList* touches() const { return m_touches.get(); } | 61 TouchList* touches() const { return m_touches.get(); } |
62 TouchList* targetTouches() const { return m_targetTouches.get(); } | 62 TouchList* targetTouches() const { return m_targetTouches.get(); } |
63 TouchList* changedTouches() const { return m_changedTouches.get(); } | 63 TouchList* changedTouches() const { return m_changedTouches.get(); } |
64 | 64 |
65 void setTouches(PassRefPtrWillBeRawPtr<TouchList> touches) { m_touches = tou
ches; } | 65 void setTouches(PassRefPtrWillBeRawPtr<TouchList> touches) { m_touches = tou
ches; } |
66 void setTargetTouches(PassRefPtrWillBeRawPtr<TouchList> targetTouches) { m_t
argetTouches = targetTouches; } | 66 void setTargetTouches(PassRefPtrWillBeRawPtr<TouchList> targetTouches) { m_t
argetTouches = targetTouches; } |
67 void setChangedTouches(PassRefPtrWillBeRawPtr<TouchList> changedTouches) { m
_changedTouches = changedTouches; } | 67 void setChangedTouches(PassRefPtrWillBeRawPtr<TouchList> changedTouches) { m
_changedTouches = changedTouches; } |
68 | 68 |
| 69 bool causesScrollingIfUncanceled() const { return m_causesScrollingIfUncance
led; } |
| 70 |
69 virtual bool isTouchEvent() const override; | 71 virtual bool isTouchEvent() const override; |
70 | 72 |
71 virtual const AtomicString& interfaceName() const override; | 73 virtual const AtomicString& interfaceName() const override; |
72 | 74 |
73 virtual void preventDefault() override; | 75 virtual void preventDefault() override; |
74 | 76 |
75 virtual void trace(Visitor*) override; | 77 virtual void trace(Visitor*) override; |
76 | 78 |
77 private: | 79 private: |
78 TouchEvent(); | 80 TouchEvent(); |
79 TouchEvent(TouchList* touches, TouchList* targetTouches, | 81 TouchEvent(TouchList* touches, TouchList* targetTouches, |
80 TouchList* changedTouches, const AtomicString& type, | 82 TouchList* changedTouches, const AtomicString& type, |
81 PassRefPtrWillBeRawPtr<AbstractView>, | 83 PassRefPtrWillBeRawPtr<AbstractView>, |
82 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool cancela
ble, | 84 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool cancela
ble, bool causesScrollingIfUncanceled, |
83 double uiCreateTime = 0); | 85 double uiCreateTime = 0); |
84 | 86 |
85 RefPtrWillBeMember<TouchList> m_touches; | 87 RefPtrWillBeMember<TouchList> m_touches; |
86 RefPtrWillBeMember<TouchList> m_targetTouches; | 88 RefPtrWillBeMember<TouchList> m_targetTouches; |
87 RefPtrWillBeMember<TouchList> m_changedTouches; | 89 RefPtrWillBeMember<TouchList> m_changedTouches; |
| 90 bool m_causesScrollingIfUncanceled; |
88 }; | 91 }; |
89 | 92 |
90 class TouchEventDispatchMediator final : public EventDispatchMediator { | 93 class TouchEventDispatchMediator final : public EventDispatchMediator { |
91 public: | 94 public: |
92 static PassRefPtrWillBeRawPtr<TouchEventDispatchMediator> create(PassRefPtrW
illBeRawPtr<TouchEvent>); | 95 static PassRefPtrWillBeRawPtr<TouchEventDispatchMediator> create(PassRefPtrW
illBeRawPtr<TouchEvent>); |
93 | 96 |
94 private: | 97 private: |
95 explicit TouchEventDispatchMediator(PassRefPtrWillBeRawPtr<TouchEvent>); | 98 explicit TouchEventDispatchMediator(PassRefPtrWillBeRawPtr<TouchEvent>); |
96 TouchEvent& event() const; | 99 TouchEvent& event() const; |
97 virtual bool dispatchEvent(EventDispatcher&) const override; | 100 virtual bool dispatchEvent(EventDispatcher&) const override; |
98 }; | 101 }; |
99 | 102 |
100 DEFINE_EVENT_TYPE_CASTS(TouchEvent); | 103 DEFINE_EVENT_TYPE_CASTS(TouchEvent); |
101 | 104 |
102 } // namespace blink | 105 } // namespace blink |
103 | 106 |
104 #endif // TouchEvent_h | 107 #endif // TouchEvent_h |
OLD | NEW |