| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey); | 61 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey); |
| 62 | 62 |
| 63 TouchList* touches() const { return m_touches.get(); } | 63 TouchList* touches() const { return m_touches.get(); } |
| 64 TouchList* targetTouches() const { return m_targetTouches.get(); } | 64 TouchList* targetTouches() const { return m_targetTouches.get(); } |
| 65 TouchList* changedTouches() const { return m_changedTouches.get(); } | 65 TouchList* changedTouches() const { return m_changedTouches.get(); } |
| 66 | 66 |
| 67 void setTouches(PassRefPtr<TouchList> touches) { m_touches = touches; } | 67 void setTouches(PassRefPtr<TouchList> touches) { m_touches = touches; } |
| 68 void setTargetTouches(PassRefPtr<TouchList> targetTouches) { m_targetTouches
= targetTouches; } | 68 void setTargetTouches(PassRefPtr<TouchList> targetTouches) { m_targetTouches
= targetTouches; } |
| 69 void setChangedTouches(PassRefPtr<TouchList> changedTouches) { m_changedTouc
hes = changedTouches; } | 69 void setChangedTouches(PassRefPtr<TouchList> changedTouches) { m_changedTouc
hes = changedTouches; } |
| 70 | 70 |
| 71 #if PLATFORM(BLACKBERRY) | |
| 72 void setDoubleTap(bool doubleTap) { m_doubleTap = doubleTap; } | |
| 73 bool isDoubleTap() const { return m_doubleTap; } | |
| 74 void setTouchHold(bool touchHold) { m_touchHold = touchHold; } | |
| 75 bool isTouchHold() const { return m_touchHold; } | |
| 76 #endif | |
| 77 virtual bool isTouchEvent() const OVERRIDE; | 71 virtual bool isTouchEvent() const OVERRIDE; |
| 78 | 72 |
| 79 virtual const AtomicString& interfaceName() const; | 73 virtual const AtomicString& interfaceName() const; |
| 80 | 74 |
| 81 private: | 75 private: |
| 82 TouchEvent(); | 76 TouchEvent(); |
| 83 TouchEvent(TouchList* touches, TouchList* targetTouches, | 77 TouchEvent(TouchList* touches, TouchList* targetTouches, |
| 84 TouchList* changedTouches, const AtomicString& type, | 78 TouchList* changedTouches, const AtomicString& type, |
| 85 PassRefPtr<AbstractView>, int screenX, int screenY, int pageX, | 79 PassRefPtr<AbstractView>, int screenX, int screenY, int pageX, |
| 86 int pageY, | 80 int pageY, |
| 87 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey); | 81 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey); |
| 88 | 82 |
| 89 RefPtr<TouchList> m_touches; | 83 RefPtr<TouchList> m_touches; |
| 90 RefPtr<TouchList> m_targetTouches; | 84 RefPtr<TouchList> m_targetTouches; |
| 91 RefPtr<TouchList> m_changedTouches; | 85 RefPtr<TouchList> m_changedTouches; |
| 92 #if PLATFORM(BLACKBERRY) | |
| 93 bool m_touchHold; | |
| 94 bool m_doubleTap; | |
| 95 #endif | |
| 96 }; | 86 }; |
| 97 | 87 |
| 98 class TouchEventDispatchMediator : public EventDispatchMediator { | 88 class TouchEventDispatchMediator : public EventDispatchMediator { |
| 99 public: | 89 public: |
| 100 static PassRefPtr<TouchEventDispatchMediator> create(PassRefPtr<TouchEvent>)
; | 90 static PassRefPtr<TouchEventDispatchMediator> create(PassRefPtr<TouchEvent>)
; |
| 101 | 91 |
| 102 private: | 92 private: |
| 103 explicit TouchEventDispatchMediator(PassRefPtr<TouchEvent>); | 93 explicit TouchEventDispatchMediator(PassRefPtr<TouchEvent>); |
| 104 TouchEvent* event() const; | 94 TouchEvent* event() const; |
| 105 virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; | 95 virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; |
| 106 }; | 96 }; |
| 107 | 97 |
| 108 inline TouchEvent* toTouchEvent(Event* event) | 98 inline TouchEvent* toTouchEvent(Event* event) |
| 109 { | 99 { |
| 110 ASSERT(event && event->isTouchEvent()); | 100 ASSERT(event && event->isTouchEvent()); |
| 111 return static_cast<TouchEvent*>(event); | 101 return static_cast<TouchEvent*>(event); |
| 112 } | 102 } |
| 113 | 103 |
| 114 } // namespace WebCore | 104 } // namespace WebCore |
| 115 | 105 |
| 116 #endif // ENABLE(TOUCH_EVENTS) | 106 #endif // ENABLE(TOUCH_EVENTS) |
| 117 | 107 |
| 118 #endif // TouchEvent_h | 108 #endif // TouchEvent_h |
| OLD | NEW |