]> git.saurik.com Git - iphone-api.git/blob - WebCore/TouchList.h
Adding the WebCore headers (for Cydget).
[iphone-api.git] / WebCore / TouchList.h
1 /*
2 * Copyright (C) 2008, Apple Inc. All rights reserved.
3 *
4 * No license or rights are granted by Apple expressly or by implication,
5 * estoppel, or otherwise, to Apple copyrights, patents, trademarks, trade
6 * secrets or other rights.
7 */
8
9 #ifndef TouchList_h
10 #define TouchList_h
11
12 #include <wtf/Platform.h>
13
14 #if ENABLE(TOUCH_EVENTS)
15
16 #include <wtf/RefCounted.h>
17 #include <wtf/PassRefPtr.h>
18 #include <wtf/Vector.h>
19 #include "Touch.h"
20
21 namespace WebCore {
22
23 class TouchList : public RefCounted<TouchList> {
24 public:
25 static PassRefPtr<TouchList> create()
26 {
27 return adoptRef(new TouchList());
28 }
29 virtual ~TouchList() {}
30
31 virtual bool isTouchList() { return true; }
32
33 unsigned length() const { return m_values.size(); }
34 Touch* item (unsigned index) { return index < length() ? m_values[index].get() : 0; }
35
36 void append(const PassRefPtr<Touch>);
37
38 private:
39 TouchList() { }
40
41 Vector<RefPtr<Touch> > m_values;
42 };
43
44 } // namespace WebCore
45
46 #endif // ENABLE(TOUCH_EVENTS)
47
48 #endif // TouchList_h