| 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 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 #ifndef TouchEvent_h | 27 #ifndef TouchEvent_h |
| 28 #define TouchEvent_h | 28 #define TouchEvent_h |
| 29 | 29 |
| 30 #include "core/events/EventDispatchMediator.h" | 30 #include "core/events/EventDispatchMediator.h" |
| 31 #include "core/events/MouseRelatedEvent.h" | 31 #include "core/events/MouseRelatedEvent.h" |
| 32 #include "core/dom/TouchList.h" | 32 #include "core/dom/TouchList.h" |
| 33 | 33 |
| 34 namespace WebCore { | 34 namespace WebCore { |
| 35 | 35 |
| 36 class TouchEvent : public MouseRelatedEvent { | 36 class TouchEvent FINAL : public MouseRelatedEvent { |
| 37 public: | 37 public: |
| 38 virtual ~TouchEvent(); | 38 virtual ~TouchEvent(); |
| 39 | 39 |
| 40 static PassRefPtr<TouchEvent> create() | 40 static PassRefPtr<TouchEvent> create() |
| 41 { | 41 { |
| 42 return adoptRef(new TouchEvent); | 42 return adoptRef(new TouchEvent); |
| 43 } | 43 } |
| 44 static PassRefPtr<TouchEvent> create(TouchList* touches, | 44 static PassRefPtr<TouchEvent> create(TouchList* touches, |
| 45 TouchList* targetTouches, TouchList* changedTouches, | 45 TouchList* targetTouches, TouchList* changedTouches, |
| 46 const AtomicString& type, PassRefPtr<AbstractView> view, | 46 const AtomicString& type, PassRefPtr<AbstractView> view, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 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(PassRefPtr<TouchList> touches) { m_touches = touches; } | 65 void setTouches(PassRefPtr<TouchList> touches) { m_touches = touches; } |
| 66 void setTargetTouches(PassRefPtr<TouchList> targetTouches) { m_targetTouches
= targetTouches; } | 66 void setTargetTouches(PassRefPtr<TouchList> targetTouches) { m_targetTouches
= targetTouches; } |
| 67 void setChangedTouches(PassRefPtr<TouchList> changedTouches) { m_changedTouc
hes = changedTouches; } | 67 void setChangedTouches(PassRefPtr<TouchList> changedTouches) { m_changedTouc
hes = changedTouches; } |
| 68 | 68 |
| 69 virtual bool isTouchEvent() const OVERRIDE; | 69 virtual bool isTouchEvent() const OVERRIDE; |
| 70 | 70 |
| 71 virtual const AtomicString& interfaceName() const; | 71 virtual const AtomicString& interfaceName() const OVERRIDE; |
| 72 | 72 |
| 73 private: | 73 private: |
| 74 TouchEvent(); | 74 TouchEvent(); |
| 75 TouchEvent(TouchList* touches, TouchList* targetTouches, | 75 TouchEvent(TouchList* touches, TouchList* targetTouches, |
| 76 TouchList* changedTouches, const AtomicString& type, | 76 TouchList* changedTouches, const AtomicString& type, |
| 77 PassRefPtr<AbstractView>, int screenX, int screenY, int pageX, | 77 PassRefPtr<AbstractView>, int screenX, int screenY, int pageX, |
| 78 int pageY, | 78 int pageY, |
| 79 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey); | 79 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey); |
| 80 | 80 |
| 81 RefPtr<TouchList> m_touches; | 81 RefPtr<TouchList> m_touches; |
| 82 RefPtr<TouchList> m_targetTouches; | 82 RefPtr<TouchList> m_targetTouches; |
| 83 RefPtr<TouchList> m_changedTouches; | 83 RefPtr<TouchList> m_changedTouches; |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 class TouchEventDispatchMediator : public EventDispatchMediator { | 86 class TouchEventDispatchMediator FINAL : public EventDispatchMediator { |
| 87 public: | 87 public: |
| 88 static PassRefPtr<TouchEventDispatchMediator> create(PassRefPtr<TouchEvent>)
; | 88 static PassRefPtr<TouchEventDispatchMediator> create(PassRefPtr<TouchEvent>)
; |
| 89 | 89 |
| 90 private: | 90 private: |
| 91 explicit TouchEventDispatchMediator(PassRefPtr<TouchEvent>); | 91 explicit TouchEventDispatchMediator(PassRefPtr<TouchEvent>); |
| 92 TouchEvent* event() const; | 92 TouchEvent* event() const; |
| 93 virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; | 93 virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 DEFINE_EVENT_TYPE_CASTS(TouchEvent); | 96 DEFINE_EVENT_TYPE_CASTS(TouchEvent); |
| 97 | 97 |
| 98 } // namespace WebCore | 98 } // namespace WebCore |
| 99 | 99 |
| 100 #endif // TouchEvent_h | 100 #endif // TouchEvent_h |
| OLD | NEW |