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/jobset.hxx>
29 #include <vcl/settings.hxx>
30 #include <vcl/svapp.hxx>
31 #include <vcl/virdev.hxx>
32 #include <vcl/weld.hxx>
33 #include <com/sun/star/frame/Desktop.hpp>
34 #include <com/sun/star/text/XTextViewCursorSupplier.hpp>
35 #include <com/sun/star/view/XScreenCursor.hpp>
36 #include <com/sun/star/view/DocumentZoomType.hpp>
37 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
38 #include <com/sun/star/style/XStyle.hpp>
39 #include <com/sun/star/text/XTextDocument.hpp>
40 #include <com/sun/star/awt/Toolkit.hpp>
41 #include <com/sun/star/awt/PosSize.hpp>
42 #include <com/sun/star/view/XViewSettingsSupplier.hpp>
43 #include <com/sun/star/container/XNameContainer.hpp>
44 #include <com/sun/star/frame/XLayoutManager.hpp>
45 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
48 #include <sfx2/dispatch.hxx>
49 #include <svl/stritem.hxx>
50 #include <shellio.hxx>
51 #include <docsh.hxx>
52 #include <view.hxx>
53 #include <wrtsh.hxx>
54 #include <swmodule.hxx>
55 #include <TextCursorHelper.hxx>
56 #include <unocrsr.hxx>
57 #include <doc.hxx>
58 
59 #include <unomid.h>
60 
61 using namespace ::com::sun::star;
62 
63 const sal_Char cFactory[] = "private:factory/swriter";
64 
65 static void disableScrollBars(uno::Reference< beans::XPropertySet > const & xViewProps,
66  bool bEnableOnlineMode)
67 {
68  //the scrollbar logic is kind of busted looking in writer, when the hori scrollbar
69  //property is changed then the hori scrollbar is enabled if the property is
70  //true or browse (online) mode is enabled. So...
71  //disable online mode
72  //turn off scrollbars
73  //turn back on online mode if that's what we want
74  //which subverts the (dodgy/buggy) scrollbar setting
75 
76  //To reproduce this problem, in edit->autotext and click through
77  //the examples and see if the preview gets a horizontal scrollbar
78  uno::Any aFalseSet(uno::makeAny(false));
79  xViewProps->setPropertyValue(UNO_NAME_SHOW_ONLINE_LAYOUT, aFalseSet);
80 
81  xViewProps->setPropertyValue(UNO_NAME_SHOW_HORI_SCROLL_BAR, aFalseSet);
82  xViewProps->setPropertyValue(UNO_NAME_SHOW_VERT_SCROLL_BAR, aFalseSet);
83 
84  if (bEnableOnlineMode)
85  {
86  xViewProps->setPropertyValue(UNO_NAME_SHOW_ONLINE_LAYOUT, uno::makeAny(true));
87  }
88 }
89 
90 static const sal_Int16 nZoomValues[] =
91 {
92  20,
93  40,
94  50,
95  75,
96  100
97 };
98 
100  const Link<SwOneExampleFrame&,void>* pInitializedLink,
101  const OUString* pURL)
102  : m_aLoadedIdle("sw uibase SwOneExampleFrame Loaded")
103  , m_pModuleView(SW_MOD()->GetView())
104  , m_nStyleFlags(nFlags)
105  , m_bIsInitialized(false)
106 {
107  if (pURL && !pURL->isEmpty())
108  m_sArgumentURL = *pURL;
109 
110  if( pInitializedLink )
111  m_aInitializedLink = *pInitializedLink;
112 
113  // the controller is asynchronously set
115  m_aLoadedIdle.SetPriority(TaskPriority::HIGH_IDLE);
116 }
117 
119 {
120  CustomWidgetController::SetDrawingArea(pDrawingArea);
122  Size aSize(m_xVirDev->LogicToPixel(Size(150, 188), MapMode(MapUnit::MapAppFont)));
123  pDrawingArea->set_size_request(aSize.Width(), aSize.Height());
124  SetOutputSizePixel(aSize);
125  CreateControl();
126 }
127 
129 {
130  switch (rCEvt.GetCommand())
131  {
132  case CommandEventId::ContextMenu:
133  {
134  //#125881# quickly clicking crashes because the control is not fully initialized
135  if (GetController().is())
136  return CreatePopup(rCEvt.GetMousePosPixel());
137  }
138  break;
139  default:;
140  break;
141  }
142  return false;
143 }
144 
146 {
147  Size aSize(GetOutputSizePixel());
148  // m_xVirDev instead of rRenderContext just to avoid overlays in writer re-triggering
149  // invalidate on rRenderContext if it is a vcl::Window, which is the "classic" gen mode
150  m_xVirDev->SetOutputSizePixel(aSize);
151 
152  Color aBgColor = SW_MOD()->GetColorConfig().GetColorValue(::svtools::DOCCOLOR).nColor;
153  m_xVirDev->DrawWallpaper(tools::Rectangle(Point(), aSize), aBgColor);
154 
155  OTextCursorHelper* pCursor = nullptr;
156  uno::Reference<lang::XUnoTunnel> xTunnel(m_xCursor, uno::UNO_QUERY);
157  if (xTunnel.is())
158  {
159  pCursor = reinterpret_cast<OTextCursorHelper*>(xTunnel->getSomething(
161  }
162 
163  if (pCursor)
164  {
165  uno::Reference<view::XViewSettingsSupplier> xSettings(m_xController, uno::UNO_QUERY);
166  uno::Reference<beans::XPropertySet> xViewProps = xSettings->getViewSettings();
167  uno::Any aZoom = xViewProps->getPropertyValue(UNO_NAME_ZOOM_VALUE);
168  sal_Int16 nZoom = 100;
169  aZoom >>= nZoom;
170 
171  double fZoom = 100.0 / nZoom;
172 
173  m_xVirDev->Push(PushFlags::ALL);
174  m_xVirDev->SetMapMode(MapMode(MapUnit::MapTwip));
175  SwDoc *pDoc = pCursor->GetDoc();
176  SwDocShell* pShell = pDoc->GetDocShell();
177  tools::Rectangle aRect(Point(), m_xVirDev->PixelToLogic(aSize));
178  pShell->SetVisArea(tools::Rectangle(Point(), Size(aRect.GetWidth() * fZoom,
179  aRect.GetHeight() * fZoom)));
180  pShell->DoDraw(m_xVirDev.get(), aRect.TopLeft(), aRect.GetSize(), JobSetup(), ASPECT_CONTENT);
181  m_xVirDev->Pop();
182  }
183 
184  rRenderContext.DrawOutDev(Point(), aSize, Point(), aSize, *m_xVirDev);
185 }
186 
188 {
189  DisposeControl();
190 }
191 
193 {
194  // create new doc
195  OUString sTempURL(cFactory);
196  if(!m_sArgumentURL.isEmpty())
197  sTempURL = m_sArgumentURL;
198 
199  uno::Reference<frame::XDesktop2> xDesktop = frame::Desktop::create(::comphelper::getProcessComponentContext());
200  uno::Reference<frame::XComponentLoader> xLoader(xDesktop, uno::UNO_QUERY);
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(xLoader->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(), uno::UNO_QUERY);
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:1010
bool CreatePopup(const Point &rPt)
Definition: unotools.cxx:457
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
Definition: unotools.cxx:118
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:63
bool Right(sal_uInt16 nCnt, sal_uInt16 nMode, bool bAllowVisual=false)
Definition: crsrsh.hxx:353
#define UNO_NAME_ZOOM_VALUE
Definition: unoprnms.hxx:427
#define EX_SHOW_DEFAULT_PAGE
Definition: unotools.hxx:40
SwDocShell * GetDocShell()
Definition: doc.hxx:1340
long Height() const
virtual ~SwOneExampleFrame() override
Definition: unotools.cxx:187
#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:99
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:47
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:145
static void disableScrollBars(uno::Reference< beans::XPropertySet > const &xViewProps, bool bEnableOnlineMode)
Definition: unotools.cxx:65
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:90
css::uno::Reference< css::text::XTextCursor > m_xCursor
Definition: unotools.hxx:49
OUString m_sArgumentURL
Definition: unotools.hxx:54
#define EX_SHOW_BUSINESS_CARDS
Definition: unotools.hxx:38
#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:255
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:3457
virtual bool ContextMenu(const CommandEvent &rCEvt) override
Definition: unotools.cxx:128
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:192
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:48
Link< SwOneExampleFrame &, void > m_aInitializedLink
Definition: unotools.hxx:52
sal_uInt32 const m_nStyleFlags
Definition: unotools.hxx:58
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:78
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:927
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:35
#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:46
#define UNO_NAME_SHOW_HIDDEN_PARAGRAPHS
Definition: unoprnms.hxx:221
#define UNO_NAME_SHOW_GRAPHICS
Definition: unoprnms.hxx:209