#ifndef DataObject_h
#define DataObject_h
#include "core/clipboard/DataObjectItem.h"
#include "heap/Handle.h"
#include "platform/PasteMode.h"
#include "platform/Supplementable.h"
#include "wtf/ListHashSet.h"
#include "wtf/RefCounted.h"
#include "wtf/RefPtr.h"
#include "wtf/Vector.h"
#include "wtf/text/StringHash.h"
#include "wtf/text/WTFString.h"
namespace WebCore {
class KURL;
class SharedBuffer;
class DataObject : public RefCountedWillBeGarbageCollectedFinalized<DataObject>, public WillBeHeapSupplementable<DataObject> {
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DataObject);
public:
static PassRefPtrWillBeRawPtr<DataObject> createFromPasteboard(PasteMode);
static PassRefPtrWillBeRawPtr<DataObject> create();
PassRefPtrWillBeRawPtr<DataObject> copy() const;
size_t length() const;
PassRefPtrWillBeRawPtr<DataObjectItem> item(unsigned long index);
void deleteItem(unsigned long index);
void clearAll();
PassRefPtrWillBeRawPtr<DataObjectItem> add(const String& data, const String& type);
PassRefPtrWillBeRawPtr<DataObjectItem> add(PassRefPtrWillBeRawPtr<File>);
void clearData(const String& type);
void clearAllExceptFiles();
ListHashSet<String> types() const;
String getData(const String& type) const;
bool setData(const String& type, const String& data);
void urlAndTitle(String& url, String* title = 0) const;
void setURLAndTitle(const String& url, const String& title);
void htmlAndBaseURL(String& html, KURL& baseURL) const;
void setHTMLAndBaseURL(const String& html, const KURL& baseURL);
bool containsFilenames() const;
Vector<String> filenames() const;
void addFilename(const String& filename, const String& displayName);
void addSharedBuffer(const String& name, PassRefPtr<SharedBuffer>);
int modifierKeyState() const { return m_modifierKeyState; }
void setModifierKeyState(int modifierKeyState) { m_modifierKeyState = modifierKeyState; }
void trace(Visitor*);
private:
DataObject();
explicit DataObject(const DataObject&);
PassRefPtrWillBeRawPtr<DataObjectItem> findStringItem(const String& type) const;
bool internalAddStringItem(PassRefPtrWillBeRawPtr<DataObjectItem>);
void internalAddFileItem(PassRefPtrWillBeRawPtr<DataObjectItem>);
WillBeHeapVector<RefPtrWillBeMember<DataObjectItem> > m_itemList;
int m_modifierKeyState;
};
}
#endif