LibreOffice Module forms (master) 1
richtextcontrol.hxx
Go to the documentation of this file.
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#pragma once
21
24
25#include <com/sun/star/frame/XDispatchProvider.hpp>
26#include <comphelper/uno3.hxx>
28#include <rtl/ref.hxx>
29#include <vcl/wintypes.hxx>
30#include "rtattributes.hxx"
32
33#include <map>
34
35
36namespace frm
37{
38
39 class ORichTextFeatureDispatcher;
40
41 typedef ::cppu::ImplHelper1 < css::frame::XDispatchProvider
43 class ORichTextControl :public UnoEditControl
45 {
46 public:
48
49 protected:
50 virtual ~ORichTextControl() override;
51
52 // UNO
54 virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type& _rType ) override;
55
56 // XControl
57 virtual void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& _rToolkit, const css::uno::Reference< css::awt::XWindowPeer >& _rParent ) override;
58
59 // XServiceInfo
60 virtual OUString SAL_CALL getImplementationName() override;
61 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
62
63 // XTypeProvider
65
66 // XDispatchProvider
67 virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch( const css::util::URL& _rURL, const OUString& _rTargetFrameName, sal_Int32 _rSearchFlags ) override;
68 virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& Requests ) override;
69
70 // UnoControl
71 virtual bool requiresNewPeer( const OUString& _rPropertyName ) const override;
72 };
73
74 typedef ::cppu::ImplHelper1 < css::frame::XDispatchProvider
76 class ORichTextPeer final :public VCLXWindow
77 ,public ORichTextPeer_Base
79 {
80 private:
82 typedef ::std::map< SfxSlotId, SingleAttributeDispatcher > AttributeDispatchers;
84
85 public:
89 const css::uno::Reference< css::awt::XControlModel >& _rxModel,
90 vcl::Window* _pParentWindow,
91 WinBits _nStyle
92 );
93
94 // XInterface
96
97 private:
99 virtual ~ORichTextPeer() override;
100
101 // XView
102 void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) override;
103
104 // XVclWindowPeer
105 virtual void SAL_CALL setProperty( const OUString& _rPropertyName, const css::uno::Any& _rValue ) override;
106
107 // XTypeProvider
108 DECLARE_XTYPEPROVIDER( )
109
110 // XComponent
111 virtual void SAL_CALL dispose( ) override;
112
113 // XDispatchProvider
114 virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch( const css::util::URL& _rURL, const OUString& _rTargetFrameName, sal_Int32 _rSearchFlags ) override;
115 virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& Requests ) override;
116
117 // ITextSelectionListener
118 virtual void onSelectionChanged() override;
119
120 private:
121 SingleAttributeDispatcher implCreateDispatcher( SfxSlotId _nSlotId, const css::util::URL& _rURL );
122 };
123
124
125} // namespace frm
126
127
128/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch(const css::util::URL &_rURL, const OUString &_rTargetFrameName, sal_Int32 _rSearchFlags) override
virtual void SAL_CALL createPeer(const css::uno::Reference< css::awt::XToolkit > &_rToolkit, const css::uno::Reference< css::awt::XWindowPeer > &_rParent) override
virtual OUString SAL_CALL getImplementationName() override
virtual ~ORichTextControl() override
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &_rType) override
virtual bool requiresNewPeer(const OUString &_rPropertyName) const override
virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches(const css::uno::Sequence< css::frame::DispatchDescriptor > &Requests) override
virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch(const css::util::URL &_rURL, const OUString &_rTargetFrameName, sal_Int32 _rSearchFlags) override
AttributeDispatchers m_aDispatchers
virtual void SAL_CALL dispose() override
virtual void onSelectionChanged() override
virtual void SAL_CALL setProperty(const OUString &_rPropertyName, const css::uno::Any &_rValue) override
rtl::Reference< ORichTextFeatureDispatcher > SingleAttributeDispatcher
SingleAttributeDispatcher implCreateDispatcher(SfxSlotId _nSlotId, const css::util::URL &_rURL)
virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches(const css::uno::Sequence< css::frame::DispatchDescriptor > &Requests) override
void SAL_CALL draw(sal_Int32 nX, sal_Int32 nY) override
::std::map< SfxSlotId, SingleAttributeDispatcher > AttributeDispatchers
static rtl::Reference< ORichTextPeer > Create(const css::uno::Reference< css::awt::XControlModel > &_rxModel, vcl::Window *_pParentWindow, WinBits _nStyle)
factory method
ListBox is a bit confusing / different from other form components, so here are a few notes:
Definition: BaseListBox.hxx:25
::cppu::ImplHelper1< css::frame::XDispatchProvider > ORichTextPeer_Base
::cppu::ImplHelper1< css::frame::XDispatchProvider > ORichTextControl_Base
sal_uInt16 SfxSlotId
a SFX slot id
#define DECLARE_XTYPEPROVIDER()
#define DECLARE_UNO3_AGG_DEFAULTS(classname, baseclass)
#define DECLARE_XINTERFACE()
sal_Int64 WinBits