nss: upgrade to release 3.73
[LibreOffice.git] / forms / source / richtext / richtextcontrol.hxx
blobd79d4c0c74d023bbb5e8599d60d3444d792a855c
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_RICHTEXTCONTROL_HXX
21 #define INCLUDED_FORMS_SOURCE_RICHTEXT_RICHTEXTCONTROL_HXX
23 #include <toolkit/controls/unocontrols.hxx>
24 #include <toolkit/awt/vclxwindow.hxx>
26 #include <com/sun/star/frame/XDispatchProvider.hpp>
27 #include <comphelper/uno3.hxx>
28 #include <cppuhelper/implbase1.hxx>
29 #include <rtl/ref.hxx>
30 #include <tools/wintypes.hxx>
31 #include "rtattributes.hxx"
32 #include "textattributelistener.hxx"
34 #include <map>
37 namespace frm
40 class ORichTextFeatureDispatcher;
42 typedef ::cppu::ImplHelper1 < css::frame::XDispatchProvider
43 > ORichTextControl_Base;
44 class ORichTextControl :public UnoEditControl
45 ,public ORichTextControl_Base
47 public:
48 ORichTextControl();
50 protected:
51 virtual ~ORichTextControl() override;
53 // UNO
54 DECLARE_UNO3_AGG_DEFAULTS( ORichTextControl, UnoEditControl )
55 virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type& _rType ) override;
57 // XControl
58 virtual void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& _rToolkit, const css::uno::Reference< css::awt::XWindowPeer >& _rParent ) override;
60 // XServiceInfo
61 virtual OUString SAL_CALL getImplementationName() override;
62 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
64 // XTypeProvider
65 DECLARE_XTYPEPROVIDER()
67 // XDispatchProvider
68 virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch( const css::util::URL& _rURL, const OUString& _rTargetFrameName, sal_Int32 _rSearchFlags ) override;
69 virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& Requests ) override;
71 // UnoControl
72 virtual bool requiresNewPeer( const OUString& _rPropertyName ) const override;
75 typedef ::cppu::ImplHelper1 < css::frame::XDispatchProvider
76 > ORichTextPeer_Base;
77 class ORichTextPeer final :public VCLXWindow
78 ,public ORichTextPeer_Base
79 ,public ITextSelectionListener
81 private:
82 typedef rtl::Reference<ORichTextFeatureDispatcher> SingleAttributeDispatcher;
83 typedef ::std::map< SfxSlotId, SingleAttributeDispatcher > AttributeDispatchers;
84 AttributeDispatchers m_aDispatchers;
86 public:
87 /** factory method
89 static rtl::Reference<ORichTextPeer> Create(
90 const css::uno::Reference< css::awt::XControlModel >& _rxModel,
91 vcl::Window* _pParentWindow,
92 WinBits _nStyle
95 // XInterface
96 DECLARE_XINTERFACE( )
98 private:
99 ORichTextPeer();
100 virtual ~ORichTextPeer() override;
102 // XView
103 void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) override;
105 // XVclWindowPeer
106 virtual void SAL_CALL setProperty( const OUString& _rPropertyName, const css::uno::Any& _rValue ) override;
108 // XTypeProvider
109 DECLARE_XTYPEPROVIDER( )
111 // XComponent
112 virtual void SAL_CALL dispose( ) override;
114 // XDispatchProvider
115 virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch( const css::util::URL& _rURL, const OUString& _rTargetFrameName, sal_Int32 _rSearchFlags ) override;
116 virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& Requests ) override;
118 // ITextSelectionListener
119 virtual void onSelectionChanged() override;
121 private:
122 SingleAttributeDispatcher implCreateDispatcher( SfxSlotId _nSlotId, const css::util::URL& _rURL );
126 } // namespace frm
129 #endif // INCLUDED_FORMS_SOURCE_RICHTEXT_RICHTEXTCONTROL_HXX
131 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */