1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #ifndef INCLUDED_DESKTOP_SOURCE_LIB_LOKCLIPBOARD_HXX
11 #define INCLUDED_DESKTOP_SOURCE_LIB_LOKCLIPBOARD_HXX
15 #include <cppuhelper/implbase.hxx>
16 #include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
18 /// A clipboard implementation for LibreOfficeKit.
19 class LOKClipboard
: public cppu::WeakImplHelper
<css::datatransfer::clipboard::XClipboard
>
21 css::uno::Reference
<css::datatransfer::XTransferable
> m_xTransferable
;
24 virtual css::uno::Reference
<css::datatransfer::XTransferable
> SAL_CALL
getContents()
25 throw(css::uno::RuntimeException
, std::exception
) override
;
27 virtual void SAL_CALL
setContents(const css::uno::Reference
<css::datatransfer::XTransferable
>& xTransferable
,
28 const css::uno::Reference
<css::datatransfer::clipboard::XClipboardOwner
>& xClipboardOwner
)
29 throw(css::uno::RuntimeException
, std::exception
) override
;
31 virtual OUString SAL_CALL
getName() throw(css::uno::RuntimeException
, std::exception
) override
;
34 /// Represents the contents of LOKClipboard.
35 class LOKTransferable
: public cppu::WeakImplHelper
<css::datatransfer::XTransferable
>
38 css::uno::Sequence
<sal_Int8
> m_aSequence
;
40 /// Provides a list of flavors, used by getTransferDataFlavors() and isDataFlavorSupported().
41 std::vector
<css::datatransfer::DataFlavor
> getTransferDataFlavorsAsVector();
44 LOKTransferable(const char* pMimeType
, const char* pData
, size_t nSize
);
46 virtual css::uno::Any SAL_CALL
getTransferData(const css::datatransfer::DataFlavor
& rFlavor
)
47 throw(css::datatransfer::UnsupportedFlavorException
, css::io::IOException
, css::uno::RuntimeException
, std::exception
) override
;
49 virtual css::uno::Sequence
<css::datatransfer::DataFlavor
> SAL_CALL
getTransferDataFlavors()
50 throw(css::uno::RuntimeException
, std::exception
) override
;
52 virtual sal_Bool SAL_CALL
isDataFlavorSupported(const css::datatransfer::DataFlavor
& rFlavor
)
53 throw(css::uno::RuntimeException
, std::exception
) override
;
58 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */