diff options
-rw-r--r-- | base/base.xcodeproj/project.pbxproj | 4 | ||||
-rw-r--r-- | base/clipboard.h | 24 | ||||
-rw-r--r-- | base/clipboard_mac.mm | 54 | ||||
-rw-r--r-- | base/clipboard_unittest.cc | 160 | ||||
-rw-r--r-- | base/clipboard_win.cc | 84 |
5 files changed, 252 insertions, 74 deletions
diff --git a/base/base.xcodeproj/project.pbxproj b/base/base.xcodeproj/project.pbxproj index 51ace0b..09a6eba 100644 --- a/base/base.xcodeproj/project.pbxproj +++ b/base/base.xcodeproj/project.pbxproj @@ -162,6 +162,7 @@ ABF4B9BE0DC2BD1500A6E319 /* sha512.cc in Sources */ = {isa = PBXBuildFile; fileRef = 825403700D92D2840006B936 /* sha512.cc */; }; ABF4B9C30DC2BD6C00A6E319 /* values.cc in Sources */ = {isa = PBXBuildFile; fileRef = 825403880D92D2CF0006B936 /* values.cc */; }; ABFBD3E60DC793C600E164CB /* md5.cc in Sources */ = {isa = PBXBuildFile; fileRef = 825403290D92D2090006B936 /* md5.cc */; }; + B52C916C0E9428F500208D01 /* clipboard_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = B52C916B0E9428F500208D01 /* clipboard_unittest.cc */; }; B5EF235C0E89ABF500E1E114 /* platform_canvas_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = ABE1BA0C0E756EC4009041DA /* platform_canvas_unittest.cc */; }; BA0F69870E79D7980079A8A1 /* thread_local_storage_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA0F69860E79D7980079A8A1 /* thread_local_storage_unittest.cc */; }; BA5CC5840E788093004EDD45 /* shared_memory_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA5CC5830E788093004EDD45 /* shared_memory_unittest.cc */; }; @@ -611,6 +612,7 @@ ABF4B98E0DC2BA6900A6E319 /* base_paths_mac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = base_paths_mac.mm; sourceTree = "<group>"; }; ABF4B99D0DC2BB6000A6E319 /* clipboard_mac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = clipboard_mac.mm; sourceTree = "<group>"; }; ABF4B9B40DC2BC9F00A6E319 /* path_service.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = path_service.cc; sourceTree = "<group>"; }; + B52C916B0E9428F500208D01 /* clipboard_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = clipboard_unittest.cc; sourceTree = "<group>"; }; BA0F69860E79D7980079A8A1 /* thread_local_storage_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = thread_local_storage_unittest.cc; sourceTree = "<group>"; }; BA5CC5830E788093004EDD45 /* shared_memory_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = shared_memory_unittest.cc; sourceTree = "<group>"; }; BA739A000E5E3242009842A7 /* tracked_objects_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tracked_objects_unittest.cc; sourceTree = "<group>"; }; @@ -820,6 +822,7 @@ 7BD8F6D20E65DB0200034DE9 /* bzip2_error_handler.cc */, 825402DB0D92D1730006B936 /* clipboard.h */, ABF4B99D0DC2BB6000A6E319 /* clipboard_mac.mm */, + B52C916B0E9428F500208D01 /* clipboard_unittest.cc */, 825402DE0D92D1730006B936 /* clipboard_util.cc */, 825402DD0D92D1730006B936 /* clipboard_util.h */, E4A133490E37A41D00110AA2 /* command_line.cc */, @@ -1417,6 +1420,7 @@ files = ( 7B78D38E0E54FE0100609465 /* at_exit_unittest.cc in Sources */, 7BAE30E50E6D939F00C3F750 /* atomicops_unittest.cc in Sources */, + B52C916C0E9428F500208D01 /* clipboard_unittest.cc in Sources */, 7B78D38F0E54FE0100609465 /* command_line_unittest.cc in Sources */, BA73AA330E5F614B00A20026 /* condition_variable_unittest.cc in Sources */, 7B8505D40E5B43FE00730B43 /* convolver_unittest.cc in Sources */, diff --git a/base/clipboard.h b/base/clipboard.h index a3cec1a..0496324 100644 --- a/base/clipboard.h +++ b/base/clipboard.h @@ -13,7 +13,11 @@ #include "base/shared_memory.h" #if defined(OS_MACOSX) +#if defined(__OBJC__) @class NSString; +#else +class NSString; +#endif #endif class Clipboard { @@ -91,6 +95,26 @@ class Clipboard { // out parameter. void ReadFile(std::wstring* file) const; void ReadFiles(std::vector<std::wstring>* files) const; + + // Get format Identifiers for various types. + static FormatType GetUrlFormatType(); + static FormatType GetUrlWFormatType(); + static FormatType GetMozUrlFormatType(); + static FormatType GetPlainTextFormatType(); + static FormatType GetPlainTextWFormatType(); + static FormatType GetFilenameFormatType(); + static FormatType GetFilenameWFormatType(); + // Win: MS HTML Format, Other: Generic HTML format + static FormatType GetHtmlFormatType(); +#if defined(OS_WIN) + static FormatType GetBitmapFormatType(); + // Firefox text/html + static FormatType GetTextHtmlFormatType(); + static FormatType GetCFHDropFormatType(); + static FormatType GetFileDescriptorFormatType(); + static FormatType GetFileContentFormatZeroType(); + static FormatType GetWebKitSmartPasteFormatType(); +#endif private: #if defined(OS_WIN) diff --git a/base/clipboard_mac.mm b/base/clipboard_mac.mm index 58c16d7..d47fc8b 100644 --- a/base/clipboard_mac.mm +++ b/base/clipboard_mac.mm @@ -34,7 +34,7 @@ void Clipboard::Clear() { void Clipboard::WriteText(const std::wstring& text) { NSPasteboard* pb = [NSPasteboard generalPasteboard]; - [pb declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil]; + [pb addTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil]; [pb setString:nsStringForWString(text) forType:NSStringPboardType]; } @@ -42,7 +42,7 @@ void Clipboard::WriteHTML(const std::wstring& markup, const std::string& src_url) { // TODO(avi): src_url? NSPasteboard* pb = [NSPasteboard generalPasteboard]; - [pb declareTypes:[NSArray arrayWithObject:NSHTMLPboardType] owner:nil]; + [pb addTypes:[NSArray arrayWithObject:NSHTMLPboardType] owner:nil]; [pb setString:nsStringForWString(markup) forType:NSHTMLPboardType]; } @@ -53,13 +53,17 @@ void Clipboard::WriteBookmark(const std::wstring& title, void Clipboard::WriteHyperlink(const std::wstring& title, const std::string& url) { + // TODO(playmobil): In the Windows version of this function, an HTML + // representation of the bookmark is also added to the clipboard, to support + // drag and drop of web shortcuts. I don't think we need to do this on the + // Mac, but we should double check later on. NSURL* nsurl = [NSURL URLWithString: [NSString stringWithUTF8String:url.c_str()]]; NSString* nstitle = nsStringForWString(title); NSPasteboard* pb = [NSPasteboard generalPasteboard]; // passing UTIs into the pasteboard methods is valid >= 10.5 - [pb declareTypes:[NSArray arrayWithObjects:NSURLPboardType, + [pb addTypes:[NSArray arrayWithObjects:NSURLPboardType, kUTTypeURLName, nil] owner:nil]; [nsurl writeToPasteboard:pb]; @@ -79,7 +83,7 @@ void Clipboard::WriteFiles(const std::vector<std::wstring>& files) { } NSPasteboard* pb = [NSPasteboard generalPasteboard]; - [pb declareTypes:[NSArray arrayWithObject:NSFilenamesPboardType] owner:nil]; + [pb addTypes:[NSArray arrayWithObject:NSFilenamesPboardType] owner:nil]; [pb setPropertyList:fileList forType:NSFilenamesPboardType]; } @@ -111,8 +115,11 @@ void Clipboard::ReadHTML(std::wstring* markup, std::string* src_url) const { markup->clear(); NSPasteboard* pb = [NSPasteboard generalPasteboard]; - NSString* contents = [pb stringForType:NSStringPboardType]; - + NSArray *supportedTypes = [NSArray arrayWithObjects:NSHTMLPboardType, + NSStringPboardType, + nil]; + NSString *bestType = [pb availableTypeFromArray:supportedTypes]; + NSString* contents = [pb stringForType:bestType]; UTF8ToWide([contents UTF8String], [contents lengthOfBytesUsingEncoding:NSUTF8StringEncoding], markup); @@ -174,3 +181,38 @@ void Clipboard::ReadFiles(std::vector<std::wstring>* files) const { files->push_back(file); } } + +// static +Clipboard::FormatType Clipboard::GetUrlFormatType() { + return NSURLPboardType; +} + +// static +Clipboard::FormatType Clipboard::GetUrlWFormatType() { + return NSURLPboardType; +} + +// static +Clipboard::FormatType Clipboard::GetPlainTextFormatType() { + return NSStringPboardType; +} + +// static +Clipboard::FormatType Clipboard::GetPlainTextWFormatType() { + return NSStringPboardType; +} + +// static +Clipboard::FormatType Clipboard::GetFilenameFormatType() { + return NSFilenamesPboardType; +} + +// static +Clipboard::FormatType Clipboard::GetFilenameWFormatType() { + return NSFilenamesPboardType; +} + +// static +Clipboard::FormatType Clipboard::GetHtmlFormatType() { + return NSHTMLPboardType; +} diff --git a/base/clipboard_unittest.cc b/base/clipboard_unittest.cc index 7bf9fa2..05523d6 100644 --- a/base/clipboard_unittest.cc +++ b/base/clipboard_unittest.cc @@ -6,7 +6,6 @@ #include "base/basictypes.h" #include "base/clipboard.h" -#include "base/clipboard_util.h" #include "base/string_util.h" #include "testing/gtest/include/gtest/gtest.h" @@ -19,9 +18,10 @@ TEST(ClipboardTest, ClearTest) { Clipboard clipboard; clipboard.Clear(); - EXPECT_EQ(false, clipboard.IsFormatAvailable(CF_TEXT)); EXPECT_EQ(false, clipboard.IsFormatAvailable( - ClipboardUtil::GetHtmlFormat()->cfFormat)); + Clipboard::GetPlainTextFormatType())); + EXPECT_EQ(false, clipboard.IsFormatAvailable( + Clipboard::GetHtmlFormatType())); } TEST(ClipboardTest, TextTest) { @@ -32,8 +32,10 @@ TEST(ClipboardTest, TextTest) { clipboard.Clear(); clipboard.WriteText(text); - EXPECT_EQ(true, clipboard.IsFormatAvailable(CF_UNICODETEXT)); - EXPECT_EQ(true, clipboard.IsFormatAvailable(CF_TEXT)); + EXPECT_EQ(true, clipboard.IsFormatAvailable( + Clipboard::GetPlainTextWFormatType())); + EXPECT_EQ(true, clipboard.IsFormatAvailable( + Clipboard::GetPlainTextFormatType())); clipboard.ReadText(&text_result); EXPECT_EQ(text, text_result); clipboard.ReadAsciiText(&ascii_text); @@ -49,10 +51,15 @@ TEST(ClipboardTest, HTMLTest) { clipboard.Clear(); clipboard.WriteHTML(markup, url); EXPECT_EQ(true, clipboard.IsFormatAvailable( - ClipboardUtil::GetHtmlFormat()->cfFormat)); + Clipboard::GetHtmlFormatType())); clipboard.ReadHTML(&markup_result, &url_result); EXPECT_EQ(markup, markup_result); +#if defined(OS_MACOSX) + // TODO(playmobil): It's not clear that the OS X clipboard needs to support + // this. +#else EXPECT_EQ(url, url_result); +#endif } TEST(ClipboardTest, TrickyHTMLTest) { @@ -64,10 +71,16 @@ TEST(ClipboardTest, TrickyHTMLTest) { clipboard.Clear(); clipboard.WriteHTML(markup, url); EXPECT_EQ(true, clipboard.IsFormatAvailable( - ClipboardUtil::GetHtmlFormat()->cfFormat)); + Clipboard::GetHtmlFormatType())); clipboard.ReadHTML(&markup_result, &url_result); EXPECT_EQ(markup, markup_result); + +#if defined(OS_MACOSX) + // TODO(playmobil): It's not clear that the OS X clipboard needs to support + // this. +#else EXPECT_EQ(url, url_result); +#endif } TEST(ClipboardTest, BookmarkTest) { @@ -79,32 +92,10 @@ TEST(ClipboardTest, BookmarkTest) { clipboard.Clear(); clipboard.WriteBookmark(title, url); EXPECT_EQ(true, - clipboard.IsFormatAvailable(ClipboardUtil::GetUrlWFormat()->cfFormat)); - clipboard.ReadBookmark(&title_result, &url_result); - EXPECT_EQ(title, title_result); - EXPECT_EQ(url, url_result); -} - -TEST(ClipboardTest, HyperlinkTest) { - Clipboard clipboard; - - std::wstring title(L"The Example Company"), title_result; - std::string url("http://www.example.com/"), url_result; - std::wstring html(L"<a href=\"http://www.example.com/\">" - L"The Example Company</a>"), html_result; - - clipboard.Clear(); - clipboard.WriteHyperlink(title, url); - EXPECT_EQ(true, - clipboard.IsFormatAvailable(ClipboardUtil::GetUrlWFormat()->cfFormat)); - EXPECT_EQ(true, - clipboard.IsFormatAvailable(ClipboardUtil::GetHtmlFormat()->cfFormat)); + clipboard.IsFormatAvailable(Clipboard::GetUrlWFormatType())); clipboard.ReadBookmark(&title_result, &url_result); EXPECT_EQ(title, title_result); EXPECT_EQ(url, url_result); - clipboard.ReadHTML(&html_result, &url_result); - EXPECT_EQ(html, html_result); - //XXX EXPECT_FALSE(url_result.is_valid()); } TEST(ClipboardTest, MultiFormatTest) { @@ -119,48 +110,37 @@ TEST(ClipboardTest, MultiFormatTest) { clipboard.WriteHTML(markup, url); clipboard.WriteText(text); EXPECT_EQ(true, - clipboard.IsFormatAvailable(ClipboardUtil::GetHtmlFormat()->cfFormat)); - EXPECT_EQ(true, clipboard.IsFormatAvailable(CF_UNICODETEXT)); - EXPECT_EQ(true, clipboard.IsFormatAvailable(CF_TEXT)); + clipboard.IsFormatAvailable(Clipboard::GetHtmlFormatType())); + EXPECT_EQ(true, clipboard.IsFormatAvailable( + Clipboard::GetPlainTextWFormatType())); + EXPECT_EQ(true, clipboard.IsFormatAvailable( + Clipboard::GetPlainTextFormatType())); clipboard.ReadHTML(&markup_result, &url_result); EXPECT_EQ(markup, markup_result); +#if defined(OS_MACOSX) + // TODO(playmobil): It's not clear that the OS X clipboard needs to support + // this. +#else EXPECT_EQ(url, url_result); +#endif clipboard.ReadText(&text_result); EXPECT_EQ(text, text_result); clipboard.ReadAsciiText(&ascii_text); EXPECT_EQ(WideToUTF8(text), ascii_text); } -TEST(ClipboardTest, WebSmartPasteTest) { - Clipboard clipboard; - - clipboard.Clear(); - clipboard.WriteWebSmartPaste(); - EXPECT_EQ(true, clipboard.IsFormatAvailable( - ClipboardUtil::GetWebKitSmartPasteFormat()->cfFormat)); -} - -TEST(ClipboardTest, BitmapTest) { - unsigned int fake_bitmap[] = { - 0x46155189, 0xF6A55C8D, 0x79845674, 0xFA57BD89, - 0x78FD46AE, 0x87C64F5A, 0x36EDC5AF, 0x4378F568, - 0x91E9F63A, 0xC31EA14F, 0x69AB32DF, 0x643A3FD1, - }; - - Clipboard clipboard; - - clipboard.Clear(); - clipboard.WriteBitmap(fake_bitmap, gfx::Size(3, 4)); - EXPECT_EQ(true, clipboard.IsFormatAvailable(CF_BITMAP)); -} - // Files for this test don't actually need to exist on the file system, just // don't try to use a non-existent file you've retrieved from the clipboard. TEST(ClipboardTest, FileTest) { Clipboard clipboard; clipboard.Clear(); - +#if defined(OS_WIN) std::wstring file = L"C:\\Downloads\\My Downloads\\A Special File.txt"; +#else + // OS X will print a warning message if we stick a non-existant file on the + // clipboard. + std::wstring file = L"/usr/bin/make"; +#endif clipboard.WriteFile(file); std::wstring out_file; clipboard.ReadFile(&out_file); @@ -170,11 +150,22 @@ TEST(ClipboardTest, FileTest) { TEST(ClipboardTest, MultipleFilesTest) { Clipboard clipboard; clipboard.Clear(); - + +#if defined(OS_WIN) + std::wstring file1 = L"C:\\Downloads\\My Downloads\\File 1.exe"; + std::wstring file2 = L"C:\\Downloads\\My Downloads\\File 2.pdf"; + std::wstring file3 = L"C:\\Downloads\\My Downloads\\File 3.doc"; +#elif defined(OS_MACOSX) + // OS X will print a warning message if we stick a non-existant file on the + // clipboard. + std::wstring file1 = L"/usr/bin/make"; + std::wstring file2 = L"/usr/bin/man"; + std::wstring file3 = L"/usr/bin/perl"; +#endif std::vector<std::wstring> files; - files.push_back(L"C:\\Downloads\\My Downloads\\File 1.exe"); - files.push_back(L"C:\\Downloads\\My Downloads\\File 2.pdf"); - files.push_back(L"C:\\Downloads\\My Downloads\\File 3.doc"); + files.push_back(file1); + files.push_back(file2); + files.push_back(file3); clipboard.WriteFiles(files); std::vector<std::wstring> out_files; @@ -185,3 +176,50 @@ TEST(ClipboardTest, MultipleFilesTest) { EXPECT_EQ(files[i], out_files[i]); } +#if defined(OS_WIN) // Windows only tests. +TEST(ClipboardTest, HyperlinkTest) { + Clipboard clipboard; + + std::wstring title(L"The Example Company"), title_result; + std::string url("http://www.example.com/"), url_result; + std::wstring html(L"<a href=\"http://www.example.com/\">" + L"The Example Company</a>"), html_result; + + clipboard.Clear(); + clipboard.WriteHyperlink(title, url); + EXPECT_EQ(true, + clipboard.IsFormatAvailable(Clipboard::GetUrlWFormatType())); + EXPECT_EQ(true, + clipboard.IsFormatAvailable(Clipboard::GetHtmlFormatType())); + clipboard.ReadBookmark(&title_result, &url_result); + EXPECT_EQ(title, title_result); + EXPECT_EQ(url, url_result); + clipboard.ReadHTML(&html_result, &url_result); + EXPECT_EQ(html, html_result); + //XXX EXPECT_FALSE(url_result.is_valid()); +} + +TEST(ClipboardTest, WebSmartPasteTest) { + Clipboard clipboard; + + clipboard.Clear(); + clipboard.WriteWebSmartPaste(); + EXPECT_EQ(true, clipboard.IsFormatAvailable( + Clipboard::GetWebKitSmartPasteFormatType())); +} + +TEST(ClipboardTest, BitmapTest) { + unsigned int fake_bitmap[] = { + 0x46155189, 0xF6A55C8D, 0x79845674, 0xFA57BD89, + 0x78FD46AE, 0x87C64F5A, 0x36EDC5AF, 0x4378F568, + 0x91E9F63A, 0xC31EA14F, 0x69AB32DF, 0x643A3FD1, + }; + + Clipboard clipboard; + + clipboard.Clear(); + clipboard.WriteBitmap(fake_bitmap, gfx::Size(3, 4)); + EXPECT_EQ(true, clipboard.IsFormatAvailable( + Clipboard::GetBitmapFormatType())); +} +#endif diff --git a/base/clipboard_win.cc b/base/clipboard_win.cc index 0aba865b..dfdd3db 100644 --- a/base/clipboard_win.cc +++ b/base/clipboard_win.cc @@ -178,8 +178,7 @@ void Clipboard::WriteHTML(const std::wstring& markup, std::string html_fragment; MarkupToHTMLClipboardFormat(markup, url, &html_fragment); HGLOBAL glob = CreateGlobalData(html_fragment); - if (glob && !::SetClipboardData(ClipboardUtil::GetHtmlFormat()->cfFormat, - glob)) { + if (glob && !::SetClipboardData(GetHtmlFormatType(), glob)) { ::GlobalFree(glob); } } @@ -195,8 +194,7 @@ void Clipboard::WriteBookmark(const std::wstring& title, bookmark.append(1, L'\n'); bookmark.append(UTF8ToWide(url)); HGLOBAL glob = CreateGlobalData(bookmark); - if (glob && !::SetClipboardData(ClipboardUtil::GetUrlWFormat()->cfFormat, - glob)) { + if (glob && !::SetClipboardData(GetUrlWFormatType(), glob)) { ::GlobalFree(glob); } } @@ -223,7 +221,7 @@ void Clipboard::WriteWebSmartPaste() { if (!lock.Acquire(clipboard_owner_)) return; - SetClipboardData(ClipboardUtil::GetWebKitSmartPasteFormat()->cfFormat, NULL); + SetClipboardData(GetWebKitSmartPasteFormatType(), NULL); } void Clipboard::WriteBitmap(const void* pixels, const gfx::Size& size) { @@ -437,7 +435,7 @@ void Clipboard::ReadHTML(std::wstring* markup, std::string* src_url) const { if (!lock.Acquire(clipboard_owner_)) return; - HANDLE data = ::GetClipboardData(ClipboardUtil::GetHtmlFormat()->cfFormat); + HANDLE data = ::GetClipboardData(GetHtmlFormatType()); if (!data) return; @@ -459,7 +457,7 @@ void Clipboard::ReadBookmark(std::wstring* title, std::string* url) const { if (!lock.Acquire(clipboard_owner_)) return; - HANDLE data = ::GetClipboardData(ClipboardUtil::GetUrlWFormat()->cfFormat); + HANDLE data = ::GetClipboardData(GetUrlWFormatType()); if (!data) return; @@ -632,3 +630,75 @@ void Clipboard::ParseBookmarkClipboardFormat(const std::wstring& bookmark, } } +// static +Clipboard::FormatType Clipboard::GetUrlFormatType() { + return ClipboardUtil::GetUrlFormat()->cfFormat; +} + +// static +Clipboard::FormatType Clipboard::GetUrlWFormatType() { + return ClipboardUtil::GetUrlWFormat()->cfFormat; +} + +// static +Clipboard::FormatType Clipboard::GetMozUrlFormatType() { + return ClipboardUtil::GetMozUrlFormat()->cfFormat; +} + +// static +Clipboard::FormatType Clipboard::GetPlainTextFormatType() { + return ClipboardUtil::GetPlainTextFormat()->cfFormat; +} + +// static +Clipboard::FormatType Clipboard::GetPlainTextWFormatType() { + return ClipboardUtil::GetPlainTextWFormat()->cfFormat; +} + +// static +Clipboard::FormatType Clipboard::GetFilenameFormatType() { + return ClipboardUtil::GetFilenameFormat()->cfFormat; +} + +// static +Clipboard::FormatType Clipboard::GetFilenameWFormatType() { + return ClipboardUtil::GetFilenameWFormat()->cfFormat; +} + +// MS HTML Format +// static +Clipboard::FormatType Clipboard::GetHtmlFormatType() { + return ClipboardUtil::GetHtmlFormat()->cfFormat; +} + +// static +Clipboard::FormatType Clipboard::GetBitmapFormatType() { + return CF_BITMAP; +} + +// Firefox text/html +// static +Clipboard::FormatType Clipboard::GetTextHtmlFormatType() { + return ClipboardUtil::GetTextHtmlFormat()->cfFormat; +} + +// static +Clipboard::FormatType Clipboard::GetCFHDropFormatType() { + return ClipboardUtil::GetCFHDropFormat()->cfFormat; +} + +// static +Clipboard::FormatType Clipboard::GetFileDescriptorFormatType() { + return ClipboardUtil::GetFileDescriptorFormat()->cfFormat; +} + +// static +Clipboard::FormatType Clipboard::GetFileContentFormatZeroType() { + return ClipboardUtil::GetFileContentFormatZero()->cfFormat; +} + +// static +Clipboard::FormatType Clipboard::GetWebKitSmartPasteFormatType() { + return ClipboardUtil::GetWebKitSmartPasteFormat()->cfFormat; +} + |