LibreOffice Module vcl (master)  1
ctrl.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 <vcl/svapp.hxx>
21 #include <vcl/event.hxx>
22 #include <vcl/ctrl.hxx>
23 #include <vcl/decoview.hxx>
24 #include <vcl/settings.hxx>
25 #include <vcl/uitest/logger.hxx>
26 #include <sal/log.hxx>
27 
28 #include <textlayout.hxx>
29 #include <svdata.hxx>
30 
31 using namespace vcl;
32 
34 {
35  mbHasControlFocus = false;
36  mbShowAccelerator = false;
37 }
38 
40  Window( nType )
41 {
43 }
44 
45 Control::Control( vcl::Window* pParent, WinBits nStyle ) :
47 {
49  ImplInit( pParent, nStyle, nullptr );
50 }
51 
53 {
54  disposeOnce();
55 }
56 
58 {
59  mxLayoutData.reset();
61  Window::dispose();
62 }
63 
64 void Control::EnableRTL( bool bEnable )
65 {
66  // convenience: for controls also switch layout mode
70  Window::EnableRTL(bEnable);
71 }
72 
74 {
76  Window::Resize();
77 }
78 
80 {
81 }
82 
84 {
85  SAL_WARN_IF( mxLayoutData, "vcl", "Control::CreateLayoutData: should be called with non-existent layout data only!" );
86  mxLayoutData.emplace();
87 }
88 
90 {
91  return bool(mxLayoutData);
92 }
93 
94 void Control::SetText( const OUString& rStr )
95 {
97  Window::SetText( rStr );
98 }
99 
100 ControlLayoutData::ControlLayoutData() : m_pParent( nullptr )
101 {
102 }
103 
105 {
106  return (nIndex >= 0 && nIndex < static_cast<tools::Long>(m_aUnicodeBoundRects.size())) ? m_aUnicodeBoundRects[ nIndex ] : tools::Rectangle();
107 }
108 
110 {
111  if( !HasLayoutData() )
112  FillLayoutData();
113  return mxLayoutData ? mxLayoutData->GetCharacterBounds( nIndex ) : tools::Rectangle();
114 }
115 
117 {
118  tools::Long nIndex = -1;
119  for( tools::Long i = m_aUnicodeBoundRects.size()-1; i >= 0; i-- )
120  {
121  Point aTopLeft = m_aUnicodeBoundRects[i].TopLeft();
122  Point aBottomRight = m_aUnicodeBoundRects[i].BottomRight();
123  if (rPoint.X() >= aTopLeft.X() && rPoint.Y() >= aTopLeft.Y() &&
124  rPoint.X() <= aBottomRight.X() && rPoint.Y() <= aBottomRight.Y())
125  {
126  nIndex = i;
127  break;
128  }
129  }
130  return nIndex;
131 }
132 
133 tools::Long Control::GetIndexForPoint( const Point& rPoint ) const
134 {
135  if( ! HasLayoutData() )
136  FillLayoutData();
137  return mxLayoutData ? mxLayoutData->GetIndexForPoint( rPoint ) : -1;
138 }
139 
141 {
142  tools::Long nLines = m_aLineIndices.size();
143  if( nLines == 0 && !m_aDisplayText.isEmpty() )
144  nLines = 1;
145  return nLines;
146 }
147 
149 {
150  Pair aPair( -1, -1 );
151 
152  int nDisplayLines = m_aLineIndices.size();
153  if( nLine >= 0 && nLine < nDisplayLines )
154  {
155  aPair.A() = m_aLineIndices[nLine];
156  if( nLine+1 < nDisplayLines )
157  aPair.B() = m_aLineIndices[nLine+1]-1;
158  else
159  aPair.B() = m_aDisplayText.getLength()-1;
160  }
161  else if( nLine == 0 && nDisplayLines == 0 && !m_aDisplayText.isEmpty() )
162  {
163  // special case for single line controls so the implementations
164  // in that case do not have to fill in the line indices
165  aPair.A() = 0;
166  aPair.B() = m_aDisplayText.getLength()-1;
167  }
168  return aPair;
169 }
170 
172 {
173  if( !HasLayoutData() )
174  FillLayoutData();
175  return mxLayoutData ? mxLayoutData->GetLineStartEnd( nLine ) : Pair( -1, -1 );
176 }
177 
179 {
180  // is the index sensible at all ?
181  if( nIndex >= 0 && nIndex < m_aDisplayText.getLength() )
182  {
183  int nDisplayLines = m_aLineIndices.size();
184  // if only 1 line exists, then absolute and relative index are
185  // identical -> do nothing
186  if( nDisplayLines > 1 )
187  {
188  int nLine;
189  for( nLine = nDisplayLines-1; nLine >= 0; nLine-- )
190  {
191  if( m_aLineIndices[nLine] <= nIndex )
192  {
193  nIndex -= m_aLineIndices[nLine];
194  break;
195  }
196  }
197  if( nLine < 0 )
198  {
199  SAL_WARN_IF( nLine < 0, "vcl", "ToRelativeLineIndex failed" );
200  nIndex = -1;
201  }
202  }
203  }
204  else
205  nIndex = -1;
206 
207  return nIndex;
208 }
209 
211 {
212  if( !HasLayoutData() )
213  FillLayoutData();
214  return mxLayoutData ? mxLayoutData->ToRelativeLineIndex( nIndex ) : -1;
215 }
216 
217 OUString Control::GetDisplayText() const
218 {
219  if( !HasLayoutData() )
220  FillLayoutData();
221  return mxLayoutData ? mxLayoutData->m_aDisplayText : GetText();
222 }
223 
225 {
226  if ( rNEvt.GetType() == MouseNotifyEvent::GETFOCUS )
227  {
228  if ( !mbHasControlFocus )
229  {
230  mbHasControlFocus = true;
231  CompatStateChanged( StateChangedType::ControlFocus );
232  if ( ImplCallEventListenersAndHandler( VclEventId::ControlGetFocus, {} ) )
233  // been destroyed within the handler
234  return true;
235  }
236  }
237  else
238  {
239  if ( rNEvt.GetType() == MouseNotifyEvent::LOSEFOCUS )
240  {
242  if ( !pFocusWin || !ImplIsWindowOrChild( pFocusWin ) )
243  {
244  mbHasControlFocus = false;
245  CompatStateChanged( StateChangedType::ControlFocus );
246  if ( ImplCallEventListenersAndHandler( VclEventId::ControlLoseFocus, [this] () { maLoseFocusHdl.Call(*this); } ) )
247  // been destroyed within the handler
248  return true;
249  }
250  }
251  }
252  return Window::EventNotify( rNEvt );
253 }
254 
256 {
257  if( nStateChange == StateChangedType::InitShow ||
258  nStateChange == StateChangedType::Visible ||
259  nStateChange == StateChangedType::Zoom ||
260  nStateChange == StateChangedType::ControlFont
261  )
262  {
263  ImplClearLayoutData();
264  }
265  Window::StateChanged( nStateChange );
266 }
267 
268 void Control::AppendLayoutData( const Control& rSubControl ) const
269 {
270  if( !rSubControl.HasLayoutData() )
271  rSubControl.FillLayoutData();
272  if( !rSubControl.HasLayoutData() || rSubControl.mxLayoutData->m_aDisplayText.isEmpty() )
273  return;
274 
275  tools::Long nCurrentIndex = mxLayoutData->m_aDisplayText.getLength();
276  mxLayoutData->m_aDisplayText += rSubControl.mxLayoutData->m_aDisplayText;
277  int nLines = rSubControl.mxLayoutData->m_aLineIndices.size();
278  int n;
279  mxLayoutData->m_aLineIndices.push_back( nCurrentIndex );
280  for( n = 1; n < nLines; n++ )
281  mxLayoutData->m_aLineIndices.push_back( rSubControl.mxLayoutData->m_aLineIndices[n] + nCurrentIndex );
282  int nRectangles = rSubControl.mxLayoutData->m_aUnicodeBoundRects.size();
283  tools::Rectangle aRel = rSubControl.GetWindowExtentsRelative(this);
284  for( n = 0; n < nRectangles; n++ )
285  {
286  tools::Rectangle aRect = rSubControl.mxLayoutData->m_aUnicodeBoundRects[n];
287  aRect.Move( aRel.Left(), aRel.Top() );
288  mxLayoutData->m_aUnicodeBoundRects.push_back( aRect );
289  }
290 }
291 
292 void Control::CallEventListeners( VclEventId nEvent, void* pData)
293 {
294  VclPtr<Control> xThis(this);
295  UITestLogger::getInstance().logAction(xThis, nEvent);
296 
297  vcl::Window::CallEventListeners(nEvent, pData);
298 }
299 
300 bool Control::ImplCallEventListenersAndHandler( VclEventId nEvent, std::function<void()> const & callHandler )
301 {
302  VclPtr<Control> xThis(this);
303 
304  Control::CallEventListeners( nEvent );
305 
306  if ( !xThis->isDisposed() )
307  {
308  if (callHandler)
309  {
310  callHandler();
311  }
312 
313  if ( !xThis->isDisposed() )
314  return false;
315  }
316  return true;
317 }
318 
319 void Control::SetLayoutDataParent( const Control* pParent ) const
320 {
321  if( HasLayoutData() )
322  mxLayoutData->m_pParent = pParent;
323 }
324 
326 {
327  mxLayoutData.reset();
328 }
329 
331 {
332  // use a deco view to draw the frame
333  // However, since there happens a lot of magic there, we need to fake some (style) settings
334  // on the device
335  AllSettings aOriginalSettings( pDev->GetSettings() );
336 
337  AllSettings aNewSettings( aOriginalSettings );
338  StyleSettings aStyle( aNewSettings.GetStyleSettings() );
339 
340  // The *only known* clients of the Draw methods of the various VCL-controls are form controls:
341  // During print preview, and during printing, Draw is called. Thus, drawing always happens with a
342  // mono (colored) border
343  aStyle.SetOptions( aStyle.GetOptions() | StyleSettingsOptions::Mono );
344  aStyle.SetMonoColor( GetSettings().GetStyleSettings().GetMonoColor() );
345 
346  aNewSettings.SetStyleSettings( aStyle );
347  // #i67023# do not call data changed listeners for this fake
348  // since they may understandably invalidate on settings changed
349  pDev->OutputDevice::SetSettings( aNewSettings );
350 
351  DecorationView aDecoView( pDev );
352  rRect = aDecoView.DrawFrame( rRect, DrawFrameStyle::Out, DrawFrameFlags::WindowBorder );
353 
354  pDev->OutputDevice::SetSettings( aOriginalSettings );
355 }
356 
358 {
359  mbShowAccelerator = bVal;
360 };
361 
363 {
364  if( m_pParent )
366 }
367 
369 {
370  return Size( GetTextWidth( GetText() ) + 2 * 12,
371  GetTextHeight() + 2 * 6 );
372 }
373 
374 void Control::SetReferenceDevice( OutputDevice* _referenceDevice )
375 {
376  if ( mpReferenceDevice == _referenceDevice )
377  return;
378 
379  mpReferenceDevice = _referenceDevice;
380  Invalidate();
381 }
382 
384 {
385  // tdf#118377 It can happen that mpReferenceDevice is already disposed and
386  // stays disposed (see task, even when Dialog is closed). I have no idea if
387  // this may be very bad - someone who knows more about lifetime of OutputDevice's
388  // will have to decide.
389  // To secure this, I changed all accesses to mpControlData->mpReferenceDevice to
390  // use Control::GetReferenceDevice() - only use mpControlData->mpReferenceDevice
391  // inside Control::SetReferenceDevice and Control::GetReferenceDevice().
392  // Control::GetReferenceDevice() will now reset mpReferenceDevice if it is already
393  // disposed. This way all usages will do a kind of 'test-and-get' call.
394  if(nullptr != mpReferenceDevice && mpReferenceDevice->isDisposed())
395  {
396  const_cast<Control*>(this)->SetReferenceDevice(nullptr);
397  }
398 
399  return mpReferenceDevice;
400 }
401 
402 const vcl::Font& Control::GetCanonicalFont( const StyleSettings& _rStyle ) const
403 {
404  return _rStyle.GetLabelFont();
405 }
406 
407 const Color& Control::GetCanonicalTextColor( const StyleSettings& _rStyle ) const
408 {
409  return _rStyle.GetLabelTextColor();
410 }
411 
413 {
414  const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
415 
416  ApplyControlFont(rRenderContext, GetCanonicalFont(rStyleSettings));
417 
418  ApplyControlForeground(rRenderContext, GetCanonicalTextColor(rStyleSettings));
419  rRenderContext.SetTextFillColor();
420 }
421 
423 {
424  ApplySettings(*GetOutDev());
425 }
426 
427 tools::Rectangle Control::DrawControlText( OutputDevice& _rTargetDevice, const tools::Rectangle& rRect, const OUString& _rStr,
428  DrawTextFlags _nStyle, std::vector< tools::Rectangle >* _pVector, OUString* _pDisplayText, const Size* i_pDeviceSize ) const
429 {
430  OUString rPStr = _rStr;
431  DrawTextFlags nPStyle = _nStyle;
432 
433  bool autoacc = ImplGetSVData()->maNWFData.mbAutoAccel;
434 
435  if (autoacc && !mbShowAccelerator)
436  {
437  rPStr = GetNonMnemonicString( _rStr );
438  nPStyle &= ~DrawTextFlags::HideMnemonic;
439  }
440 
441  if( !GetReferenceDevice() || ( GetReferenceDevice() == &_rTargetDevice ) )
442  {
443  const tools::Rectangle aRet = _rTargetDevice.GetTextRect(rRect, rPStr, nPStyle);
444  _rTargetDevice.DrawText(aRet, rPStr, nPStyle, _pVector, _pDisplayText);
445  return aRet;
446  }
447 
448  ControlTextRenderer aRenderer( *this, _rTargetDevice, *GetReferenceDevice() );
449  return aRenderer.DrawText(rRect, rPStr, nPStyle, _pVector, _pDisplayText, i_pDeviceSize);
450 }
451 
453  const OUString& _rStr, DrawTextFlags _nStyle, Size* o_pDeviceSize ) const
454 {
455  OUString rPStr = _rStr;
456  DrawTextFlags nPStyle = _nStyle;
457 
458  bool autoacc = ImplGetSVData()->maNWFData.mbAutoAccel;
459 
460  if (autoacc && !mbShowAccelerator)
461  {
462  rPStr = GetNonMnemonicString( _rStr );
463  nPStyle &= ~DrawTextFlags::HideMnemonic;
464  }
465 
466  if ( !GetReferenceDevice() || ( GetReferenceDevice() == &_rTargetDevice ) )
467  {
468  tools::Rectangle aRet = _rTargetDevice.GetTextRect( rRect, rPStr, nPStyle );
469  if (o_pDeviceSize)
470  {
471  *o_pDeviceSize = aRet.GetSize();
472  }
473  return aRet;
474  }
475 
476  ControlTextRenderer aRenderer( *this, _rTargetDevice, *GetReferenceDevice() );
477  return aRenderer.GetTextRect(rRect, rPStr, nPStyle, o_pDeviceSize);
478 }
479 
480 Font
482 {
483  Font aFont(GetCanonicalFont(GetSettings().GetStyleSettings()));
484  if (IsControlFont())
485  aFont.Merge(GetControlFont());
486  return aFont;
487 }
488 
490 {
491  MouseButtonDown(rEvent);
492 }
493 
495 {
496  MouseButtonUp(rEvent);
497 }
498 
500 {
501  MouseMove(rEvent);
502 }
503 
504 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual OUString GetDisplayText() const override
Definition: ctrl.cxx:217
void CreateLayoutData() const
creates the mpData->mpLayoutData structure
Definition: ctrl.cxx:83
virtual void EnableRTL(bool bEnable=true) override
Definition: ctrl.cxx:64
bool ImplCallEventListenersAndHandler(VclEventId nEvent, std::function< void()> const &callHandler)
this calls both our event listeners, and a specified handler
Definition: ctrl.cxx:300
tools::Long GetLineCount() const
Definition: ctrl.cxx:140
sal_Int32 nIndex
void LogicMouseMove(const MouseEvent &rMouseEvent) override
Same as MouseMove(), but coordinates are in logic unit. used for LOK.
Definition: ctrl.cxx:499
SAL_DLLPRIVATE void ImplInitControlData()
Definition: ctrl.cxx:33
Pair GetLineStartEnd(tools::Long nLine) const
Definition: ctrl.cxx:171
std::vector< tools::Long > m_aLineIndices
Definition: ctrl.hxx:48
std::optional< vcl::ControlLayoutData > mxLayoutData
Definition: ctrl.hxx:84
SAL_DLLPRIVATE void ImplDrawFrame(OutputDevice *pDev, tools::Rectangle &rRect)
draws a frame around the give rectangle, onto the given device
Definition: ctrl.cxx:330
constexpr tools::Long Left() const
SAL_DLLPRIVATE void ImplClearLayoutData() const
Definition: ctrl.cxx:325
long Long
const StyleSettings & GetStyleSettings() const
virtual void StateChanged(StateChangedType nStateChange) override
Definition: ctrl.cxx:255
void DrawFrame(const tools::Rectangle &rRect, const Color &rLeftTopColor, const Color &rRightBottomColor)
Definition: decoview.cxx:822
ImplSVNWFData maNWFData
Definition: svdata.hxx:402
sal_Int64 n
virtual void FillLayoutData() const
Definition: ctrl.cxx:79
SAL_DLLPRIVATE void CompatStateChanged(StateChangedType nStateChange)
Definition: window.cxx:3891
void SetTextFillColor()
Definition: text.cxx:706
const Color & GetLabelTextColor() const
void AppendLayoutData(const Control &rSubControl) const
Definition: ctrl.cxx:268
tools::Rectangle DrawControlText(OutputDevice &_rTargetDevice, const tools::Rectangle &_rRect, const OUString &_rStr, DrawTextFlags _nStyle, std::vector< tools::Rectangle > *_pVector, OUString *_pDisplayText, const Size *i_pDeviceSize=nullptr) const
draws the given text onto the given device
Definition: ctrl.cxx:427
virtual const Color & GetCanonicalTextColor(const StyleSettings &_rStyle) const
Definition: ctrl.cxx:407
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
Definition: ctrl.cxx:412
DrawTextFlags
void logAction(VclPtr< Control > const &xUIElement, VclEventId nEvent)
Definition: logger.cxx:147
tools::Rectangle GetControlTextRect(OutputDevice &_rTargetDevice, const tools::Rectangle &rRect, const OUString &_rStr, DrawTextFlags _nStyle, Size *o_pDeviceSize=nullptr) const
Definition: ctrl.cxx:452
StateChangedType
Definition: window.hxx:289
std::vector< tools::Rectangle > m_aUnicodeBoundRects
Definition: ctrl.hxx:46
static UITestLogger & getInstance()
Definition: logger.cxx:611
tools::Rectangle GetTextRect(const tools::Rectangle &rRect, const OUString &rStr, DrawTextFlags nStyle=DrawTextFlags::WordBreak, TextRectInfo *pInfo=nullptr, const vcl::ITextLayout *_pTextLayout=nullptr) const
Definition: text.cxx:1779
sal_Int64 WinBits
OUString m_aDisplayText
Definition: ctrl.hxx:43
tools::Long GetIndexForPoint(const Point &rPoint) const
Definition: ctrl.cxx:116
const vcl::Font & GetLabelFont() const
void SetLayoutMode(vcl::text::ComplexTextLayoutFlags nTextLayoutMode)
Definition: text.cxx:57
virtual ~Control() override
Definition: ctrl.cxx:52
void SetOptions(StyleSettingsOptions nOptions)
VclEventId
Definition: vclevent.hxx:37
a class which allows rendering text of a Control onto a device, by taking into account the metrics of...
Definition: textlayout.hxx:87
tools::Rectangle GetWindowExtentsRelative(const vcl::Window *pRelativeWindow) const
Definition: window.cxx:2910
bool mbAutoAccel
Definition: svdata.hxx:338
void LogicMouseButtonUp(const MouseEvent &rMouseEvent) override
Same as MouseButtonUp(), but coordinates are in logic unit. used for LOK.
Definition: ctrl.cxx:494
VclPtr< OutputDevice > mpReferenceDevice
Definition: ctrl.hxx:85
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:75
tools::Long ToRelativeLineIndex(tools::Long nIndex) const
ToRelativeLineIndex changes a layout data index to a count relative to its line.
Definition: ctrl.cxx:178
void clear()
Definition: vclptr.hxx:190
OutputDevice * GetReferenceDevice() const
Definition: ctrl.cxx:383
tools::Rectangle GetCharacterBounds(tools::Long nIndex) const
Definition: ctrl.cxx:104
virtual bool EventNotify(NotifyEvent &rNEvt)
Definition: event.cxx:104
int i
virtual void SetText(const OUString &rStr) override
Definition: ctrl.cxx:94
void CallEventListeners(VclEventId nEvent, void *pData=nullptr)
Definition: ctrl.cxx:292
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:168
vcl::Font GetUnzoomedControlPointFont() const
Definition: ctrl.cxx:481
void Merge(const Font &rFont)
Definition: font/font.cxx:308
tools::Rectangle GetTextRect(const tools::Rectangle &_rRect, const OUString &_rText, DrawTextFlags _nStyle, Size *o_pDeviceSize)
Definition: textlayout.cxx:341
constexpr tools::Long Top() const
MouseNotifyEvent GetType() const
Definition: event.hxx:308
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
Definition: ctrl.cxx:57
const AllSettings & GetSettings() const
Definition: outdev.hxx:287
void SetShowAccelerator(bool val)
Definition: ctrl.cxx:357
VclPtr< const Control > m_pParent
Definition: ctrl.hxx:50
tools::Rectangle DrawText(const tools::Rectangle &_rRect, const OUString &_rText, DrawTextFlags _nStyle, std::vector< tools::Rectangle > *_pVector, OUString *_pDisplayText, const Size *i_pDeviceSize)
Definition: textlayout.cxx:335
SAL_DLLPRIVATE void ImplInit(vcl::Window *pParent, WinBits nStyle, SystemParentData *pSystemParentData)
Definition: window.cxx:938
virtual Size GetOptimalSize() const override
Definition: ctrl.cxx:368
tools::Long A() const
static vcl::Window * GetFocusWindow()
Get the currently focused window.
Definition: svapp.cxx:1064
constexpr Size GetSize() const
virtual void Resize() override
Definition: ctrl.cxx:73
tools::Long GetIndexForPoint(const Point &rPoint) const
Definition: ctrl.cxx:133
Control(const Control &)=delete
WindowType
Definition: ctrl.hxx:81
#define SAL_WARN_IF(condition, area, stream)
void LogicMouseButtonDown(const MouseEvent &rMouseEvent) override
Same as MouseButtonDown(), but coordinates are in logic unit. used for LOK.
Definition: ctrl.cxx:489
virtual const vcl::Font & GetCanonicalFont(const StyleSettings &_rStyle) const
Definition: ctrl.cxx:402
::OutputDevice const * GetOutDev() const
Definition: window.cxx:568
tools::Rectangle GetCharacterBounds(tools::Long nIndex) const
Definition: ctrl.cxx:109
::Pair GetLineStartEnd(tools::Long nLine) const
Definition: ctrl.cxx:148
void ImplInitSettings()
Definition: ctrl.cxx:422
virtual void StateChanged(StateChangedType nStateChange)
Definition: window.cxx:1940
void Move(tools::Long nHorzMoveDelta, tools::Long nVertMoveDelta)
tools::Long B() const
void CallEventListeners(VclEventId nEvent, void *pData=nullptr)
Definition: event.cxx:218
void SetReferenceDevice(OutputDevice *_referenceDevice)
sets a reference device used for rendering control text
Definition: ctrl.cxx:374
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, std::vector< tools::Rectangle > *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
Definition: text.cxx:774
bool isDisposed() const
bool HasLayoutData() const
determines whether we currently have layout data
Definition: ctrl.cxx:89
tools::Long ToRelativeLineIndex(tools::Long nIndex) const
ToRelativeLineIndex changes a layout data index to a count relative to its line.
Definition: ctrl.cxx:210
void SetLayoutDataParent(const Control *pParent) const
Definition: ctrl.cxx:319
virtual bool EventNotify(NotifyEvent &rNEvt) override
Definition: ctrl.cxx:224