Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / forms / source / richtext / clipboarddispatcher.hxx
blob2384cc07a88997a52c23d8eebe74ab84aee669ba
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_FORMS_SOURCE_RICHTEXT_CLIPBOARDDISPATCHER_HXX
21 #define INCLUDED_FORMS_SOURCE_RICHTEXT_CLIPBOARDDISPATCHER_HXX
23 #include "featuredispatcher.hxx"
24 #include <tools/link.hxx>
26 class TransferableClipboardListener;
27 class TransferableDataHelper;
29 namespace frm
32 class OClipboardDispatcher : public ORichTextFeatureDispatcher
34 public:
35 enum ClipboardFunc
37 eCut,
38 eCopy,
39 ePaste
42 private:
43 ClipboardFunc m_eFunc;
44 bool m_bLastKnownEnabled;
46 public:
47 OClipboardDispatcher( EditView& _rView, ClipboardFunc _eFunc );
49 protected:
50 // XDispatch
51 virtual void SAL_CALL dispatch( const css::util::URL& URL, const css::uno::Sequence< css::beans::PropertyValue >& Arguments ) throw (css::uno::RuntimeException, std::exception) override;
53 // ORichTextFeatureDispatcher
54 virtual void invalidateFeatureState_Broadcast() override;
55 virtual css::frame::FeatureStateEvent
56 buildStatusEvent() const override;
58 protected:
59 /** determines whether our functionality is currently available
60 to be overridden for ePaste
62 virtual bool implIsEnabled( ) const;
65 class OPasteClipboardDispatcher : public OClipboardDispatcher
67 private:
68 TransferableClipboardListener* m_pClipListener;
69 bool m_bPastePossible;
71 public:
72 explicit OPasteClipboardDispatcher( EditView& _rView );
74 protected:
75 virtual ~OPasteClipboardDispatcher();
77 // OClipboardDispatcher
78 virtual bool implIsEnabled( ) const override;
80 // ORichTextFeatureDispatcher
81 virtual void disposing( ::osl::ClearableMutexGuard& _rClearBeforeNotify ) override;
83 private:
84 DECL_LINK_TYPED( OnClipboardChanged, TransferableDataHelper*, void );
88 } // namespace frm
91 #endif // INCLUDED_FORMS_SOURCE_RICHTEXT_CLIPBOARDDISPATCHER_HXX
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */