blob: db2c7380bb25c591423586873c38a381d0c7a270 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_DESKTOP_SOURCE_LIB_LOKCLIPBOARD_HXX
#define INCLUDED_DESKTOP_SOURCE_LIB_LOKCLIPBOARD_HXX
#include <vector>
#include <cppuhelper/implbase.hxx>
#include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
/// A clipboard implementation for LibreOfficeKit.
class LOKClipboard : public cppu::WeakImplHelper<css::datatransfer::clipboard::XClipboard>
{
css::uno::Reference<css::datatransfer::XTransferable> m_xTransferable;
public:
css::uno::Reference<css::datatransfer::XTransferable> SAL_CALL getContents() override;
void SAL_CALL setContents(
const css::uno::Reference<css::datatransfer::XTransferable>& xTransferable,
const css::uno::Reference<css::datatransfer::clipboard::XClipboardOwner>& xClipboardOwner)
override;
OUString SAL_CALL getName() override;
};
/// Represents the contents of LOKClipboard.
class LOKTransferable : public cppu::WeakImplHelper<css::datatransfer::XTransferable>
{
OUString m_aMimeType;
css::uno::Sequence<sal_Int8> m_aSequence;
/// Provides a list of flavors, used by getTransferDataFlavors() and isDataFlavorSupported().
std::vector<css::datatransfer::DataFlavor> getTransferDataFlavorsAsVector();
public:
LOKTransferable(const char* pMimeType, const char* pData, std::size_t nSize);
LOKTransferable(OUString sMimeType, const css::uno::Sequence<sal_Int8>& aSequence);
css::uno::Any SAL_CALL getTransferData(const css::datatransfer::DataFlavor& rFlavor) override;
css::uno::Sequence<css::datatransfer::DataFlavor> SAL_CALL getTransferDataFlavors() override;
sal_Bool SAL_CALL isDataFlavorSupported(const css::datatransfer::DataFlavor& rFlavor) override;
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|