sw: document SwFormatVertOrient
[LibreOffice.git] / vcl / ios / clipboard.hxx
blob0868409126501fc0ed2d88741901416b61d31814
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 #pragma once
22 #include "DataFlavorMapping.hxx"
23 #include <rtl/ustring.hxx>
24 #include <sal/types.h>
25 #include <cppuhelper/compbase.hxx>
26 #include <com/sun/star/datatransfer/XTransferable.hpp>
27 #include <com/sun/star/datatransfer/clipboard/XClipboardEx.hpp>
28 #include <com/sun/star/datatransfer/clipboard/XClipboardOwner.hpp>
29 #include <com/sun/star/datatransfer/clipboard/XClipboardListener.hpp>
30 #include <com/sun/star/datatransfer/clipboard/XClipboardNotifier.hpp>
31 #include <com/sun/star/datatransfer/clipboard/XSystemClipboard.hpp>
32 #include <com/sun/star/datatransfer/XMimeContentTypeFactory.hpp>
33 #include <com/sun/star/datatransfer/clipboard/XFlushableClipboard.hpp>
34 #include <com/sun/star/lang/XServiceInfo.hpp>
35 #include <cppuhelper/basemutex.hxx>
36 #include <com/sun/star/lang/XMultiComponentFactory.hpp>
38 #include <list>
40 #include <premac.h>
41 #import <UIKit/UIKit.h>
42 #include <postmac.h>
44 class iOSClipboard
45 : public ::cppu::BaseMutex,
46 public ::cppu::WeakComponentImplHelper<css::datatransfer::clipboard::XSystemClipboard,
47 css::lang::XServiceInfo>
49 public:
50 iOSClipboard();
52 virtual ~iOSClipboard() override;
53 iOSClipboard(const iOSClipboard&) = delete;
54 iOSClipboard& operator=(const iOSClipboard&) = delete;
56 // XClipboard
58 css::uno::Reference<css::datatransfer::XTransferable> SAL_CALL getContents() override;
60 void SAL_CALL setContents(
61 const css::uno::Reference<css::datatransfer::XTransferable>& xTransferable,
62 const css::uno::Reference<css::datatransfer::clipboard::XClipboardOwner>& xClipboardOwner)
63 override;
65 OUString SAL_CALL getName() override;
67 // XClipboardEx
69 sal_Int8 SAL_CALL getRenderingCapabilities() override;
71 // XClipboardNotifier
73 void SAL_CALL addClipboardListener(
74 const css::uno::Reference<css::datatransfer::clipboard::XClipboardListener>& listener)
75 override;
77 void SAL_CALL removeClipboardListener(
78 const css::uno::Reference<css::datatransfer::clipboard::XClipboardListener>& listener)
79 override;
81 // XServiceInfo
83 OUString SAL_CALL getImplementationName() override;
85 sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
87 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
89 private:
90 /* Notify the current clipboard owner that he is no longer the clipboard owner. */
91 void fireLostClipboardOwnershipEvent(
92 css::uno::Reference<css::datatransfer::clipboard::XClipboardOwner> const& oldOwner,
93 css::uno::Reference<css::datatransfer::XTransferable> const& oldContent);
95 /* Notify all registered XClipboardListener that the clipboard content has changed. */
96 void
97 fireClipboardChangedEvent(css::uno::Reference<css::datatransfer::XTransferable> xNewContents);
99 private:
100 css::uno::Reference<css::datatransfer::XMimeContentTypeFactory> mrXMimeCntFactory;
101 std::list<css::uno::Reference<css::datatransfer::clipboard::XClipboardListener>>
102 mClipboardListeners;
103 css::uno::Reference<css::datatransfer::clipboard::XClipboardOwner> mXClipboardOwner;
104 std::shared_ptr<DataFlavorMapper> mpDataFlavorMapper;
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */