Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / vcl / ios / iOSTransferable.hxx
blob5c685dba89498d6296c7352b4774ca2426136393
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2 /*
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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_VCL_IOS_IOSTRANSFERABLE_HXX
21 #define INCLUDED_VCL_IOS_IOSTRANSFERABLE_HXX
23 #include <com/sun/star/datatransfer/XTransferable.hpp>
24 #include <cppuhelper/implbase.hxx>
25 #include <com/sun/star/datatransfer/XMimeContentTypeFactory.hpp>
26 #include <com/sun/star/datatransfer/XMimeContentType.hpp>
28 #include "DataFlavorMapping.hxx"
30 #include <premac.h>
31 #import <UIKit/UIKit.h>
32 #include <postmac.h>
34 #include <memory>
35 #include <vector>
37 class iOSTransferable : public ::cppu::WeakImplHelper<css::datatransfer::XTransferable>
39 public:
40 explicit iOSTransferable(
41 css::uno::Reference<css::datatransfer::XMimeContentTypeFactory> const& rXMimeCntFactory,
42 std::shared_ptr<DataFlavorMapper> pDataFlavorMapper, UIPasteboard* pasteboard);
44 virtual ~iOSTransferable() override;
45 iOSTransferable(const iOSTransferable&) = delete;
46 iOSTransferable& operator=(const iOSTransferable&) = delete;
48 // XTransferable
50 virtual css::uno::Any SAL_CALL
51 getTransferData(const css::datatransfer::DataFlavor& aFlavor) override;
53 css::uno::Sequence<css::datatransfer::DataFlavor> SAL_CALL getTransferDataFlavors() override;
55 sal_Bool SAL_CALL isDataFlavorSupported(const css::datatransfer::DataFlavor& aFlavor) override;
57 // Helper functions not part of the XTransferable interface
59 void initClipboardItemList();
61 bool compareDataFlavors(const css::datatransfer::DataFlavor& lhs,
62 const css::datatransfer::DataFlavor& rhs);
64 private:
65 css::uno::Sequence<css::datatransfer::DataFlavor> mFlavorList;
66 css::uno::Reference<css::datatransfer::XMimeContentTypeFactory> mrXMimeCntFactory;
67 std::shared_ptr<DataFlavorMapper> mDataFlavorMapper;
68 UIPasteboard* mPasteboard;
71 #endif
73 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */