#ifndef DragData_h
#define DragData_h
#include "core/page/DragActions.h"
#include "platform/geometry/IntPoint.h"
#include "platform/heap/Handle.h"
#include "wtf/Forward.h"
#include "wtf/HashMap.h"
#include "wtf/Vector.h"
namespace WebCore {
class DataObject;
class DocumentFragment;
class LocalFrame;
class KURL;
class Range;
enum DragApplicationFlags {
DragApplicationNone = 0,
DragApplicationIsModal = 1,
DragApplicationIsSource = 2,
DragApplicationHasAttachedSheet = 4,
DragApplicationIsCopyKeyDown = 8
};
class DragData {
public:
enum FilenameConversionPolicy { DoNotConvertFilenames, ConvertFilenames };
DragData(DataObject*, const IntPoint& clientPosition, const IntPoint& globalPosition, DragOperation, DragApplicationFlags = DragApplicationNone);
DragData(const String& dragStorageName, const IntPoint& clientPosition, const IntPoint& globalPosition, DragOperation, DragApplicationFlags = DragApplicationNone);
const IntPoint& clientPosition() const { return m_clientPosition; }
const IntPoint& globalPosition() const { return m_globalPosition; }
DragApplicationFlags flags() const { return m_applicationFlags; }
DataObject* platformData() const { return m_platformDragData; }
DragOperation draggingSourceOperationMask() const { return m_draggingSourceOperationMask; }
bool containsURL(FilenameConversionPolicy filenamePolicy = ConvertFilenames) const;
bool containsPlainText() const;
bool containsCompatibleContent() const;
String asURL(FilenameConversionPolicy filenamePolicy = ConvertFilenames, String* title = 0) const;
String asPlainText() const;
void asFilenames(Vector<String>&) const;
PassRefPtr<DocumentFragment> asFragment(LocalFrame*, PassRefPtrWillBeRawPtr<Range> context, bool allowPlainText, bool& chosePlainText) const;
bool canSmartReplace() const;
bool containsFiles() const;
unsigned numberOfFiles() const;
int modifierKeyState() const;
String droppedFileSystemId() const;
private:
IntPoint m_clientPosition;
IntPoint m_globalPosition;
DataObject* m_platformDragData;
DragOperation m_draggingSourceOperationMask;
DragApplicationFlags m_applicationFlags;
};
}
#endif