LibreOffice Module forms (master) 1
richtextcontrol.cxx
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#include "richtextcontrol.hxx"
21#include <frm_strings.hxx>
22#include <services.hxx>
23
24#include "richtextmodel.hxx"
29
30#include <com/sun/star/awt/PosSize.hpp>
31
33#include <tools/debug.hxx>
35#include <sal/log.hxx>
36#include <vcl/svapp.hxx>
37
38#include <svx/svxids.hrc>
39#include <editeng/editview.hxx>
40#include <svl/itemset.hxx>
41#include <svl/itempool.hxx>
42#include <sfx2/msgpool.hxx>
43#include <sfx2/msg.hxx>
44
45namespace frm
46{
47
48
49 using namespace ::com::sun::star::uno;
50 using namespace ::com::sun::star::beans;
51 using namespace ::com::sun::star::awt;
52 using namespace ::com::sun::star::lang;
53 using namespace ::com::sun::star::frame;
54
56 {
57 }
58
59
61 {
62 }
63
64
66
67
68 Any SAL_CALL ORichTextControl::queryAggregation( const Type& _rType )
69 {
70 Any aReturn = UnoEditControl::queryAggregation( _rType );
71
72 if ( !aReturn.hasValue() )
73 aReturn = ORichTextControl_Base::queryInterface( _rType );
74
75 return aReturn;
76 }
77
78
79 namespace
80 {
81
82 void implAdjustTriStateFlag( const Reference< XPropertySet >& _rxProps, const OUString& _rPropertyName,
83 WinBits& _rAllBits, WinBits _nPositiveFlag, WinBits nNegativeFlag )
84 {
85 bool bFlagValue = false;
86 if ( _rxProps->getPropertyValue( _rPropertyName ) >>= bFlagValue )
87 _rAllBits |= ( bFlagValue ? _nPositiveFlag : nNegativeFlag );
88 }
89
90
91 void implAdjustTwoStateFlag( const Any& _rValue, WinBits& _rAllBits, WinBits _nFlag, bool _bInvert )
92 {
93 bool bFlagValue = false;
94 if ( _rValue >>= bFlagValue )
95 {
96 if ( _bInvert )
97 bFlagValue = !bFlagValue;
98 if ( bFlagValue )
99 _rAllBits |= _nFlag;
100 else
101 _rAllBits &= ~_nFlag;
102 }
103 }
104
105
106 void implAdjustTwoStateFlag( const Reference< XPropertySet >& _rxProps, const OUString& _rPropertyName,
107 WinBits& _rAllBits, WinBits _nFlag, bool _bInvert = false )
108 {
109 implAdjustTwoStateFlag( _rxProps->getPropertyValue( _rPropertyName ), _rAllBits, _nFlag, _bInvert );
110 }
111
112
113 void adjustTwoStateWinBit( vcl::Window* _pWindow, const Any& _rValue, WinBits _nFlag, bool _bInvert = false )
114 {
115 WinBits nBits = _pWindow->GetStyle();
116 implAdjustTwoStateFlag( _rValue, nBits, _nFlag, _bInvert );
117 _pWindow->SetStyle( nBits );
118 }
119
120
121 WinBits getWinBits( const Reference< XControlModel >& _rxModel )
122 {
123 WinBits nBits = 0;
124 try
125 {
126 Reference< XPropertySet > xProps( _rxModel, UNO_QUERY );
127 if ( xProps.is() )
128 {
129 sal_Int16 nBorder = 0;
130 xProps->getPropertyValue( PROPERTY_BORDER ) >>= nBorder;
131 if ( nBorder )
132 nBits |= WB_BORDER;
133
134 implAdjustTriStateFlag( xProps, PROPERTY_TABSTOP, nBits, WB_TABSTOP, WB_NOTABSTOP );
135 implAdjustTwoStateFlag( xProps, PROPERTY_HSCROLL, nBits, WB_HSCROLL );
136 implAdjustTwoStateFlag( xProps, PROPERTY_VSCROLL, nBits, WB_VSCROLL );
137 implAdjustTwoStateFlag( xProps, PROPERTY_HARDLINEBREAKS, nBits, WB_WORDBREAK, true );
138 }
139 }
140 catch( const Exception& )
141 {
142 DBG_UNHANDLED_EXCEPTION("forms.richtext");
143 }
144 return nBits;
145 }
146 }
147
148
149 void SAL_CALL ORichTextControl::createPeer( const Reference< XToolkit >& _rToolkit, const Reference< XWindowPeer >& _rParentPeer )
150 {
151 bool bReallyActAsRichText = false;
152 try
153 {
154 Reference< XPropertySet > xModelProps( getModel(), UNO_QUERY_THROW );
155 xModelProps->getPropertyValue( PROPERTY_RICH_TEXT ) >>= bReallyActAsRichText;
156 }
157 catch( const Exception& )
158 {
159 DBG_UNHANDLED_EXCEPTION("forms.richtext");
160 }
161
162 if ( !bReallyActAsRichText )
163 {
164 UnoEditControl::createPeer( _rToolkit, _rParentPeer );
165 return;
166 }
167
168 SolarMutexGuard aGuard;
169
170 if (getPeer().is())
171 return;
172
173 mbCreatingPeer = true;
174
175 // determine the VCL window for the parent
176 vcl::Window* pParentWin = nullptr;
177 if ( _rParentPeer.is() )
178 {
179 VCLXWindow* pParentXWin = dynamic_cast<VCLXWindow*>( _rParentPeer.get() );
180 if ( pParentXWin )
181 pParentWin = pParentXWin->GetWindow();
182 DBG_ASSERT( pParentWin, "ORichTextControl::createPeer: could not obtain the VCL-level parent window!" );
183 }
184
185 // create the peer
186 Reference< XControlModel > xModel( getModel() );
187 rtl::Reference<ORichTextPeer> pPeer = ORichTextPeer::Create( xModel, pParentWin, getWinBits( xModel ) );
188 DBG_ASSERT( pPeer, "ORichTextControl::createPeer: invalid peer returned!" );
189 if ( pPeer )
190 {
191 // announce the peer to the base class
192 setPeer( pPeer );
193
194 // initialize ourself (and thus the peer) with the model properties
195 updateFromModel();
196
197 Reference< XView > xPeerView( getPeer(), UNO_QUERY );
198 if ( xPeerView.is() )
199 {
200 xPeerView->setZoom( maComponentInfos.nZoomX, maComponentInfos.nZoomY );
201 xPeerView->setGraphics( mxGraphics );
202 }
203
204 // a lot of initial settings from our component infos
205 setPosSize( maComponentInfos.nX, maComponentInfos.nY, maComponentInfos.nWidth, maComponentInfos.nHeight, PosSize::POSSIZE );
206
207 pPeer->setVisible ( maComponentInfos.bVisible && !mbDesignMode );
208 pPeer->setEnable ( maComponentInfos.bEnable );
209 pPeer->setDesignMode( mbDesignMode );
210
211 peerCreated();
212 }
213
214 mbCreatingPeer = false;
215 }
216
218 {
219 return "com.sun.star.comp.form.ORichTextControl";
220 }
221
222 Sequence< OUString > SAL_CALL ORichTextControl::getSupportedServiceNames()
223 {
224 return { "com.sun.star.awt.UnoControl",
225 "com.sun.star.awt.UnoControlEdit",
227 }
228
229 Reference< XDispatch > SAL_CALL ORichTextControl::queryDispatch( const css::util::URL& _rURL, const OUString& _rTargetFrameName, sal_Int32 _nSearchFlags )
230 {
231 Reference< XDispatch > aReturn;
232 Reference< XDispatchProvider > xTypedPeer( getPeer(), UNO_QUERY );
233 if ( xTypedPeer.is() )
234 {
235 aReturn = xTypedPeer->queryDispatch( _rURL, _rTargetFrameName, _nSearchFlags );
236 }
237 return aReturn;
238 }
239
240 Sequence< Reference< XDispatch > > SAL_CALL ORichTextControl::queryDispatches( const Sequence< DispatchDescriptor >& _rRequests )
241 {
242 Reference<XDispatchProvider> xTypedPeer(getPeer(), UNO_QUERY);
243 if (xTypedPeer.is())
244 return xTypedPeer->queryDispatches(_rRequests);
245 return Sequence<Reference<XDispatch>>();
246 }
247
248 bool ORichTextControl::requiresNewPeer( const OUString& _rPropertyName ) const
249 {
250 return UnoControl::requiresNewPeer( _rPropertyName ) || _rPropertyName == PROPERTY_RICH_TEXT;
251 }
252
253 // ORichTextPeer
254 rtl::Reference<ORichTextPeer> ORichTextPeer::Create( const Reference< XControlModel >& _rxModel, vcl::Window* _pParentWindow, WinBits _nStyle )
255 {
257
258 // the EditEngine of the model
259 RichTextEngine* pEngine = ORichTextModel::getEditEngine( _rxModel );
260 OSL_ENSURE( pEngine, "ORichTextPeer::Create: could not obtain the edit engine from the model!" );
261 if ( !pEngine )
262 return nullptr;
263
264 // the peer itself
266
267 // the VCL control for the peer
268 VclPtrInstance<RichTextControl> pRichTextControl( pEngine, _pParentWindow, _nStyle, nullptr, pPeer.get() );
269
270 // some knittings
271 pRichTextControl->SetComponentInterface( pPeer );
272
273 // outta here
274 return pPeer;
275 }
276
277
279 {
280 }
281
282
284 {
285 }
286
287
289 {
290 {
291 SolarMutexGuard aGuard;
292 VclPtr< RichTextControl > pRichTextControl = GetAs< RichTextControl >();
293
294 if ( pRichTextControl )
295 {
296 for (auto const& dispatcher : m_aDispatchers)
297 {
298 pRichTextControl->disableAttributeNotification(dispatcher.first);
299 dispatcher.second->dispose();
300 }
301 }
302
304 }
305
307 }
308
309
310 void SAL_CALL ORichTextPeer::draw( sal_Int32 _nX, sal_Int32 _nY )
311 {
312 SolarMutexGuard aGuard;
313
314 VclPtr< RichTextControl > pControl = GetAs< RichTextControl >();
315 if ( !pControl )
316 return;
317
319 OSL_ENSURE( pTargetDevice != nullptr, "ORichTextPeer::draw: no graphics -> no drawing!" );
320 if ( !pTargetDevice )
321 return;
322
323 const MapUnit eTargetUnit = pTargetDevice->GetMapMode().GetMapUnit();
324 ::Point aPos( _nX, _nY );
325 // the XView::draw API talks about pixels, always ...
326 if ( eTargetUnit != MapUnit::MapPixel )
327 aPos = pTargetDevice->PixelToLogic( aPos );
328
329 pControl->Draw( pTargetDevice, aPos, SystemTextColorFlags::NoControls );
330 }
331
332
333 void SAL_CALL ORichTextPeer::setProperty( const OUString& _rPropertyName, const Any& _rValue )
334 {
336
337 if ( !GetWindow() )
338 {
339 VCLXWindow::setProperty( _rPropertyName, _rValue );
340 return;
341 }
342
343 if ( _rPropertyName == PROPERTY_BACKGROUNDCOLOR )
344 {
345 VclPtr< RichTextControl > pControl = GetAs< RichTextControl >();
346 if ( !_rValue.hasValue() )
347 {
348 pControl->SetBackgroundColor( );
349 }
350 else
351 {
352 Color nColor = COL_TRANSPARENT;
353 _rValue >>= nColor;
354 pControl->SetBackgroundColor( nColor );
355 }
356 }
357 else if ( _rPropertyName == PROPERTY_HSCROLL )
358 {
359 adjustTwoStateWinBit( GetWindow(), _rValue, WB_HSCROLL );
360 }
361 else if ( _rPropertyName == PROPERTY_VSCROLL )
362 {
363 adjustTwoStateWinBit( GetWindow(), _rValue, WB_VSCROLL );
364 }
365 else if ( _rPropertyName == PROPERTY_HARDLINEBREAKS )
366 {
367 adjustTwoStateWinBit( GetWindow(), _rValue, WB_WORDBREAK, true );
368 }
369 else if ( _rPropertyName == PROPERTY_READONLY )
370 {
371 VclPtr< RichTextControl > pControl = GetAs< RichTextControl >();
372 bool bReadOnly( pControl->IsReadOnly() );
373 OSL_VERIFY( _rValue >>= bReadOnly );
374 pControl->SetReadOnly( bReadOnly );
375
376 // update the dispatchers
377 for (auto const& dispatcher : m_aDispatchers)
378 {
379 dispatcher.second->invalidate();
380 }
381 }
382 else if ( _rPropertyName == PROPERTY_HIDEINACTIVESELECTION )
383 {
384 VclPtr< RichTextControl > pRichTextControl = GetAs< RichTextControl >();
385 bool bHide = pRichTextControl->GetHideInactiveSelection();
386 OSL_VERIFY( _rValue >>= bHide );
387 pRichTextControl->SetHideInactiveSelection( bHide );
388 }
389 else
390 VCLXWindow::setProperty( _rPropertyName, _rValue );
391 }
392
393
395
396
398
399
400 namespace
401 {
402 SfxSlotId lcl_translateConflictingSlot( SfxSlotId _nIDFromPool )
403 {
404 // HACK HACK HACK
405 // unfortunately, some of our applications have some conflicting slots,
406 // i.e. slots which have the same UNO name as an existing other (common)
407 // slot.
408 // For instance, both the slots SID_SET_SUPER_SCRIPT (from SVX) and FN_SET_SUPER_SCRIPT
409 // (from SW) have the UNO name "SuperScript".
410 // Now, if the controls lives in a text document, and asks the SfxSlotPool for
411 // the id belonging to "SuperScript", it gets the FN_SET_SUPER_SCRIPT - which
412 // is completely unknown to the EditEngine.
413 // So, we need to translate such conflicting ids.
414
415 // Note that the real solution would be to fix the applications to
416 // *not* define conflicting slots. Alternatively, if SFX would provide a slot pool
417 // which is *static* (i.e. independent on the active application), then we
418 // would also never encounter such a conflict.
419 SfxSlotId nReturn( _nIDFromPool );
420 switch ( _nIDFromPool )
421 {
422 case 20411: /* FM_SET_SUPER_SCRIPT, originating in SW */
423 nReturn = SID_SET_SUPER_SCRIPT;
424 break;
425 case 20412: /* FN_SET_SUB_SCRIPT, originating in SW */
426 nReturn = SID_SET_SUB_SCRIPT;
427 break;
428 }
429 return nReturn;
430 }
431 }
432
433
435 {
436 VclPtr< RichTextControl > pRichTextControl = GetAs< RichTextControl >();
437 OSL_PRECOND( pRichTextControl, "ORichTextPeer::implCreateDispatcher: invalid window!" );
438 if ( !pRichTextControl )
439 return SingleAttributeDispatcher( nullptr );
440
442 rtl::Reference<OAttributeDispatcher> pAttributeDispatcher;
443 switch ( _nSlotId )
444 {
445 case SID_CUT:
446 pDispatcher = new OClipboardDispatcher( pRichTextControl->getView(), OClipboardDispatcher::eCut );
447 break;
448
449 case SID_COPY:
450 pDispatcher = new OClipboardDispatcher( pRichTextControl->getView(), OClipboardDispatcher::eCopy );
451 break;
452
453 case SID_PASTE:
454 pDispatcher = new OPasteClipboardDispatcher( pRichTextControl->getView() );
455 break;
456
457 case SID_SELECTALL:
458 pDispatcher = new OSelectAllDispatcher( pRichTextControl->getView(), _rURL );
459 break;
460
461 case SID_ATTR_PARA_LEFT_TO_RIGHT:
462 case SID_ATTR_PARA_RIGHT_TO_LEFT:
463 pAttributeDispatcher = new OParagraphDirectionDispatcher( pRichTextControl->getView(), _nSlotId, _rURL, pRichTextControl );
464 break;
465
466 case SID_TEXTDIRECTION_TOP_TO_BOTTOM:
467 case SID_TEXTDIRECTION_LEFT_TO_RIGHT:
468 pDispatcher = new OTextDirectionDispatcher( pRichTextControl->getView(), _rURL );
469 break;
470
471 case SID_ATTR_PARA_HANGPUNCTUATION:
472 case SID_ATTR_PARA_FORBIDDEN_RULES:
473 case SID_ATTR_PARA_SCRIPTSPACE:
474 pAttributeDispatcher = new OAsianFontLayoutDispatcher( pRichTextControl->getView(), _nSlotId, _rURL, pRichTextControl );
475 break;
476
477 default:
478 {
479 const SfxItemPool& rPool = *pRichTextControl->getView().GetEmptyItemSet().GetPool();
480 bool bSupportedSlot = rPool.IsInRange( rPool.GetWhich( _nSlotId ) );
481
482 if ( !bSupportedSlot )
483 bSupportedSlot = RichTextControl::isMappableSlot( _nSlotId );
484
485 if ( bSupportedSlot )
486 { // it's really a slot which is supported by the EditEngine
487
488 bool bNeedParametrizedDispatcher = true;
489 if ( ( _nSlotId == SID_ATTR_CHAR_POSTURE )
490 || ( _nSlotId == SID_ATTR_CHAR_CJK_POSTURE )
491 || ( _nSlotId == SID_ATTR_CHAR_CTL_POSTURE )
492 || ( _nSlotId == SID_ATTR_CHAR_LATIN_POSTURE )
493 || ( _nSlotId == SID_ATTR_CHAR_WEIGHT )
494 || ( _nSlotId == SID_ATTR_CHAR_CJK_WEIGHT )
495 || ( _nSlotId == SID_ATTR_CHAR_CTL_WEIGHT )
496 || ( _nSlotId == SID_ATTR_CHAR_LATIN_WEIGHT )
497 || ( _nSlotId == SID_ATTR_CHAR_LANGUAGE )
498 || ( _nSlotId == SID_ATTR_CHAR_CJK_LANGUAGE )
499 || ( _nSlotId == SID_ATTR_CHAR_CTL_LANGUAGE )
500 || ( _nSlotId == SID_ATTR_CHAR_LATIN_LANGUAGE )
501 || ( _nSlotId == SID_ATTR_CHAR_CONTOUR )
502 || ( _nSlotId == SID_ATTR_CHAR_SHADOWED )
503 || ( _nSlotId == SID_ATTR_CHAR_WORDLINEMODE )
504 || ( _nSlotId == SID_ATTR_CHAR_COLOR )
505 || ( _nSlotId == SID_ATTR_CHAR_RELIEF )
506 || ( _nSlotId == SID_ATTR_CHAR_KERNING )
507 || ( _nSlotId == SID_ATTR_CHAR_AUTOKERN )
508 || ( _nSlotId == SID_ATTR_CHAR_SCALEWIDTH )
509 )
510 {
511 bNeedParametrizedDispatcher = true;
512 }
513 else
514 {
516 const SfxSlot* pSlot = rSlotPool.GetSlot( _nSlotId );
517 const SfxType* pType = pSlot ? pSlot->GetType() : nullptr;
518 if ( pType )
519 {
520 bNeedParametrizedDispatcher = ( pType->nAttribs > 0 );
521 }
522 }
523
524 if ( bNeedParametrizedDispatcher )
525 {
526 pAttributeDispatcher = new OParametrizedAttributeDispatcher( pRichTextControl->getView(), _nSlotId, _rURL, pRichTextControl );
527 }
528 else
529 {
530 pAttributeDispatcher = new OAttributeDispatcher( pRichTextControl->getView(), _nSlotId, _rURL, pRichTextControl );
531 }
532 }
533 else
534 {
535 SAL_WARN("forms.richtext", "ORichTextPeer::implCreateDispatcher: not creating dispatcher (unsupported slot) for "
536 << _rURL.Complete);
537 }
538 }
539 break;
540 }
541
542 SingleAttributeDispatcher xDispatcher( pDispatcher );
543 if ( pAttributeDispatcher )
544 {
545 xDispatcher = SingleAttributeDispatcher( pAttributeDispatcher );
546 pRichTextControl->enableAttributeNotification( _nSlotId, pAttributeDispatcher.get() );
547 }
548
549 return xDispatcher;
550 }
551
552
553 namespace
554 {
555 SfxSlotId lcl_getSlotFromUnoName( SfxSlotPool const & _rSlotPool, const OUString& _rUnoSlotName )
556 {
557 const SfxSlot* pSlot = _rSlotPool.GetUnoSlot( _rUnoSlotName );
558 if ( pSlot )
559 {
560 // okay, there's a slot with the given UNO name
561 return lcl_translateConflictingSlot( pSlot->GetSlotId() );
562 }
563
564 // some hard-coded slots, which do not have a UNO name at SFX level, but which
565 // we nevertheless need to transport via UNO mechanisms, so we need a name
566 if ( _rUnoSlotName == "AllowHangingPunctuation" )
567 return SID_ATTR_PARA_HANGPUNCTUATION;
568 if ( _rUnoSlotName == "ApplyForbiddenCharacterRules" )
569 return SID_ATTR_PARA_FORBIDDEN_RULES;
570 if ( _rUnoSlotName == "UseScriptSpacing" )
571 return SID_ATTR_PARA_SCRIPTSPACE;
572
573 OSL_ENSURE( pSlot, "lcl_getSlotFromUnoName: unknown UNO slot name!" );
574 return 0;
575 }
576 }
577
578
579 Reference< XDispatch > SAL_CALL ORichTextPeer::queryDispatch( const css::util::URL& _rURL, const OUString& /*_rTargetFrameName*/, sal_Int32 /*_nSearchFlags*/ )
580 {
581 Reference< XDispatch > xReturn;
582 if ( !GetWindow() )
583 {
584 OSL_FAIL( "ORichTextPeer::queryDispatch: already disposed?" );
585 return xReturn;
586 }
587
588 // is it a UNO slot?
589 static constexpr std::u16string_view sUnoProtocolPrefix( u".uno:" );
590 if ( _rURL.Complete.startsWith( sUnoProtocolPrefix ) )
591 {
592 OUString sUnoSlotName = _rURL.Complete.copy( sUnoProtocolPrefix.size() );
593 SfxSlotId nSlotId = lcl_getSlotFromUnoName( SfxSlotPool::GetSlotPool(), sUnoSlotName );
594 if ( nSlotId > 0 )
595 {
596 // do we already have a dispatcher for this?
597 AttributeDispatchers::const_iterator aDispatcherPos = m_aDispatchers.find( nSlotId );
598 if ( aDispatcherPos == m_aDispatchers.end() )
599 {
600 SingleAttributeDispatcher pDispatcher = implCreateDispatcher( nSlotId, _rURL );
601 if ( pDispatcher.is() )
602 {
603 aDispatcherPos = m_aDispatchers.emplace( nSlotId, pDispatcher ).first;
604 }
605 }
606
607 if ( aDispatcherPos != m_aDispatchers.end() )
608 xReturn = aDispatcherPos->second.get();
609 }
610 }
611
612 return xReturn;
613 }
614
615
616 Sequence< Reference< XDispatch > > SAL_CALL ORichTextPeer::queryDispatches( const Sequence< DispatchDescriptor >& _rRequests )
617 {
618 Sequence< Reference< XDispatch > > aReturn( _rRequests.getLength() );
619 Reference< XDispatch >* pReturn = aReturn.getArray();
620
621 const DispatchDescriptor* pRequest = _rRequests.getConstArray();
622 const DispatchDescriptor* pRequestEnd = pRequest + _rRequests.getLength();
623 for ( ; pRequest != pRequestEnd; ++pRequest, ++pReturn )
624 {
625 *pReturn = queryDispatch( pRequest->FeatureURL, pRequest->FrameName, pRequest->SearchFlags );
626 }
627 return aReturn;
628 }
629
630
632 {
633 AttributeDispatchers::iterator aDispatcherPos = m_aDispatchers.find( SID_COPY );
634 if ( aDispatcherPos != m_aDispatchers.end() )
635 aDispatcherPos->second->invalidate();
636
637 aDispatcherPos = m_aDispatchers.find( SID_CUT );
638 if ( aDispatcherPos != m_aDispatchers.end() )
639 aDispatcherPos->second->invalidate();
640 }
641
642
643} // namespace frm
644
645extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
647 css::uno::Sequence<css::uno::Any> const &)
648{
649 return cppu::acquire(new frm::ORichTextControl());
650}
651
652/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
MapUnit GetMapUnit() const
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
const MapMode & GetMapMode() const
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
bool IsInRange(sal_uInt16 nWhich) const
static SfxSlotPool & GetSlotPool(SfxViewFrame *pFrame=nullptr)
const SfxSlot * GetSlot(sal_uInt16 nId) const
const SfxSlot * GetUnoSlot(const OUString &rUnoName) const
sal_uInt16 GetSlotId() const
const SfxType * GetType() const
virtual bool requiresNewPeer(const OUString &_rPropertyName) const
static OutputDevice * GetOutputDevice(const css::uno::Reference< css::awt::XDevice > &rxDevice)
vcl::Window * GetWindow() const
css::uno::Reference< css::awt::XGraphics > SAL_CALL getGraphics() override
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
void SAL_CALL dispose() override
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
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 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
static RichTextEngine * getEditEngine(const css::uno::Reference< css::awt::XControlModel > &_rxModel)
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
virtual ~ORichTextPeer() override
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
static bool isMappableSlot(SfxSlotId _nSlotId)
determines whether a given slot can be mapped to an aspect of an attribute of the EditEngine
void SetStyle(WinBits nStyle)
WinBits GetStyle() const
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
#define DBG_ASSERT(sCon, aError)
#define DBG_TESTSOLARMUTEX()
#define DBG_UNHANDLED_EXCEPTION(...)
float u
bool bReadOnly
constexpr OUStringLiteral PROPERTY_READONLY
Definition: frm_strings.hxx:41
constexpr OUStringLiteral PROPERTY_BACKGROUNDCOLOR
constexpr OUStringLiteral PROPERTY_VSCROLL
constexpr OUStringLiteral PROPERTY_HSCROLL
constexpr OUStringLiteral PROPERTY_HARDLINEBREAKS
constexpr OUStringLiteral PROPERTY_TABSTOP
constexpr OUStringLiteral PROPERTY_HIDEINACTIVESELECTION
constexpr OUStringLiteral PROPERTY_RICH_TEXT
constexpr OUStringLiteral PROPERTY_BORDER
#define SAL_WARN(area, stream)
MapUnit
tools::Long const nBorder
@ Exception
Type
ListBox is a bit confusing / different from other form components, so here are a few notes:
Definition: BaseListBox.hxx:25
sal_uInt16 SfxSlotId
a SFX slot id
IMPLEMENT_FORWARD_XTYPEPROVIDER2(ChildWindowPane, ChildWindowPaneInterfaceBase, Pane)
IMPLEMENT_FORWARD_XINTERFACE2(ChildWindowPane, ChildWindowPaneInterfaceBase, Pane)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_form_ORichTextControl_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
constexpr OUStringLiteral FRM_SUN_CONTROL_RICHTEXTCONTROL
Definition: services.hxx:166
sal_uInt16 nAttribs
Reference< XModel > xModel
sal_Int64 WinBits
WinBits const WB_BORDER
WinBits const WB_WORDBREAK
WinBits const WB_VSCROLL
WinBits const WB_HSCROLL