1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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"
40 class ORichTextFeatureDispatcher
;
42 typedef ::cppu::ImplHelper1
< css::frame::XDispatchProvider
43 > ORichTextControl_Base
;
44 class ORichTextControl
:public UnoEditControl
45 ,public ORichTextControl_Base
51 virtual ~ORichTextControl() override
;
54 DECLARE_UNO3_AGG_DEFAULTS( ORichTextControl
, UnoEditControl
)
55 virtual css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& _rType
) override
;
58 virtual void SAL_CALL
createPeer( const css::uno::Reference
< css::awt::XToolkit
>& _rToolkit
, const css::uno::Reference
< css::awt::XWindowPeer
>& _rParent
) override
;
61 virtual OUString SAL_CALL
getImplementationName() override
;
62 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
65 DECLARE_XTYPEPROVIDER()
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
;
72 virtual bool requiresNewPeer( const OUString
& _rPropertyName
) const override
;
75 typedef ::cppu::ImplHelper1
< css::frame::XDispatchProvider
77 class ORichTextPeer final
:public VCLXWindow
78 ,public ORichTextPeer_Base
79 ,public ITextSelectionListener
82 typedef rtl::Reference
<ORichTextFeatureDispatcher
> SingleAttributeDispatcher
;
83 typedef ::std::map
< SfxSlotId
, SingleAttributeDispatcher
> AttributeDispatchers
;
84 AttributeDispatchers m_aDispatchers
;
89 static rtl::Reference
<ORichTextPeer
> Create(
90 const css::uno::Reference
< css::awt::XControlModel
>& _rxModel
,
91 vcl::Window
* _pParentWindow
,
100 virtual ~ORichTextPeer() override
;
103 void SAL_CALL
draw( sal_Int32 nX
, sal_Int32 nY
) override
;
106 virtual void SAL_CALL
setProperty( const OUString
& _rPropertyName
, const css::uno::Any
& _rValue
) override
;
109 DECLARE_XTYPEPROVIDER( )
112 virtual void SAL_CALL
dispose( ) override
;
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
;
122 SingleAttributeDispatcher
implCreateDispatcher( SfxSlotId _nSlotId
, const css::util::URL
& _rURL
);
129 #endif // INCLUDED_FORMS_SOURCE_RICHTEXT_RICHTEXTCONTROL_HXX
131 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */