LibreOffice Module forms (master) 1
richtextmodel.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#pragma once
20
21#include <FormComponent.hxx>
22#include <formcontrolfont.hxx>
26
27#include <com/sun/star/awt/XDevice.hpp>
28#include <com/sun/star/util/XModifyBroadcaster.hpp>
30#include <tools/link.hxx>
31#include <memory>
32
33class EditEngine;
34
35namespace frm
36{
37
38
39 class RichTextEngine;
40
41 //= ORichTextModel
42
43 typedef ::cppu::ImplHelper3 < css::awt::XControlModel
44 , css::lang::XUnoTunnel
45 , css::util::XModifyBroadcaster
47
49 :public OControlModel
50 ,public FontControlModel
54 {
55 public:
57 const css::uno::Reference< css::uno::XComponentContext>& _rxFactory
58 );
60 const ORichTextModel* _pOriginal,
61 const css::uno::Reference< css::uno::XComponentContext>& _rxFactory
62 );
63 virtual ~ORichTextModel() override;
64
65 private:
66 // <properties>
67 css::uno::Reference< css::awt::XDevice >
69 css::uno::Any m_aTabStop;
70 css::uno::Any m_aBackgroundColor;
71 css::uno::Any m_aBorderColor;
72 css::uno::Any m_aVerticalAlignment;
74 OUString m_sHelpText;
75 OUString m_sHelpURL;
80 sal_Int16 m_nBorder;
88 bool m_bReallyActAsRichText; // despite the class name, the RichTextControl later on
89 // will create "ordinary" text peers depending on this property
91 // </properties>
92
93 // <properties_for_awt_edit_compatibility>
94 css::uno::Any m_aAlign;
95 sal_Int16 m_nEchoChar;
98 // </properties_for_awt_edit_compatibility>
99
100 ::std::unique_ptr<RichTextEngine>
103
106
107 public:
108 static RichTextEngine* getEditEngine( const css::uno::Reference< css::awt::XControlModel >& _rxModel );
109
110 // UNO
112 virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type& _rType ) override;
113
114 // XServiceInfo
115 virtual OUString SAL_CALL getImplementationName() override;
116 virtual ::css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
117
118 // XPersistObject
119 virtual OUString SAL_CALL getServiceName() override;
120
121 // XTypeProvider
123
124 // XCloneable
125 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone( ) override;
126
127 // XUnoTunnel
128 virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
129 static const css::uno::Sequence<sal_Int8> & getUnoTunnelId();
130
131 // XModifyBroadcaster
132 virtual void SAL_CALL addModifyListener( const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
133 virtual void SAL_CALL removeModifyListener( const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
134
135 // XPropertySet and friends
136 virtual void SAL_CALL getFastPropertyValue(css::uno::Any& rValue, sal_Int32 nHandle ) const override;
137 virtual sal_Bool SAL_CALL convertFastPropertyValue(css::uno::Any& rConvertedValue, css::uno::Any& rOldValue,
138 sal_Int32 nHandle, const css::uno::Any& rValue ) override;
139 virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any& rValue) override;
140 virtual css::uno::Any getPropertyDefaultByHandle( sal_Int32 nHandle ) const override;
141
142 // OControlModel's property handling
143 virtual void describeFixedProperties(
144 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps
145 ) const override;
146 virtual void describeAggregateProperties(
147 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
148 ) const override;
149
150 // prevent method hiding
153
154 // OComponentHelper
155 virtual void SAL_CALL disposing() override;
156
157 // IEngineTextChangeListener
158 virtual void potentialTextChange( ) override;
159
160 private:
161 void implInit();
162 void implDoAggregation();
164
173 void impl_smlock_setEngineText( const OUString& _rText );
174
175 DECL_LINK( OnEngineContentModified, LinkParamNone*, void );
176
177 private:
178 ORichTextModel( const ORichTextModel& ) = delete;
179 ORichTextModel& operator=( const ORichTextModel& ) = delete;
180 };
181
182
183} // namespace frm
184
185
186/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
virtual OUString SAL_CALL getImplementationName() override
sal_Int16 m_nLineEndFormat
void impl_smlock_setEngineText(const OUString &_rText)
propagates a new text to the EditEngine
ORichTextModel(const ORichTextModel *_pOriginal, const css::uno::Reference< css::uno::XComponentContext > &_rxFactory)
sal_Int16 m_nTextWritingMode
virtual void SAL_CALL disposing() override
css::uno::Reference< css::awt::XDevice > m_xReferenceDevice
OUString m_sLastKnownEngineText
ORichTextModel(const css::uno::Reference< css::uno::XComponentContext > &_rxFactory)
::comphelper::OInterfaceContainerHelper3< css::util::XModifyListener > m_aModifyListeners
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
virtual void describeAggregateProperties(css::uno::Sequence< css::beans::Property > &_rAggregateProps) const override
describes the properties of our aggregate
virtual void SAL_CALL addModifyListener(const css::uno::Reference< css::util::XModifyListener > &aListener) override
virtual OUString SAL_CALL getServiceName() override
::std::unique_ptr< RichTextEngine > m_pEngine
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &aIdentifier) override
virtual void SAL_CALL removeModifyListener(const css::uno::Reference< css::util::XModifyListener > &aListener) override
css::uno::Any m_aBackgroundColor
css::uno::Any m_aTabStop
sal_Int16 m_nMaxTextLength
DECL_LINK(OnEngineContentModified, LinkParamNone *, void)
css::uno::Any m_aAlign
css::uno::Any m_aBorderColor
virtual css::uno::Any getPropertyDefaultByHandle(sal_Int32 nHandle) const override
virtual void potentialTextChange() override
virtual void describeFixedProperties(css::uno::Sequence< css::beans::Property > &_rProps) const override
describes the properties provided by this class, or its respective derived class
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
static RichTextEngine * getEditEngine(const css::uno::Reference< css::awt::XControlModel > &_rxModel)
css::uno::Any m_aVerticalAlignment
virtual ~ORichTextModel() override
sal_Int16 m_nContextWritingMode
virtual ::css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual sal_Bool SAL_CALL convertFastPropertyValue(css::uno::Any &rConvertedValue, css::uno::Any &rOldValue, sal_Int32 nHandle, const css::uno::Any &rValue) override
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &_rType) override
virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override
ListBox is a bit confusing / different from other form components, so here are a few notes:
Definition: BaseListBox.hxx:25
::cppu::ImplHelper3< css::awt::XControlModel, css::lang::XUnoTunnel, css::util::XModifyBroadcaster > ORichTextModel_BASE
unsigned char sal_Bool
signed char sal_Int8
#define DECLARE_XTYPEPROVIDER()
#define DECLARE_UNO3_AGG_DEFAULTS(classname, baseclass)