LibreOffice Module sw (master)  1
unotools.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 <sal/config.h>
21 
22 #include <string_view>
23 
24 #include <swtypes.hxx>
25 
26 #include <strings.hrc>
27 #include <unotools.hxx>
28 #include <unoprnms.hxx>
29 #include <i18nutil/unicode.hxx>
30 #include <o3tl/string_view.hxx>
31 #include <rtl/string.h>
32 #include <svtools/colorcfg.hxx>
33 #include <vcl/commandevent.hxx>
34 #include <vcl/jobset.hxx>
35 #include <vcl/settings.hxx>
36 #include <vcl/svapp.hxx>
37 #include <vcl/virdev.hxx>
38 #include <vcl/weld.hxx>
39 #include <com/sun/star/frame/Desktop.hpp>
40 #include <com/sun/star/text/XTextViewCursorSupplier.hpp>
41 #include <com/sun/star/view/XScreenCursor.hpp>
42 #include <com/sun/star/view/DocumentZoomType.hpp>
43 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
44 #include <com/sun/star/style/XStyle.hpp>
45 #include <com/sun/star/text/XTextDocument.hpp>
46 #include <com/sun/star/awt/PosSize.hpp>
47 #include <com/sun/star/view/XViewSettingsSupplier.hpp>
48 #include <com/sun/star/container/XNameContainer.hpp>
49 #include <com/sun/star/frame/XLayoutManager.hpp>
53 #include <comphelper/string.hxx>
54 #include <docsh.hxx>
55 #include <editsh.hxx>
56 #include <swmodule.hxx>
57 #include <TextCursorHelper.hxx>
58 #include <doc.hxx>
59 
60 using namespace ::com::sun::star;
61 
62 constexpr OUStringLiteral cFactory = u"private:factory/swriter";
63 
64 static void disableScrollBars(uno::Reference< beans::XPropertySet > const & xViewProps,
65  bool bEnableOnlineMode)
66 {
67  //the scrollbar logic is kind of busted looking in writer, when the hori scrollbar
68  //property is changed then the hori scrollbar is enabled if the property is
69  //true or browse (online) mode is enabled. So...
70  //disable online mode
71  //turn off scrollbars
72  //turn back on online mode if that's what we want
73  //which subverts the (dodgy/buggy) scrollbar setting
74 
75  //To reproduce this problem, in edit->autotext and click through
76  //the examples and see if the preview gets a horizontal scrollbar
77  uno::Any aFalseSet(uno::Any(false));
78  xViewProps->setPropertyValue(UNO_NAME_SHOW_ONLINE_LAYOUT, aFalseSet);
79 
80  xViewProps->setPropertyValue(UNO_NAME_SHOW_HORI_SCROLL_BAR, aFalseSet);
81  xViewProps->setPropertyValue(UNO_NAME_SHOW_VERT_SCROLL_BAR, aFalseSet);
82 
83  if (bEnableOnlineMode)
84  {
85  xViewProps->setPropertyValue(UNO_NAME_SHOW_ONLINE_LAYOUT, uno::Any(true));
86  }
87 }
88 
89 const sal_Int16 nZoomValues[] =
90 {
91  20,
92  40,
93  50,
94  75,
95  100
96 };
97 
99  const Link<SwOneExampleFrame&,void>* pInitializedLink,
100  const OUString* pURL)
101  : m_aLoadedIdle("sw uibase SwOneExampleFrame Loaded")
102  , m_pModuleView(SW_MOD()->GetView())
103  , m_nStyleFlags(nFlags)
104  , m_bIsInitialized(false)
105 {
106  if (pURL && !pURL->isEmpty())
107  m_sArgumentURL = *pURL;
108 
109  if( pInitializedLink )
110  m_aInitializedLink = *pInitializedLink;
111 
112  // the controller is asynchronously set
114  m_aLoadedIdle.SetPriority(TaskPriority::HIGH_IDLE);
115 }
116 
118 {
119  CustomWidgetController::SetDrawingArea(pDrawingArea);
121  Size aSize(m_xVirDev->LogicToPixel(Size(150, 188), MapMode(MapUnit::MapAppFont)));
122  pDrawingArea->set_size_request(aSize.Width(), aSize.Height());
123  SetOutputSizePixel(aSize);
124  CreateControl();
125 }
126 
128 {
129  switch (rCEvt.GetCommand())
130  {
131  case CommandEventId::ContextMenu:
132  {
133  //#125881# quickly clicking crashes because the control is not fully initialized
134  if (m_xController.is())
135  return CreatePopup(rCEvt.GetMousePosPixel());
136  }
137  break;
138  default:;
139  break;
140  }
141  return CustomWidgetController::Command(rCEvt);
142 }
143 
145 {
146  Size aSize(GetOutputSizePixel());
147  // m_xVirDev instead of rRenderContext just to avoid overlays in writer re-triggering
148  // invalidate on rRenderContext if it is a vcl::Window, which is the "classic" gen mode
149  m_xVirDev->SetOutputSizePixel(aSize);
150 
151  Color aBgColor = SW_MOD()->GetColorConfig().GetColorValue(::svtools::DOCCOLOR).nColor;
152  m_xVirDev->DrawWallpaper(tools::Rectangle(Point(), aSize), aBgColor);
153 
154  auto pCursor = comphelper::getFromUnoTunnel<OTextCursorHelper>(m_xCursor);
155  if (pCursor)
156  {
157  uno::Reference<view::XViewSettingsSupplier> xSettings(m_xController, uno::UNO_QUERY);
158  uno::Reference<beans::XPropertySet> xViewProps = xSettings->getViewSettings();
159  uno::Any aZoom = xViewProps->getPropertyValue(UNO_NAME_ZOOM_VALUE);
160  sal_Int16 nZoom = 100;
161  aZoom >>= nZoom;
162 
163  double fZoom = 100.0 / nZoom;
164 
166  m_xVirDev->SetMapMode(MapMode(MapUnit::MapTwip));
167  SwDoc *pDoc = pCursor->GetDoc();
168  SwDocShell* pShell = pDoc->GetDocShell();
169  tools::Rectangle aRect(Point(), m_xVirDev->PixelToLogic(aSize));
170  pShell->SetVisArea(tools::Rectangle(Point(), Size(aRect.GetWidth() * fZoom,
171  aRect.GetHeight() * fZoom)));
172  pShell->DoDraw(m_xVirDev.get(), aRect.TopLeft(), aRect.GetSize(), JobSetup(), ASPECT_CONTENT);
173  m_xVirDev->Pop();
174  }
175 
176  rRenderContext.DrawOutDev(Point(), aSize, Point(), aSize, *m_xVirDev);
177 }
178 
180 {
181  DisposeControl();
182 }
183 
185 {
186  // create new doc
187  OUString sTempURL(cFactory);
188  if(!m_sArgumentURL.isEmpty())
189  sTempURL = m_sArgumentURL;
190 
191  uno::Reference<frame::XDesktop2> xDesktop = frame::Desktop::create(::comphelper::getProcessComponentContext());
192  uno::Sequence<beans::PropertyValue> args( comphelper::InitPropertySequence({
193  { "DocumentService", uno::Any(OUString("com.sun.star.text.TextDocument")) },
194  { "OpenFlags", uno::Any(OUString("-RB")) },
195  { "Referer", uno::Any(OUString("private:user")) },
196  { "ReadOnly", uno::Any(true) },
197  { "Hidden", uno::Any(true) }
198  }));
199 
200  m_xModel.set(xDesktop->loadComponentFromURL(sTempURL, "_blank", 0, args), uno::UNO_QUERY);
201 
203 }
204 
206 {
208  m_xCursor = nullptr;
209  if (m_xModel)
210  {
211  m_xModel->dispose();
212  m_xModel = nullptr;
213  }
214  m_xController = nullptr;
215 }
216 
217 IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer, void )
218 {
219  if (!m_xModel.is())
220  return;
221 
222  m_xController = m_xModel->getCurrentController();
223 
224  if (m_xController.is())
225  {
226  uno::Reference<frame::XFrame> xFrame = m_xController->getFrame();
227  uno::Reference< beans::XPropertySet > xPropSet( xFrame, uno::UNO_QUERY );
228  if ( xPropSet.is() )
229  {
230  try
231  {
232  uno::Reference< frame::XLayoutManager > xLayoutManager;
233  uno::Any aValue = xPropSet->getPropertyValue("LayoutManager");
234  aValue >>= xLayoutManager;
235  if ( xLayoutManager.is() )
236  xLayoutManager->setVisible( false );
237  }
238  catch (const uno::Exception&)
239  {
240  }
241  }
242 
243  //now the ViewOptions should be set properly
244  uno::Reference< view::XViewSettingsSupplier > xSettings(m_xController, uno::UNO_QUERY);
245  uno::Reference< beans::XPropertySet > xViewProps = xSettings->getViewSettings();
246 
247  const uno::Any aTrueSet( true );
248  const uno::Any aFalseSet( false );
249 
250  if( !m_bIsInitialized )
251  {
252  xViewProps->setPropertyValue(UNO_NAME_SHOW_BREAKS, aFalseSet);
253  xViewProps->setPropertyValue(UNO_NAME_SHOW_DRAWINGS, aTrueSet);
254  xViewProps->setPropertyValue(UNO_NAME_SHOW_FIELD_COMMANDS, aFalseSet);
255  xViewProps->setPropertyValue(UNO_NAME_SHOW_GRAPHICS, aTrueSet);
256  xViewProps->setPropertyValue(UNO_NAME_HIDE_WHITESPACE, aFalseSet);
257  xViewProps->setPropertyValue(UNO_NAME_SHOW_HIDDEN_PARAGRAPHS, aFalseSet);
258  xViewProps->setPropertyValue(UNO_NAME_SHOW_HIDDEN_TEXT, aFalseSet);
259  xViewProps->setPropertyValue(UNO_NAME_SHOW_HORI_RULER, aFalseSet);
260  xViewProps->setPropertyValue(UNO_NAME_SHOW_PARA_BREAKS, aFalseSet);
261  xViewProps->setPropertyValue(UNO_NAME_SHOW_PROTECTED_SPACES, aFalseSet);
262  xViewProps->setPropertyValue(UNO_NAME_SHOW_SOFT_HYPHENS, aFalseSet);
263  xViewProps->setPropertyValue(UNO_NAME_SHOW_SPACES, aFalseSet);
264  xViewProps->setPropertyValue(UNO_NAME_SHOW_TABLES, aTrueSet);
265  xViewProps->setPropertyValue(UNO_NAME_SHOW_TABSTOPS, aFalseSet);
266  xViewProps->setPropertyValue(UNO_NAME_SHOW_VERT_RULER, aFalseSet);
267 
268  if(0 ==(m_nStyleFlags&EX_SHOW_ONLINE_LAYOUT))
269  {
270  uno::Any aZoom;
271  aZoom <<= sal_Int16(view::DocumentZoomType::PAGE_WIDTH_EXACT);
272  xViewProps->setPropertyValue(UNO_NAME_ZOOM_TYPE, aZoom);
273  }
274  else
275  {
276  uno::Any aZoom;
277  aZoom <<= sal_Int16(view::DocumentZoomType::BY_VALUE);
278  xViewProps->setPropertyValue(UNO_NAME_ZOOM_TYPE, aZoom);
279 
280  sal_Int16 nZoomValue = 75;
281  if(EX_SHOW_BUSINESS_CARDS == m_nStyleFlags)
282  {
283  nZoomValue = 80;
284  }
285  aZoom <<= nZoomValue;
286  xViewProps->setPropertyValue(UNO_NAME_ZOOM_VALUE, aZoom);
287  }
288 
289  // set onlinelayout property after setting the zoom
290  disableScrollBars(xViewProps, (m_nStyleFlags&EX_SHOW_ONLINE_LAYOUT) != 0);
291  m_bIsInitialized = true;
292  }
293 
294  uno::Reference< text::XTextDocument > xDoc(m_xModel, uno::UNO_QUERY);
295  uno::Reference< text::XText > xText = xDoc->getText();
296  m_xCursor = xText->createTextCursor();
297 
298  //From here, a cursor is defined, which goes through the template,
299  //and overwrites the template words where it is necessary.
300 
301  auto pCursor = comphelper::getFromUnoTunnel<OTextCursorHelper>(m_xCursor);
302 
303  SwDoc *pDoc = pCursor ? pCursor->GetDoc() : nullptr;
304  if (pDoc && (m_nStyleFlags & EX_LOCALIZE_TOC_STRINGS))
305  {
306  SwEditShell* pSh = pDoc->GetEditShell();
307 
308  do
309  {
310  if (pSh->GetCurWord() == "HEADING1")
311  {
312  pSh->Overwrite(SwResId(STR_IDXEXAMPLE_IDXTXT_HEADING1));
313  }
314  else if (pSh->GetCurWord() == "ENTRY1")
315  {
316  pSh->Overwrite(SwResId(STR_IDXEXAMPLE_IDXTXT_ENTRY1));
317  }
318  else if (pSh->GetCurWord() == "HEADING11")
319  {
320  pSh->Overwrite(SwResId(STR_IDXEXAMPLE_IDXTXT_HEADING11));
321  }
322  else if (pSh->GetCurWord() == "ENTRY11")
323  {
324  pSh->Overwrite(SwResId(STR_IDXEXAMPLE_IDXTXT_ENTRY11));
325  }
326  else if (pSh->GetCurWord() == "HEADING12")
327  {
328  pSh->Overwrite(SwResId(STR_IDXEXAMPLE_IDXTXT_HEADING12));
329  }
330  else if (pSh->GetCurWord() == "ENTRY12")
331  {
332  pSh->Overwrite(SwResId(STR_IDXEXAMPLE_IDXTXT_ENTRY12));
333  }
334  else if (pSh->GetCurWord() == "TABLE1")
335  {
336  pSh->Overwrite(SwResId(STR_IDXEXAMPLE_IDXTXT_TABLE1));
337  }
338  else if (pSh->GetCurWord() == "IMAGE1")
339  {
340  pSh->Overwrite(SwResId(STR_IDXEXAMPLE_IDXTXT_IMAGE1));
341  }
342  }
343  while(pSh->Right(sal_uInt16(1), sal_uInt16(1), true));
344 
345  TOXTypes eTypes[] = { TOX_INDEX, TOX_USER, TOX_CONTENT };
346  for (auto eType : eTypes)
347  {
348  const SwTOXType* pTOXType = pDoc->GetTOXType(eType, 0);
349  SwTOXMarks aMarks;
350  pTOXType->CollectTextMarks(aMarks);
351  for (auto pMark : aMarks)
352  {
353  if (pMark->GetAlternativeText() == "Chapter")
354  pMark->SetAlternativeText(SwResId(STR_IDXEXAMPLE_IDXMARK_CHAPTER));
355  else if (pMark->GetAlternativeText() == "Keyword")
356  pMark->SetAlternativeText(SwResId(STR_IDXEXAMPLE_IDXMARK_KEYWORD));
357  else if (pMark->GetAlternativeText() == "this")
358  pMark->SetAlternativeText(SwResId(STR_IDXEXAMPLE_IDXMARK_THIS));
359  else if (pMark->GetAlternativeText() == "User Directory Entry")
360  pMark->SetAlternativeText(SwResId(STR_IDXEXAMPLE_IDXMARK_USER_DIR_ENTRY));
361  else if (pMark->GetAlternativeText() == "Entry")
362  pMark->SetAlternativeText(SwResId(STR_IDXEXAMPLE_IDXMARK_ENTRY));
363 
364  if (pMark->GetPrimaryKey() == "Primary key")
365  pMark->SetPrimaryKey(SwResId(STR_IDXEXAMPLE_IDXMARK_PRIMARY_KEY));
366 
367  if (pMark->GetSecondaryKey() == "Secondary key")
368  pMark->SetSecondaryKey(SwResId(STR_IDXEXAMPLE_IDXMARK_SECONDARY_KEY));
369  }
370  }
371  }
372 
373  uno::Reference< beans::XPropertySet > xCursorProp(m_xCursor, uno::UNO_QUERY);
374  uno::Any aPageStyle = xCursorProp->getPropertyValue(UNO_NAME_PAGE_STYLE_NAME);
375  OUString sPageStyle;
376  aPageStyle >>= sPageStyle;
377 
378  uno::Reference< style::XStyleFamiliesSupplier > xSSupp( xDoc, uno::UNO_QUERY);
379  uno::Reference< container::XNameAccess > xStyles = xSSupp->getStyleFamilies();
380  uno::Any aPFamily = xStyles->getByName( "PageStyles" );
381  uno::Reference< container::XNameContainer > xPFamily;
382 
383  if( EX_SHOW_DEFAULT_PAGE != m_nStyleFlags
384  && (aPFamily >>= xPFamily) && !sPageStyle.isEmpty() )
385  {
386  uno::Any aPStyle = xPFamily->getByName( sPageStyle );
387  uno::Reference< style::XStyle > xPStyle;
388  aPStyle >>= xPStyle;
389  uno::Reference< beans::XPropertySet > xPProp(xPStyle, uno::UNO_QUERY);
390  uno::Any aSize = xPProp->getPropertyValue(UNO_NAME_SIZE);
391  awt::Size aPSize;
392  aSize >>= aPSize;
393  //TODO: set page width to card width
394  aPSize.Width = 10000;
395  aSize <<= aPSize;
396  xPProp->setPropertyValue(UNO_NAME_SIZE, aSize);
397 
398  uno::Any aZero; aZero <<= sal_Int32(0);
399  xPProp->setPropertyValue(UNO_NAME_LEFT_MARGIN, aZero);
400  xPProp->setPropertyValue(UNO_NAME_RIGHT_MARGIN, aZero);
401  }
402 
403  uno::Reference<awt::XWindow> xWin = xFrame->getContainerWindow();
404  Size aWinSize(GetOutputSizePixel());
405  xWin->setPosSize(0, 0, aWinSize.Width(), aWinSize.Height(), awt::PosSize::SIZE);
406 
407  // can only be done here - the SFX changes the ScrollBar values
408  disableScrollBars(xViewProps, (m_nStyleFlags&EX_SHOW_ONLINE_LAYOUT) != 0);
409 
410  m_aInitializedLink.Call(*this);
411 
412  uno::Reference< text::XTextViewCursorSupplier > xCursorSupp(m_xController, uno::UNO_QUERY);
413  uno::Reference< view::XScreenCursor > xScrCursor(xCursorSupp->getViewCursor(), uno::UNO_QUERY);
414  if(xScrCursor.is())
415  xScrCursor->screenUp();
416 
417  if (pDoc)
418  {
419  SwEditShell* pSh = pDoc->GetEditShell();
420  if( pSh->ActionCount() )
421  {
422  pSh->EndAllAction();
423  pSh->UnlockPaint();
424  }
425  }
426 
427  SW_MOD()->SetView(m_pModuleView);
428 
429  Invalidate();
430  }
431  else
432  pTimer->Start();
433 }
434 
436 {
437  uno::Reference< lang::XUnoTunnel> xTunnel( m_xCursor, uno::UNO_QUERY);
438  if( !xTunnel.is() )
439  return;
440 
441  OTextCursorHelper* pCursor = comphelper::getFromUnoTunnel<OTextCursorHelper>(xTunnel);
442  if( pCursor )
443  {
444  SwDoc* pDoc = pCursor->GetDoc();
445  SwEditShell* pSh = pDoc->GetEditShell();
446  pSh->LockPaint();
447  pSh->StartAllAction();
448  pSh->KillPams();
449  pSh->ClearMark();
450  pDoc->ClearDoc();
451  pSh->ClearUpCursors();
452 
453  if( m_aLoadedIdle.IsActive())
454  {
455  pSh->EndAllAction();
456  pSh->UnlockPaint();
457  }
459  }
460  else
461  {
462  m_xCursor->gotoStart(false);
463  m_xCursor->gotoEnd(true);
464  m_xCursor->setString(OUString());
465  }
466 }
467 
468 bool SwOneExampleFrame::CreatePopup(const Point& rPt)
469 {
471  return false;
472 
473  std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(nullptr, "modules/swriter/ui/previewmenu.ui"));
474  std::unique_ptr<weld::Menu> xPop(xBuilder->weld_menu("previewmenu"));
475 
476  uno::Reference< view::XViewSettingsSupplier > xSettings(m_xController, uno::UNO_QUERY);
477  uno::Reference< beans::XPropertySet > xViewProps = xSettings->getViewSettings();
478 
479  uno::Any aZoom = xViewProps->getPropertyValue(UNO_NAME_ZOOM_VALUE);
480  sal_Int16 nZoom = 0;
481  aZoom >>= nZoom;
482 
483  for (size_t i = 0; i < SAL_N_ELEMENTS(nZoomValues); ++i)
484  {
485  OUString sTemp = unicode::formatPercent(nZoomValues[i],
486  Application::GetSettings().GetUILanguageTag());
487  OString sIdent = "zoom" + OString::number(nZoomValues[i]);
488  xPop->set_label(sIdent, sTemp);
489  if (nZoom == nZoomValues[i])
490  xPop->set_active(sIdent, true);
491  }
492 
493  PopupHdl(xPop->popup_at_rect(GetDrawingArea(), tools::Rectangle(rPt, Size(1, 1))));
494 
495  return true;
496 }
497 
498 void SwOneExampleFrame::PopupHdl(std::string_view rId)
499 {
500  std::string_view sZoomValue;
501  if (o3tl::starts_with(rId, "zoom", &sZoomValue))
502  {
503  sal_Int16 nZoom = o3tl::toInt32(sZoomValue);
504  uno::Reference< view::XViewSettingsSupplier > xSettings(m_xController, uno::UNO_QUERY);
505  uno::Reference< beans::XPropertySet > xViewProps = xSettings->getViewSettings();
506 
507  uno::Any aZoom;
508  aZoom <<= nZoom;
509  xViewProps->setPropertyValue(UNO_NAME_ZOOM_VALUE, aZoom);
510  aZoom <<= sal_Int16(view::DocumentZoomType::BY_VALUE);
511  xViewProps->setPropertyValue(UNO_NAME_ZOOM_TYPE, aZoom);
512  }
513  Invalidate();
514 }
515 
516 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
TOXTypes
Definition: toxe.hxx:39
void KillPams()
Definition: crsrsh.cxx:1022
bool CreatePopup(const Point &rPt)
Definition: unotools.cxx:468
Reference< frame::XModel > m_xModel
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
Definition: unotools.cxx:117
IMPL_LINK(SwOneExampleFrame, TimeoutHdl, Timer *, pTimer, void)
Definition: unotools.cxx:217
virtual const SwDoc * GetDoc() const =0
void ClearDocument()
Definition: unotools.cxx:435
bool Right(sal_uInt16 nCnt, sal_uInt16 nMode, bool bAllowVisual=false)
Definition: crsrsh.hxx:356
#define UNO_NAME_ZOOM_VALUE
Definition: unoprnms.hxx:424
#define EX_SHOW_DEFAULT_PAGE
Definition: unotools.hxx:37
SwDocShell * GetDocShell()
Definition: doc.hxx:1351
virtual ~SwOneExampleFrame() override
Definition: unotools.cxx:179
#define UNO_NAME_ZOOM_TYPE
Definition: unoprnms.hxx:425
std::vector< SwTOXMark * > SwTOXMarks
Definition: tox.hxx:44
Reference< XFrame > xFrame
static const AllSettings & GetSettings()
void CollectTextMarks(SwTOXMarks &rMarks) const
Definition: tox.hxx:182
Definition: doc.hxx:187
tuple args
#define UNO_NAME_SHOW_VERT_SCROLL_BAR
Definition: unoprnms.hxx:217
#define UNO_NAME_SHOW_HORI_SCROLL_BAR
Definition: unoprnms.hxx:218
css::uno::Reference< css::frame::XModel > m_xModel
Definition: unotools.hxx:46
void EndAllAction()
Definition: edws.cxx:97
Size const & GetOutputSizePixel() const
constexpr bool starts_with(std::basic_string_view< charT, traits > sv, std::basic_string_view< charT, traits > x) noexcept
constexpr OUStringLiteral cFactory
Definition: unotools.cxx:62
bool IsActive() const
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:164
constexpr tools::Long Width() const
#define UNO_NAME_SHOW_VERT_RULER
Definition: unoprnms.hxx:213
#define UNO_NAME_SIZE
Definition: unoprnms.hxx:306
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: unotools.cxx:144
static void disableScrollBars(uno::Reference< beans::XPropertySet > const &xViewProps, bool bEnableOnlineMode)
Definition: unotools.cxx:64
void PopupHdl(std::string_view rId)
Definition: unotools.cxx:498
css::uno::Sequence< css::beans::PropertyValue > InitPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
const sal_Int16 nZoomValues[]
Definition: unotools.cxx:89
css::uno::Reference< css::text::XTextCursor > m_xCursor
Definition: unotools.hxx:48
OUString m_sArgumentURL
Definition: unotools.hxx:53
#define EX_SHOW_BUSINESS_CARDS
Definition: unotools.hxx:35
#define SAL_N_ELEMENTS(arr)
DocumentType eType
#define UNO_NAME_HIDE_WHITESPACE
Definition: unoprnms.hxx:222
#define UNO_NAME_SHOW_SOFT_HYPHENS
Definition: unoprnms.hxx:216
sal_uInt32 m_nStyleFlags
Definition: unotools.hxx:57
#define SW_MOD()
Definition: swmodule.hxx:255
int i
SwEditShell const * GetEditShell() const
Definition: doccorr.cxx:328
#define UNO_NAME_SHOW_DRAWINGS
Definition: unoprnms.hxx:211
sal_uInt16 ActionCount() const
Definition: viewsh.hxx:195
#define UNO_NAME_SHOW_TABLES
Definition: unoprnms.hxx:208
CommandEventId GetCommand() const
float u
#define UNO_NAME_SHOW_PARA_BREAKS
Definition: unoprnms.hxx:214
void ClearUpCursors()
Definition: crsrsh.cxx:3611
void LockPaint()
Definition: viewsh.hxx:607
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
#define EX_LOCALIZE_TOC_STRINGS
Definition: unotools.hxx:39
#define ASPECT_CONTENT
#define UNO_NAME_SHOW_BREAKS
Definition: unoprnms.hxx:206
SAL_DLLPRIVATE void CreateControl()
Definition: unotools.cxx:184
void SetOutputSizePixel(const Size &rSize)
#define UNO_NAME_RIGHT_MARGIN
Definition: unoprnms.hxx:69
#define UNO_NAME_SHOW_SPACES
Definition: unoprnms.hxx:207
#define UNO_NAME_SHOW_FIELD_COMMANDS
Definition: unoprnms.hxx:219
virtual bool Command(const CommandEvent &rCEvt) override
Definition: unotools.cxx:127
SAL_DLLPRIVATE void DisposeControl()
Definition: unotools.cxx:205
const Point & GetMousePosPixel() const
css::uno::Reference< css::frame::XController > m_xController
Definition: unotools.hxx:47
OUString GetCurWord() const
request current word
Definition: editsh.cxx:410
Link< SwOneExampleFrame &, void > m_aInitializedLink
Definition: unotools.hxx:51
weld::DrawingArea * GetDrawingArea() const
static OUString formatPercent(double dNumber, const LanguageTag &rLangTag)
void Stop()
SwOneExampleFrame(sal_uInt32 nStyleFlags, const Link< SwOneExampleFrame &, void > *pInitializedLink, const OUString *pURL=nullptr)
Definition: unotools.cxx:98
#define UNO_NAME_LEFT_MARGIN
Definition: unoprnms.hxx:68
constexpr tools::Long Height() const
void ClearDoc()
Definition: docnew.cxx:644
#define UNO_NAME_SHOW_HORI_RULER
Definition: unoprnms.hxx:305
void DoDraw(OutputDevice *, const Point &rObjPos, const Size &rSize, const JobSetup &rSetup, sal_uInt16 nAspect=ASPECT_CONTENT)
static VclPtr< reference_type > Create(Arg &&...arg)
Reference< XComponentContext > getProcessComponentContext()
void SetInvokeHandler(const Link< Timer *, void > &rLink)
virtual void SetVisArea(const tools::Rectangle &rRect) override
OLE-stuff.
Definition: docsh.cxx:890
void ClearMark()
Definition: crsrsh.cxx:939
virtual void Start(bool bStartTimer=true) override
void Overwrite(const OUString &)
Definition: editsh.cxx:169
VirtualDevice * get() const
#define UNO_NAME_SHOW_HIDDEN_TEXT
Definition: unoprnms.hxx:215
void SetPriority(TaskPriority ePriority)
#define UNO_NAME_SHOW_ONLINE_LAYOUT
Definition: unoprnms.hxx:461
virtual void set_size_request(int nWidth, int nHeight)=0
void StartAllAction()
For all views of this document.
Definition: edws.cxx:86
#define UNO_NAME_SHOW_PROTECTED_SPACES
Definition: unoprnms.hxx:220
#define EX_SHOW_ONLINE_LAYOUT
Definition: unotools.hxx:33
#define UNO_NAME_PAGE_STYLE_NAME
Definition: unoprnms.hxx:171
#define UNO_NAME_SHOW_TABSTOPS
Definition: unoprnms.hxx:212
SAL_DLLPRIVATE void DrawOutDev(const Point &, const Size &, const Point &, const Size &, const Printer &)=delete
static std::unique_ptr< weld::Builder > CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false, sal_uInt64 nLOKWindowId=0)
void UnlockPaint(bool bVirDev=false)
Definition: viewsh.hxx:612
ScopedVclPtr< VirtualDevice > m_xVirDev
Definition: unotools.hxx:45
#define UNO_NAME_SHOW_HIDDEN_PARAGRAPHS
Definition: unoprnms.hxx:221
bool m_bDetectedRangeSegmentation false
#define UNO_NAME_SHOW_GRAPHICS
Definition: unoprnms.hxx:209