24#include <com/sun/star/datatransfer/UnsupportedFlavorException.hpp>
25#include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
26#include <com/sun/star/datatransfer/clipboard/XFlushableClipboard.hpp>
28#include <boost/property_tree/json_parser.hpp>
44 uno::Any aRet = ::cppu::queryInterface(rType,
static_cast<datatransfer::XTransferable*
>(
this));
45 return (aRet.
hasValue() ? aRet : OWeakObject::queryInterface(rType));
52 if (nT != SotClipboardFormatId::HTML)
54 throw datatransfer::UnsupportedFlavorException();
57 uno::Sequence<sal_Int8> sData(
size);
58 std::memcpy(sData.getArray(),
data.getStr(),
size);
64 uno::Sequence<datatransfer::DataFlavor> aDataFlavors(1);
65 auto ref = aDataFlavors.getArray()[0];
66 ref.MimeType =
"text/html";
75 return (nT == SotClipboardFormatId::HTML);
static bool GetFormatDataFlavor(SotClipboardFormatId nFormat, css::datatransfer::DataFlavor &rFlavor)
static SotClipboardFormatId GetFormat(const css::datatransfer::DataFlavor &rFlavor)
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
HtmlTransferable(OString sData)
sal_Bool SAL_CALL isDataFlavorSupported(const css::datatransfer::DataFlavor &aFlavor) override
css::uno::Any SAL_CALL getTransferData(const css::datatransfer::DataFlavor &aFlavor) override
css::uno::Sequence< css::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors() override
virtual ~HtmlTransferable() override