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