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