OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2008, 2009, Google Inc. All rights reserved. | 2 * Copyright (c) 2008, 2009, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
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 | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 28 matching lines...) Expand all Loading... |
39 #include "wtf/RefCounted.h" | 39 #include "wtf/RefCounted.h" |
40 #include "wtf/RefPtr.h" | 40 #include "wtf/RefPtr.h" |
41 #include "wtf/Vector.h" | 41 #include "wtf/Vector.h" |
42 #include "wtf/text/StringHash.h" | 42 #include "wtf/text/StringHash.h" |
43 #include "wtf/text/WTFString.h" | 43 #include "wtf/text/WTFString.h" |
44 | 44 |
45 namespace blink { | 45 namespace blink { |
46 | 46 |
47 class KURL; | 47 class KURL; |
48 class SharedBuffer; | 48 class SharedBuffer; |
| 49 class WebDragData; |
49 | 50 |
50 // A data object for holding data that would be in a clipboard or moved | 51 // A data object for holding data that would be in a clipboard or moved |
51 // during a drag-n-drop operation. This is the data that WebCore is aware | 52 // during a drag-n-drop operation. This is the data that WebCore is aware |
52 // of and is not specific to a platform. | 53 // of and is not specific to a platform. |
53 class DataObject : public RefCountedWillBeGarbageCollectedFinalized<DataObject>,
public WillBeHeapSupplementable<DataObject> { | 54 class DataObject : public RefCountedWillBeGarbageCollectedFinalized<DataObject>,
public WillBeHeapSupplementable<DataObject> { |
54 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DataObject); | 55 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DataObject); |
55 public: | 56 public: |
56 static PassRefPtrWillBeRawPtr<DataObject> createFromPasteboard(PasteMode); | 57 static PassRefPtrWillBeRawPtr<DataObject> createFromPasteboard(PasteMode); |
57 static PassRefPtrWillBeRawPtr<DataObject> create(); | 58 static PassRefPtrWillBeRawPtr<DataObject> create(); |
| 59 static PassRefPtrWillBeRawPtr<DataObject> create(WebDragData); |
58 | 60 |
59 virtual ~DataObject(); | 61 virtual ~DataObject(); |
60 | 62 |
61 // DataTransferItemList support. | 63 // DataTransferItemList support. |
62 size_t length() const; | 64 size_t length() const; |
63 PassRefPtrWillBeRawPtr<DataObjectItem> item(unsigned long index); | 65 PassRefPtrWillBeRawPtr<DataObjectItem> item(unsigned long index); |
64 // FIXME: Implement V8DataTransferItemList::indexedPropertyDeleter to get th
is called. | 66 // FIXME: Implement V8DataTransferItemList::indexedPropertyDeleter to get th
is called. |
65 void deleteItem(unsigned long index); | 67 void deleteItem(unsigned long index); |
66 void clearAll(); | 68 void clearAll(); |
67 // Returns null if an item already exists with the provided type. | 69 // Returns null if an item already exists with the provided type. |
(...skipping 22 matching lines...) Expand all Loading... |
90 const String& filesystemId() const { ASSERT(!m_filesystemId.isEmpty()); retu
rn m_filesystemId; } | 92 const String& filesystemId() const { ASSERT(!m_filesystemId.isEmpty()); retu
rn m_filesystemId; } |
91 | 93 |
92 // Used to handle files (images) being dragged out. | 94 // Used to handle files (images) being dragged out. |
93 void addSharedBuffer(const String& name, PassRefPtr<SharedBuffer>); | 95 void addSharedBuffer(const String& name, PassRefPtr<SharedBuffer>); |
94 | 96 |
95 int modifierKeyState() const { return m_modifierKeyState; } | 97 int modifierKeyState() const { return m_modifierKeyState; } |
96 void setModifierKeyState(int modifierKeyState) { m_modifierKeyState = modifi
erKeyState; } | 98 void setModifierKeyState(int modifierKeyState) { m_modifierKeyState = modifi
erKeyState; } |
97 | 99 |
98 DECLARE_TRACE(); | 100 DECLARE_TRACE(); |
99 | 101 |
| 102 WebDragData toWebDragData(); |
| 103 |
100 private: | 104 private: |
101 DataObject(); | 105 DataObject(); |
102 | 106 |
103 PassRefPtrWillBeRawPtr<DataObjectItem> findStringItem(const String& type) co
nst; | 107 PassRefPtrWillBeRawPtr<DataObjectItem> findStringItem(const String& type) co
nst; |
104 bool internalAddStringItem(PassRefPtrWillBeRawPtr<DataObjectItem>); | 108 bool internalAddStringItem(PassRefPtrWillBeRawPtr<DataObjectItem>); |
105 void internalAddFileItem(PassRefPtrWillBeRawPtr<DataObjectItem>); | 109 void internalAddFileItem(PassRefPtrWillBeRawPtr<DataObjectItem>); |
106 | 110 |
107 WillBeHeapVector<RefPtrWillBeMember<DataObjectItem> > m_itemList; | 111 WillBeHeapVector<RefPtrWillBeMember<DataObjectItem> > m_itemList; |
108 | 112 |
109 // State of Shift/Ctrl/Alt/Meta keys. | 113 // State of Shift/Ctrl/Alt/Meta keys. |
110 int m_modifierKeyState; | 114 int m_modifierKeyState; |
111 String m_filesystemId; | 115 String m_filesystemId; |
112 }; | 116 }; |
113 | 117 |
114 } // namespace blink | 118 } // namespace blink |
115 | 119 |
116 #endif | 120 #endif |
OLD | NEW |