LibreOffice Module sw (master)  1
edtwin2.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 <doc.hxx>
21 #include <osl/thread.h>
22 #include <vcl/help.hxx>
23 #include <tools/urlobj.hxx>
24 #include <fmtrfmrk.hxx>
25 #include <svl/urihelper.hxx>
26 #include <sfx2/sfxhelp.hxx>
27 #include <svx/svdview.hxx>
28 #include <svx/svdpagv.hxx>
29 #include <swmodule.hxx>
30 #include <modcfg.hxx>
31 #include <view.hxx>
32 #include <wrtsh.hxx>
33 #include <docsh.hxx>
34 #include <edtwin.hxx>
35 #include <dpage.hxx>
36 #include <docufld.hxx>
37 #include <reffld.hxx>
38 #include <cellatr.hxx>
39 #include <shdwcrsr.hxx>
40 #include <fmtinfmt.hxx>
41 #include <fmtftn.hxx>
42 #include <redline.hxx>
43 #include <tox.hxx>
44 #include <txatbase.hxx>
45 #include <uitool.hxx>
46 #include <viewopt.hxx>
47 #include <strings.hrc>
48 
49 #include <IDocumentMarkAccess.hxx>
50 #include <txtfrm.hxx>
51 #include <ndtxt.hxx>
52 
53 static OUString lcl_GetRedlineHelp( const SwRangeRedline& rRedl, bool bBalloon )
54 {
55  const char* pResId = nullptr;
56  switch( rRedl.GetType() )
57  {
58  case RedlineType::Insert: pResId = STR_REDLINE_INSERT; break;
59  case RedlineType::Delete: pResId = STR_REDLINE_DELETE; break;
60  case RedlineType::Format: pResId = STR_REDLINE_FORMAT; break;
61  case RedlineType::Table: pResId = STR_REDLINE_TABLE; break;
62  case RedlineType::FmtColl: pResId = STR_REDLINE_FMTCOLL; break;
63  case RedlineType::ParagraphFormat: pResId = STR_REDLINE_PARAGRAPH_FORMAT; break;
64  case RedlineType::TableRowInsert: pResId = STR_REDLINE_TABLE_ROW_INSERT; break;
65  case RedlineType::TableRowDelete: pResId = STR_REDLINE_TABLE_ROW_DELETE; break;
66  case RedlineType::TableCellInsert: pResId = STR_REDLINE_TABLE_CELL_INSERT; break;
67  case RedlineType::TableCellDelete: pResId = STR_REDLINE_TABLE_CELL_DELETE; break;
68  default: break;
69  }
70 
71  OUStringBuffer sBuf;
72  if (pResId)
73  {
74  sBuf.append(SwResId(pResId));
75  sBuf.append(": ");
76  sBuf.append(rRedl.GetAuthorString());
77  sBuf.append(" - ");
78  sBuf.append(GetAppLangDateTimeString(rRedl.GetTimeStamp()));
79  if( bBalloon && !rRedl.GetComment().isEmpty() )
80  sBuf.append('\n').append(rRedl.GetComment());
81  }
82  return sBuf.makeStringAndClear();
83 }
84 
85 OUString SwEditWin::ClipLongToolTip(const OUString& rText)
86 {
87  OUString sDisplayText(rText);
88  long nTextWidth = GetTextWidth(sDisplayText);
89  long nMaxWidth = GetDesktopRectPixel().GetWidth() * 2 / 3;
90  nMaxWidth = PixelToLogic(Size(nMaxWidth, 0)).Width();
91  if (nTextWidth > nMaxWidth)
92  sDisplayText = GetEllipsisString(sDisplayText, nMaxWidth, DrawTextFlags::CenterEllipsis);
93  return sDisplayText;
94 }
95 
97 {
99  bool bQuickBalloon = bool(rEvt.GetMode() & ( HelpEventMode::QUICK | HelpEventMode::BALLOON ));
100  if(bQuickBalloon && !rSh.GetViewOptions()->IsShowContentTips())
101  return;
102  bool bContinue = true;
103  SET_CURR_SHELL(&rSh);
104  OUString sText;
106  bool bBalloon = bool(rEvt.GetMode() & HelpEventMode::BALLOON);
107 
108  SdrView *pSdrView = rSh.GetDrawView();
109 
110  if( bQuickBalloon && pSdrView )
111  {
112  SdrPageView* pPV = pSdrView->GetSdrPageView();
113  SwDPage* pPage = pPV ? static_cast<SwDPage*>(pPV->GetPage()) : nullptr;
114  bContinue = pPage && pPage->RequestHelp(this, pSdrView, rEvt);
115  }
116 
117  if( bContinue && bQuickBalloon)
118  {
119  SwRect aFieldRect;
120  SwContentAtPos aContentAtPos( IsAttrAtPos::Field |
127 #ifdef DBG_UTIL
129  ( bBalloon ? IsAttrAtPos::CurrAttrs : IsAttrAtPos::NONE) |
130 #endif
132 
133  if( rSh.GetContentAtPos( aPos, aContentAtPos, false, &aFieldRect ) )
134  {
135  QuickHelpFlags nStyle = QuickHelpFlags::NONE; // style of quick help
136  switch( aContentAtPos.eContentAtPos )
137  {
138  case IsAttrAtPos::TableBoxFml:
139  sText = "= " + static_cast<const SwTableBoxFormula*>(aContentAtPos.aFnd.pAttr)->GetFormula();
140  break;
141 #ifdef DBG_UTIL
143  {
144  sText = OStringToOUString(OString::number(
145  static_cast<const SwTableBoxValue*>(aContentAtPos.aFnd.pAttr)->GetValue()),
146  osl_getThreadTextEncoding());
147  break;
148  }
150  sText = aContentAtPos.sStr;
151  break;
152 #endif
153 
155  {
156  sText = static_cast<const SwFormatINetFormat*>(aContentAtPos.aFnd.pAttr)->GetValue();
157  sText = URIHelper::removePassword( sText,
160  //#i63832# remove the link target type
161  sal_Int32 nFound = sText.indexOf(cMarkSeparator);
162  if( nFound != -1 && (++nFound) < sText.getLength() )
163  {
164  OUString sSuffix( sText.copy(nFound) );
165  if( sSuffix == "table" ||
166  sSuffix == "frame" ||
167  sSuffix == "region" ||
168  sSuffix == "outline" ||
169  sSuffix == "text" ||
170  sSuffix == "graphic" ||
171  sSuffix == "ole" )
172  sText = sText.copy( 0, nFound - 1);
173  }
174  // #i104300#
175  // special handling if target is a cross-reference bookmark
176  {
177  OUString sTmpSearchStr = sText.copy( 1 );
178  IDocumentMarkAccess* pMarkAccess = rSh.getIDocumentMarkAccess();
180  pMarkAccess->findBookmark( sTmpSearchStr );
181  if ( ppBkmk != pMarkAccess->getBookmarksEnd() &&
184  {
185  SwTextNode* pTextNode = (*ppBkmk)->GetMarkStart().nNode.GetNode().GetTextNode();
186  if ( pTextNode )
187  {
188  sText = sw::GetExpandTextMerged(rSh.GetLayout(), *pTextNode, true, false, ExpandMode(0));
189 
190  if( !sText.isEmpty() )
191  {
192  OUStringBuffer sTmp(sText.replaceAll(u"\u00ad", ""));
193  for (sal_Int32 i = 0; i < sTmp.getLength(); ++i)
194  {
195  if (sTmp[i] < 0x20)
196  sTmp[i] = 0x20;
197  else if (sTmp[i] == 0x2011)
198  sTmp[i] = '-';
199  }
200  sText = sTmp.makeStringAndClear();
201  }
202  }
203  }
204  }
205  // #i80029#
206  bool bExecHyperlinks = m_rView.GetDocShell()->IsReadOnly();
207  if ( !bExecHyperlinks )
208  {
209  sText = SfxHelp::GetURLHelpText(sText);
210  }
211  break;
212  }
214  {
215  vcl::KeyCode aCode( KEY_SPACE );
216  vcl::KeyCode aModifiedCode( KEY_SPACE, KEY_MOD1 );
217  OUString aModStr( aModifiedCode.GetName() );
218  aModStr = aModStr.replaceFirst(aCode.GetName(), "");
219  aModStr = aModStr.replaceAll("+", "");
220  sText = SwResId(STR_SMARTTAG_CLICK).replaceAll("%s", aModStr);
221  break;
222  }
223 
224  case IsAttrAtPos::Ftn:
225  if( aContentAtPos.pFndTextAttr && aContentAtPos.aFnd.pAttr )
226  {
227  const SwFormatFootnote* pFootnote = static_cast<const SwFormatFootnote*>(aContentAtPos.aFnd.pAttr);
228  OUString sTmp(pFootnote->GetFootnoteText(*rSh.GetLayout()));
229  sText = SwResId( pFootnote->IsEndNote()
230  ? STR_ENDNOTE : STR_FTNNOTE ) + sTmp;
231  bBalloon = true;
232  if( aContentAtPos.IsInRTLText() )
233  nStyle |= QuickHelpFlags::BiDiRtl;
234  }
235  break;
236 
238  {
240  const bool bShowInlineTooltips = rSh.GetViewOptions()->IsShowInlineTooltips();
241  if ( bShowTrackChanges && bShowInlineTooltips )
242  sText = lcl_GetRedlineHelp(*aContentAtPos.aFnd.pRedl, bBalloon);
243  break;
244  }
245 
247  sText = aContentAtPos.sStr;
248  if( !sText.isEmpty() && aContentAtPos.pFndTextAttr )
249  {
250  const SwTOXType* pTType = aContentAtPos.pFndTextAttr->
251  GetTOXMark().GetTOXType();
252  if( pTType && !pTType->GetTypeName().isEmpty() )
253  {
254  sText = ": " + sText;
255  sText = pTType->GetTypeName() + sText;
256  }
257  }
258  break;
259 
261  if(aContentAtPos.aFnd.pAttr)
262  {
263  sText = SwResId(STR_CONTENT_TYPE_SINGLE_REFERENCE) + ": ";
264  sText += static_cast<const SwFormatRefMark*>(aContentAtPos.aFnd.pAttr)->GetRefName();
265  }
266  break;
267 
268  default:
269  {
270  SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig();
271  if(!pModOpt->IsHideFieldTips())
272  {
273  const SwField* pField = aContentAtPos.aFnd.pField;
274  switch( pField->Which() )
275  {
276  case SwFieldIds::SetExp:
277  case SwFieldIds::Table:
278  case SwFieldIds::GetExp:
279  {
280  sal_uInt16 nOldSubType = pField->GetSubType();
281  const_cast<SwField*>(pField)->SetSubType(nsSwExtendedSubType::SUB_CMD);
282  sText = pField->ExpandField(true, rSh.GetLayout());
283  const_cast<SwField*>(pField)->SetSubType(nOldSubType);
284  }
285  break;
286 
287  case SwFieldIds::Postit:
288  {
289  break;
290  }
291  case SwFieldIds::Input: // BubbleHelp, because the suggestion could be quite long
292  bBalloon = true;
293  [[fallthrough]];
296  sText = pField->GetPar2();
297  break;
298 
300  sText = pField->GetFieldName();
301  break;
302 
303  case SwFieldIds::User:
305  sText = pField->GetPar1();
306  break;
307 
308  case SwFieldIds::DocStat:
309  break;
310 
311  case SwFieldIds::Macro:
312  sText = static_cast<const SwMacroField*>(pField)->GetMacro();
313  break;
314 
315  case SwFieldIds::GetRef:
316  {
317  // #i85090#
318  const SwGetRefField* pRefField( dynamic_cast<const SwGetRefField*>(pField) );
319  OSL_ENSURE( pRefField,
320  "<SwEditWin::RequestHelp(..)> - unexpected type of <pField>" );
321  if ( pRefField )
322  {
323  if ( pRefField->IsRefToHeadingCrossRefBookmark() ||
324  pRefField->IsRefToNumItemCrossRefBookmark() )
325  {
326  sText = pRefField->GetExpandedTextOfReferencedTextNode(*rSh.GetLayout());
327  if ( sText.getLength() > 80 )
328  {
329  sText = sText.copy(0, 80) + "...";
330  }
331  }
332  else
333  {
334  sText = static_cast<const SwGetRefField*>(pField)->GetSetRefName();
335  }
336  }
337  break;
338  }
339 
340  default: break;
341  }
342  }
343 
344  if( sText.isEmpty() )
345  {
347  const bool bShowInlineTooltips = rSh.GetViewOptions()->IsShowInlineTooltips();
348  if ( bShowTrackChanges && bShowInlineTooltips )
349  {
350  aContentAtPos.eContentAtPos = IsAttrAtPos::Redline;
351  if( rSh.GetContentAtPos( aPos, aContentAtPos, false, &aFieldRect ) )
352  sText = lcl_GetRedlineHelp(*aContentAtPos.aFnd.pRedl, bBalloon);
353  }
354  }
355  }
356  }
357  if (!sText.isEmpty())
358  {
359  tools::Rectangle aRect( aFieldRect.SVRect() );
360  Point aPt( OutputToScreenPixel( LogicToPixel( aRect.TopLeft() )));
361  aRect.SetLeft( aPt.X() );
362  aRect.SetTop( aPt.Y() );
363  aPt = OutputToScreenPixel( LogicToPixel( aRect.BottomRight() ));
364  aRect.SetRight( aPt.X() );
365  aRect.SetBottom( aPt.Y() );
366 
367  if( bBalloon )
368  Help::ShowBalloon( this, rEvt.GetMousePosPixel(), aRect, sText );
369  else
370  {
371  // the show the help
372  OUString sDisplayText(ClipLongToolTip(sText));
373  Help::ShowQuickHelp(this, aRect, sDisplayText, nStyle);
374  }
375  }
376 
377  bContinue = false;
378  }
379 
380  }
381 
382  if( bContinue )
383  Window::RequestHelp( rEvt );
384 }
385 
386 void SwEditWin::PrePaint(vcl::RenderContext& /*rRenderContext*/)
387 {
388  SwWrtShell* pWrtShell = GetView().GetWrtShellPtr();
389 
390  if(pWrtShell)
391  {
392  pWrtShell->PrePaint();
393  }
394 }
395 
396 void SwEditWin::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect)
397 {
398  SwWrtShell* pWrtShell = GetView().GetWrtShellPtr();
399  if(!pWrtShell)
400  return;
401  bool bPaintShadowCursor = false;
402  if( m_pShadCursor )
403  {
404  tools::Rectangle aRect( m_pShadCursor->GetRect());
405  // fully resides inside?
406  if( rRect.IsInside( aRect ) )
407  {
408  // then cancel
409  m_pShadCursor.reset();
410  }
411  else if( rRect.IsOver( aRect ))
412  {
413  // resides somewhat above, then everything is clipped outside
414  // and we have to make the "inner part" at the end of the
415  // Paint visible again. Otherwise Paint errors occur!
416  bPaintShadowCursor = true;
417  }
418  }
419 
420  if ( GetView().GetVisArea().GetWidth() <= 0 ||
421  GetView().GetVisArea().GetHeight() <= 0 )
422  Invalidate( rRect );
423  else
424  {
425  pWrtShell->setOutputToWindow(true);
426  pWrtShell->Paint(rRenderContext, rRect);
427  pWrtShell->setOutputToWindow(false);
428  }
429 
430  if( bPaintShadowCursor )
431  m_pShadCursor->Paint();
432 }
433 
434 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool IsInRTLText() const
Definition: crstrvl.cxx:1899
void setOutputToWindow(bool bOutputToWindow)
Definition: viewsh.cxx:124
OUString GetEllipsisString(const OUString &rStr, long nMaxWidth, DrawTextFlags nStyle=DrawTextFlags::EndEllipsis) const
long GetWidth() const
OUString GetExpandedTextOfReferencedTextNode(SwRootFrame const &rLayout) const
Definition: reffld.cxx:401
long GetHeight() const
SdrView * GetDrawView()
Definition: vnew.cxx:375
OUString ClipLongToolTip(const OUString &rText)
fdo#55546 cut very long tooltips to 2/3 of the width of the screen via center ellipsis ...
Definition: edtwin2.cxx:85
#define KEY_SPACE
OUString const & GetAuthorString(sal_uInt16 nPos=0) const
Definition: docredln.cxx:1718
bool IsShowContentTips() const
Definition: viewopt.hxx:500
std::string GetValue
const SwView & GetView() const
Definition: edtwin.hxx:241
bool IsHideFieldTips() const
Definition: modcfg.hxx:364
wrapper iterator: wraps iterator of implementation while hiding MarkBase class; only IMark instances ...
static SW_DLLPUBLIC MarkType GetType(const ::sw::mark::IMark &rMark)
Returns the MarkType used to create the mark.
Definition: docbm.cxx:474
const SfxPoolItem * pAttr
Definition: crsrsh.hxx:100
Base class of all fields.
Definition: fldbas.hxx:280
Provides access to the marks of a document.
void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: crsrsh.cxx:1399
SVL_DLLPUBLIC OUString removePassword(OUString const &rURI, INetURLObject::EncodeMechanism eEncodeMechanism, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
#define KEY_MOD1
bool IsOver(const tools::Rectangle &rRect) const
tools::Rectangle GetDesktopRectPixel() const
bool IsEndNote() const
Definition: fmtftn.hxx:74
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
OUString GetAppLangDateTimeString(const DateTime &)
Definition: uitool.cxx:818
For old documents the Field-Which IDs must be preserved !!!
HelpEventMode GetMode() const
static bool IsShowChanges(const RedlineFlags eM)
virtual void RequestHelp(const HelpEvent &rEvt) override
Definition: edtwin2.cxx:96
SwWrtShell & GetWrtShell() const
Definition: view.hxx:400
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
virtual OUString GetPar1() const
Definition: fldbas.cxx:263
OUString sSuffix
void PrePaint()
Definition: viewsh.cxx:161
const DateTime & GetTimeStamp(sal_uInt16 nPos=0) const
Definition: docredln.cxx:1723
virtual void PrePaint(vcl::RenderContext &rRenderContext) override
Definition: edtwin2.cxx:386
IsAttrAtPos eContentAtPos
Definition: crsrsh.hxx:105
only for debugging
OUString sStr
Definition: crsrsh.hxx:107
union SwContentAtPos::@24 aFnd
const IDocumentMarkAccess * getIDocumentMarkAccess() const
Provides access to the document bookmark interface.
Definition: viewsh.cxx:2582
const Point & GetMousePosPixel() const
SwDoc * GetDoc()
returns Doc. But be careful!
Definition: docsh.hxx:203
virtual const_iterator_t getBookmarksEnd() const =0
returns a STL-like random access iterator to the end of the sequence of IBookmarks.
bool IsRefToNumItemCrossRefBookmark() const
Definition: reffld.cxx:385
OUString GetExpandTextMerged(SwRootFrame const *const pLayout, SwTextNode const &rNode, bool const bWithNumber, bool const bWithSpacesForLevel, ExpandMode const i_mode)
#define SW_MOD()
Definition: swmodule.hxx:256
const SwField * pField
Definition: crsrsh.hxx:99
const SwExtendedSubType SUB_CMD
Show command.
Definition: fldbas.hxx:205
std::unique_ptr< SwShadowCursor, o3tl::default_delete< SwShadowCursor > > m_pShadCursor
Definition: edtwin.hxx:94
int i
OUString GetFootnoteText(SwRootFrame const &rLayout) const
Definition: atrftn.cxx:184
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
QuickHelpFlags
float u
const OUString & GetTypeName() const
Definition: tox.hxx:660
OUString GetName(vcl::Window *pWindow=nullptr) const
#define SET_CURR_SHELL(shell)
Definition: swtypes.hxx:101
bool IsInside(const Point &rPOINT) const
virtual const_iterator_t findBookmark(const OUString &rMark) const =0
Finds a bookmark by name.
OUString SwResId(const char *pId)
Definition: swmodule.cxx:178
virtual OUString GetPar2() const
Definition: fldbas.cxx:268
const sal_Unicode cMarkSeparator
Definition: swtypes.hxx:137
const SwTextAttr * pFndTextAttr
Definition: crsrsh.hxx:108
Point ScreenToOutputPixel(const Point &rPos) const
static void ShowQuickHelp(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rHelpText, QuickHelpFlags nStyle=QuickHelpFlags::NONE)
virtual sal_uInt16 GetSubType() const
Definition: fldbas.cxx:284
SwDocShell * GetDocShell()
Definition: view.cxx:1128
bool IsReadOnly() const
Point PixelToLogic(const Point &rDevicePt) const
Point LogicToPixel(const Point &rLogicPt) const
const OUString & GetComment(sal_uInt16 nPos=0) const
Definition: docredln.cxx:1733
bool RequestHelp(vcl::Window *pWindow, SdrView const *pView, const HelpEvent &rEvt)
Definition: dpage.cxx:143
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
ExpandMode
Some helpers for converting model strings to view strings.
OUString ExpandField(bool bCached, SwRootFrame const *pLayout) const
expand the field.
Definition: fldbas.cxx:404
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:334
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:401
SwFieldIds Which() const
ResId.
Definition: fldbas.cxx:192
tools::Rectangle SVRect() const
Definition: swrect.hxx:282
bool IsShowInlineTooltips() const
Definition: viewopt.hxx:271
bool IsRefToHeadingCrossRefBookmark() const
Definition: reffld.cxx:379
SdrPage * GetPage() const
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:426
RedlineType GetType(sal_uInt16 nPos=0) const
Definition: docredln.cxx:1728
virtual OUString GetFieldName() const
get name or content
Definition: fldbas.cxx:247
long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
const SwRangeRedline * pRedl
Definition: crsrsh.hxx:101
SwView & m_rView
Definition: edtwin.hxx:97
const tools::Rectangle & GetVisArea() const
Definition: view.hxx:413
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
Point OutputToScreenPixel(const Point &rPos) const
bool GetContentAtPos(const Point &rPt, SwContentAtPos &rContentAtPos, bool bSetCursor=false, SwRect *pFieldRect=nullptr)
Definition: crstrvl.cxx:1268
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: edtwin2.cxx:396
SwRootFrame * GetLayout() const
Definition: viewsh.cxx:2062
static OUString GetURLHelpText(const OUString &)
static OUString lcl_GetRedlineHelp(const SwRangeRedline &rRedl, bool bBalloon)
Definition: edtwin2.cxx:53
only for debugging
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:842
static void ShowBalloon(vcl::Window *pParent, const Point &rScreenPos, const tools::Rectangle &, const OUString &rHelpText)