diff options
author | Steve Block <steveblock@google.com> | 2010-02-02 14:57:50 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-02-04 15:06:55 +0000 |
commit | d0825bca7fe65beaee391d30da42e937db621564 (patch) | |
tree | 7461c49eb5844ffd1f35d1ba2c8b7584c1620823 /WebCore/platform/gtk/DataObjectGtk.h | |
parent | 3db770bd97c5a59b6c7574ca80a39e5a51c1defd (diff) | |
download | external_webkit-d0825bca7fe65beaee391d30da42e937db621564.zip external_webkit-d0825bca7fe65beaee391d30da42e937db621564.tar.gz external_webkit-d0825bca7fe65beaee391d30da42e937db621564.tar.bz2 |
Merge webkit.org at r54127 : Initial merge by git
Change-Id: Ib661abb595522f50ea406f72d3a0ce17f7193c82
Diffstat (limited to 'WebCore/platform/gtk/DataObjectGtk.h')
-rw-r--r-- | WebCore/platform/gtk/DataObjectGtk.h | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/WebCore/platform/gtk/DataObjectGtk.h b/WebCore/platform/gtk/DataObjectGtk.h new file mode 100644 index 0000000..f1a2647 --- /dev/null +++ b/WebCore/platform/gtk/DataObjectGtk.h @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2009, Martin Robinson + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef DataObjectGtk_h +#define DataObjectGtk_h + +#include "CString.h" +#include "FileList.h" +#include "KURL.h" +#include "Range.h" +#include "StringHash.h" +#include <wtf/RefCounted.h> +#include <wtf/gtk/GRefPtr.h> + +typedef struct _GdkPixbuf GdkPixbuf; +typedef struct _GdkDragContext GdkDragContext; +typedef struct _GtkClipboard GtkClipboard; + +namespace WebCore { + +class DataObjectGtk : public RefCounted<DataObjectGtk> { +public: + static PassRefPtr<DataObjectGtk> create() + { + return adoptRef(new DataObjectGtk()); + } + + Vector<KURL> uriList() { return m_uriList; } + GdkPixbuf* image() { return m_image.get(); } + void setRange(PassRefPtr<Range> newRange) { m_range = newRange; } + void setURIList(const Vector<KURL>& newURIList) { m_uriList = newURIList; } + void setImage(GdkPixbuf* newImage) { m_image = newImage; } + void setDragContext(GdkDragContext* newDragContext) { m_dragContext = newDragContext; } + bool hasText() { return m_range || !m_text.isEmpty(); } + bool hasMarkup() { return m_range || !m_markup.isEmpty(); } + bool hasURIList() { return !m_uriList.isEmpty(); } + bool hasImage() { return m_image; } + GdkDragContext* dragContext() { return m_dragContext.get(); } + + String text(); + String markup(); + Vector<String> files(); + void setText(const String& newText); + void setMarkup(const String& newMarkup); + bool hasURL(); + String url(); + String urlLabel(); + void clear(); + + static DataObjectGtk* forClipboard(GtkClipboard*); + +private: + String m_text; + String m_markup; + Vector<KURL> m_uriList; + GRefPtr<GdkPixbuf> m_image; + GRefPtr<GdkDragContext> m_dragContext; + RefPtr<Range> m_range; +}; + +} + +#endif // DataObjectGtk_h |