Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_FORMS_SOURCE_RICHTEXT_CLIPBOARDDISPATCHER_HXX
21 : #define INCLUDED_FORMS_SOURCE_RICHTEXT_CLIPBOARDDISPATCHER_HXX
22 :
23 : #include "featuredispatcher.hxx"
24 : #include <tools/link.hxx>
25 :
26 : class TransferableClipboardListener;
27 : class TransferableDataHelper;
28 :
29 : namespace frm
30 : {
31 :
32 0 : class OClipboardDispatcher : public ORichTextFeatureDispatcher
33 : {
34 : public:
35 : enum ClipboardFunc
36 : {
37 : eCut,
38 : eCopy,
39 : ePaste
40 : };
41 :
42 : private:
43 : ClipboardFunc m_eFunc;
44 : bool m_bLastKnownEnabled;
45 :
46 : public:
47 : OClipboardDispatcher( EditView& _rView, ClipboardFunc _eFunc );
48 :
49 : protected:
50 : // XDispatch
51 : virtual void SAL_CALL dispatch( const ::com::sun::star::util::URL& URL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Arguments ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
52 :
53 : // ORichTextFeatureDispatcher
54 : virtual void invalidateFeatureState_Broadcast() SAL_OVERRIDE;
55 : virtual ::com::sun::star::frame::FeatureStateEvent
56 : buildStatusEvent() const SAL_OVERRIDE;
57 :
58 : protected:
59 : /** determines whether our functionality is currently available
60 : to be overridden for ePaste
61 : */
62 : virtual bool implIsEnabled( ) const;
63 : };
64 :
65 : class OPasteClipboardDispatcher : public OClipboardDispatcher
66 : {
67 : private:
68 : TransferableClipboardListener* m_pClipListener;
69 : bool m_bPastePossible;
70 :
71 : public:
72 : OPasteClipboardDispatcher( EditView& _rView );
73 :
74 : protected:
75 : virtual ~OPasteClipboardDispatcher();
76 :
77 : // OClipboardDispatcher
78 : virtual bool implIsEnabled( ) const SAL_OVERRIDE;
79 :
80 : // ORichTextFeatureDispatcher
81 : virtual void disposing( ::osl::ClearableMutexGuard& _rClearBeforeNotify ) SAL_OVERRIDE;
82 :
83 : private:
84 : DECL_LINK( OnClipboardChanged, TransferableDataHelper* );
85 : };
86 :
87 :
88 : } // namespace frm
89 :
90 :
91 : #endif // INCLUDED_FORMS_SOURCE_RICHTEXT_CLIPBOARDDISPATCHER_HXX
92 :
93 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|