LibreOffice Module sw (master) 1
navipi.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 <comphelper/string.hxx>
21#include <svl/urlbmk.hxx>
22#include <svl/stritem.hxx>
23#include <vcl/graphicfilter.hxx>
24#include <sot/formats.hxx>
25#include <sot/filelist.hxx>
26#include <sfx2/event.hxx>
27#include <sfx2/dispatch.hxx>
28#include <sfx2/viewfrm.hxx>
29#include <tools/urlobj.hxx>
30#include <osl/diagnose.h>
31#include <swtypes.hxx>
32#include <swmodule.hxx>
33#include <view.hxx>
34#include <navicfg.hxx>
35#include <wrtsh.hxx>
36#include <docsh.hxx>
37#include <navipi.hxx>
38#include <edtwin.hxx>
39#include <sfx2/app.hxx>
40#include <cmdid.h>
41#include <helpids.h>
42
43#include <strings.hrc>
44#include <bitmaps.hlst>
45
46#include <memory>
47
48#include <o3tl/enumrange.hxx>
49
50#include <workctrl.hxx>
51
52#include <comphelper/lok.hxx>
53
54using namespace ::com::sun::star::uno;
55using namespace ::com::sun::star::frame;
56
57// Filter the control characters out of the Outline-Entry
58OUString SwNavigationPI::CleanEntry(const OUString& rEntry)
59{
60 if (rEntry.isEmpty())
61 return rEntry;
62
63 OUStringBuffer aEntry(rEntry);
64 for (sal_Int32 i = 0; i < rEntry.getLength(); ++i)
65 if(aEntry[i] == 10 || aEntry[i] == 9)
66 aEntry[i] = 0x20;
67
68 return aEntry.makeStringAndClear();
69}
70
71// Execution of the drag operation with and without the children.
72
74{
75 SwView *pView = GetCreateView();
76 SwWrtShell &rSh = pView->GetWrtShell();
77 if(nTarget < nSource || nTarget == SwOutlineNodes::npos)
78 nTarget ++;
79 if ( !rSh.IsOutlineMovable( nSource ))
80 return;
81
82 SwOutlineNodes::difference_type nMove = nTarget-nSource; //( nDir<0 ) ? 1 : 0 ;
83 rSh.GotoOutline(nSource);
84 rSh.MakeOutlineSel(nSource, nSource, true);
85 // While moving, the selected children does not counting.
86 const SwOutlineNodes::size_type nLastOutlinePos = rSh.GetOutlinePos(MAXLEVEL);
87 if(nMove > 1 && nLastOutlinePos < nTarget)
88 {
89 if(!rSh.IsCursorPtAtEnd())
90 rSh.SwapPam();
91 nMove -= nLastOutlinePos - nSource;
92 }
93 if( nMove < 1 || nLastOutlinePos < nTarget )
94 rSh.MoveOutlinePara( nMove );
95 rSh.ClearMark();
96 rSh.GotoOutline( nSource + nMove);
97
98}
99
100// After goto cancel the status frame selection
102{
103 if (pSh->IsFrameSelected())
104 {
105 pSh->UnSelectFrame();
106 pSh->LeaveSelFrameMode();
107 }
108}
109
110// Select the document view
111IMPL_LINK(SwNavigationPI, DocListBoxSelectHdl, weld::ComboBox&, rBox, void)
112{
113 int nEntryIdx = rBox.get_active();
114 SwView *pView ;
115 pView = SwModule::GetFirstView();
116 while (nEntryIdx-- && pView)
117 {
118 pView = SwModule::GetNextView(pView);
119 }
120 if(!pView)
121 {
122 nEntryIdx == 0 ?
123 m_xContentTree->ShowHiddenShell():
124 m_xContentTree->ShowActualView();
125
126 }
127 else
128 {
129 m_xContentTree->SetConstantShell(pView->GetWrtShellPtr());
130 }
131}
132
134{
136 const SfxPoolItem* aArgs[2];
137 aArgs[0] = &aParam;
138 aArgs[1] = nullptr;
139 SfxDispatcher* pDispatcher = GetCreateView()->GetFrame()->GetDispatcher();
140 pDispatcher->Execute(FN_NAV_ELEMENT, SfxCallMode::SYNCHRON, aArgs);
141}
142
143IMPL_LINK(SwNavigationPI, NavigateByComboBoxSelectHdl, weld::ComboBox&, rComboBox, void)
144{
145 m_xContentTree->SelectContentType(rComboBox.get_active_text());
146 UpdateNavigateBy();
147}
148
149// Filling of the list box for outline view or documents
150// The PI will be set to full size
152{
154 {
155 m_xContentTree->SetHiddenShell( m_pContentWrtShell );
156 m_xContentTree->Display( false );
157 }
158 else
159 {
160 SwView *pView = GetCreateView();
161 if(!pView)
162 {
163 m_xContentTree->SetActiveShell(nullptr);
164 }
165 else if( pView != m_pActContView)
166 {
167 SwWrtShell* pWrtShell = pView->GetWrtShellPtr();
168 m_xContentTree->SetActiveShell(pWrtShell);
169 }
170 else
171 m_xContentTree->Display( true );
172 m_pActContView = pView;
173 if (m_pActContView)
174 m_xContentTree->UpdateTracking();
175 }
176}
177
179{
180 SwView *pView = GetCreateView();
181 SwWrtShell *pSh = pView ? &pView->GetWrtShell() : nullptr;
182 m_xEdit->set_value(1);
183 if (pSh)
184 {
185 const sal_uInt16 nPageCnt = pSh->GetPageCnt();
186 sal_uInt16 nPhyPage, nVirPage;
187 pSh->GetPageNum(nPhyPage, nVirPage);
188
189 m_xEdit->set_max(nPageCnt);
190 m_xEdit->set_width_chars(3);
191 m_xEdit->set_value(nPhyPage);
192 }
193}
194
195// Select handler of the toolboxes
196IMPL_LINK(SwNavigationPI, ToolBoxSelectHdl, const OUString&, rCommand, void)
197{
198 SwView *pView = GetCreateView();
199 if (!pView)
200 return;
201 SwWrtShell &rSh = pView->GetWrtShell();
202 // Get MouseModifier for Outline-Move
203
204 int nFuncId = 0;
205 bool bFocusToDoc = false;
206 if (rCommand == ".uno:ScrollToPrevious" || rCommand == ".uno:ScrollToNext")
207 {
208 bool *pbNext = new bool(true);
209 if (rCommand == ".uno:ScrollToPrevious")
210 *pbNext = false;
211 pView->MoveNavigationHdl(pbNext);
212 }
213 else if (rCommand == "root")
214 {
215 m_xContentTree->ToggleToRoot();
216 }
217 else if (rCommand == "listbox")
218 {
219 if (ParentIsFloatingWindow(m_xNavigatorDlg))
220 {
221 if (IsZoomedIn())
222 {
223 ZoomOut();
224 }
225 else
226 {
227 ZoomIn();
228 }
229 }
230 return;
231 }
232 // Functions that will trigger a direct action.
233 else if (rCommand == "footer")
234 {
235 rSh.MoveCursor();
236 const FrameTypeFlags eType = rSh.GetFrameType(nullptr,false);
238 {
239 if (rSh.EndPg())
240 nFuncId = FN_END_OF_PAGE;
241 }
242 else if (rSh.GotoFooterText())
243 nFuncId = FN_TO_FOOTER;
244 bFocusToDoc = true;
245 }
246 else if (rCommand == "header")
247 {
248 rSh.MoveCursor();
249 const FrameTypeFlags eType = rSh.GetFrameType(nullptr,false);
251 {
252 if (rSh.SttPg())
253 nFuncId = FN_START_OF_PAGE;
254 }
255 else if (rSh.GotoHeaderText())
256 nFuncId = FN_TO_HEADER;
257 bFocusToDoc = true;
258 }
259 else if (rCommand == "anchor")
260 {
261 rSh.MoveCursor();
262 const FrameTypeFlags eFrameType = rSh.GetFrameType(nullptr,false);
263 // Jump from the footnote to the anchor.
264 if (eFrameType & FrameTypeFlags::FOOTNOTE)
265 {
266 if (rSh.GotoFootnoteAnchor())
267 nFuncId = FN_FOOTNOTE_TO_ANCHOR;
268 }
269 // Otherwise, jump to the first footnote text;
270 // go to the next footnote if this is not possible;
271 // if this is also not possible got to the footnote before.
272 else
273 {
274 if (rSh.GotoFootnoteText())
275 nFuncId = FN_FOOTNOTE_TO_ANCHOR;
276 else if (rSh.GotoNextFootnoteAnchor())
277 nFuncId = FN_NEXT_FOOTNOTE;
278 else if (rSh.GotoPrevFootnoteAnchor())
279 nFuncId = FN_PREV_FOOTNOTE;
280 }
281 bFocusToDoc = true;
282 }
283 else if (rCommand == "reminder")
284 {
285 rSh.GetView().GetViewFrame().GetDispatcher()->Execute(FN_SET_REMINDER, SfxCallMode::ASYNCHRON);
286 }
287 else if (rCommand == "chapterdown" ||
288 rCommand == "movedown" ||
289 rCommand == "chapterup" ||
290 rCommand == "moveup" ||
291 rCommand == "promote" ||
292 rCommand == "demote" ||
293 rCommand == "edit")
294 {
295 if (IsGlobalMode())
296 m_xGlobalTree->ExecCommand(rCommand);
297 else
298 {
299 // Standard: sublevels are taken
300 // do not take sublevels with Ctrl
301 bool bOutlineWithChildren = (KEY_MOD1 != m_xContent6ToolBox->get_modifier_state());
302 m_xContentTree->ExecCommand(rCommand, bOutlineWithChildren);
303 }
304 }
305 else if (rCommand == "contenttoggle" || rCommand == "globaltoggle")
306 {
307 ToggleTree();
308 bool bGlobalMode = IsGlobalMode();
309 m_pConfig->SetGlobalActive(bGlobalMode);
310 m_xGlobalToolBox->set_item_active("globaltoggle", bGlobalMode);
311 m_xContent1ToolBox->set_item_active("contenttoggle", bGlobalMode);
312 }
313 else if (rCommand == "save")
314 {
315 bool bSave = rSh.IsGlblDocSaveLinks();
316 rSh.SetGlblDocSaveLinks( !bSave );
317 m_xGlobalToolBox->set_item_active(rCommand, !bSave);
318 }
319 else if (rCommand == "dragmode")
320 m_xContent6ToolBox->set_menu_item_active("dragmode", !m_xContent6ToolBox->get_menu_item_active("dragmode"));
321 else if (rCommand == "headings")
322 m_xContent5ToolBox->set_menu_item_active("headings", !m_xContent5ToolBox->get_menu_item_active("headings"));
323 else if (rCommand == "update")
324 m_xGlobalToolBox->set_menu_item_active("update", !m_xGlobalToolBox->get_menu_item_active("update"));
325 else if (rCommand == "insert")
326 m_xGlobalToolBox->set_menu_item_active("insert", !m_xGlobalToolBox->get_menu_item_active("insert"));
327
328 if (nFuncId)
329 lcl_UnSelectFrame(&rSh);
330 if (bFocusToDoc)
331 pView->GetEditWin().GrabFocus();
332}
333
334// Click handler of the toolboxes
335IMPL_LINK(SwNavigationPI, ToolBoxClickHdl, const OUString&, rCommand, void)
336{
337 if (!m_xGlobalToolBox->get_menu_item_active(rCommand))
338 return;
339
340 if (rCommand == "update")
341 m_xGlobalTree->TbxMenuHdl(rCommand, *m_xUpdateMenu);
342 else if (rCommand == "insert")
343 m_xGlobalTree->TbxMenuHdl(rCommand, *m_xInsertMenu);
344}
345
346IMPL_LINK(SwNavigationPI, ToolBox6DropdownClickHdl, const OUString&, rCommand, void)
347{
348 if (!m_xContent6ToolBox->get_menu_item_active(rCommand))
349 return;
350
351 if (rCommand != "dragmode")
352 return;
353
354 switch (m_nRegionMode)
355 {
356 case RegionMode::NONE:
357 m_xDragModeMenu->set_active("hyperlink", true);
358 break;
359 case RegionMode::LINK:
360 m_xDragModeMenu->set_active("link", true);
361 break;
362 case RegionMode::EMBEDDED:
363 m_xDragModeMenu->set_active("copy", true);
364 break;
365 }
366}
367
368IMPL_LINK(SwNavigationPI, DropModeMenuSelectHdl, const OUString&, rIdent, void)
369{
370 if (rIdent == "hyperlink")
371 SetRegionDropMode(RegionMode::NONE);
372 else if (rIdent == "link")
373 SetRegionDropMode(RegionMode::LINK);
374 else if (rIdent == "copy")
375 SetRegionDropMode(RegionMode::EMBEDDED);
376}
377
378IMPL_LINK(SwNavigationPI, GlobalMenuSelectHdl, const OUString&, rIdent, void)
379{
380 m_xGlobalTree->ExecuteContextMenuAction(rIdent);
381}
382
383IMPL_LINK(SwNavigationPI, ToolBox5DropdownClickHdl, const OUString&, rCommand, void)
384{
385 if (!m_xContent5ToolBox->get_menu_item_active(rCommand))
386 return;
387
388 if (rCommand == "headings")
389 m_xHeadingsMenu->set_active(OUString::number(m_xContentTree->GetOutlineLevel()), true);
390}
391
392// Action-Handler Edit:
393// Switches to the page if the structure view is not turned on.
395{
396 SwView *pView = GetCreateView();
397 if (!pView)
398 return false;
399
402
403 // if the user has clicked into the document, forget about changing the page
404 if (pView->GetEditWin().HasFocus())
405 return false;
406
407 if (m_xEdit->get_text().isEmpty())
408 return false;
409 sal_Int64 nNewPage = m_xEdit->get_text().toInt32();
411 sal_Int64 max = rSh.GetPageCnt();
412 if (nNewPage <= 0)
413 nNewPage = 1;
414 else if (nNewPage > max)
415 nNewPage = max;
416 m_xEdit->set_value(nNewPage);
417 m_xEdit->set_position(-1);
418
419 rSh.GotoPage(nNewPage, true);
421
422 return true;
423}
424
426{
427 if (!IsZoomedIn())
428 return;
430 if (!pNav)
431 return;
432 m_bIsZoomedIn = false;
433 FillBox();
434 if (IsGlobalMode())
435 {
436 m_xGlobalBox->show();
437 m_xGlobalTree->ShowTree();
438 }
439 else
440 {
441 m_xContentBox->show();
442 m_xContentTree->ShowTree();
443 m_xDocListBox->show();
444 }
445
446 pNav->InvalidateChildSizeCache();
447 Size aOptimalSize(pNav->GetOptimalSize());
448 Size aNewSize(pNav->GetOutputSizePixel());
449 aNewSize.setHeight( m_aExpandedSize.Height() );
450 pNav->SetMinOutputSizePixel(aOptimalSize);
451 pNav->SetOutputSizePixel(aNewSize);
452
453 m_xContentTree->Select(); // Enable toolbox
454 m_pConfig->SetSmall(false);
455 m_xContent6ToolBox->set_item_active("listbox", true);
456}
457
459{
460 if (IsZoomedIn())
461 return;
463 if (!pNav)
464 return;
465
466 m_aExpandedSize = m_xNavigatorDlg->GetSizePixel();
467
468 m_xContentBox->hide();
469 m_xContentTree->HideTree();
470 m_xGlobalBox->hide();
471 m_xGlobalTree->HideTree();
472 m_xDocListBox->hide();
473 m_bIsZoomedIn = true;
474
475 pNav->InvalidateChildSizeCache();
476 Size aOptimalSize(pNav->GetOptimalSize());
477 Size aNewSize(pNav->GetOutputSizePixel());
478 aNewSize.setHeight( aOptimalSize.Height() );
479 pNav->SetMinOutputSizePixel(aOptimalSize);
480 pNav->SetOutputSizePixel(aNewSize);
481
482 m_xContentTree->Select(); // Enable toolbox
483
484 m_pConfig->SetSmall(true);
485 m_xContent6ToolBox->set_item_active("listbox", false);
486}
487
488namespace {
489
490enum StatusIndex
491{
492 IDX_STR_HIDDEN = 0,
493 IDX_STR_ACTIVE = 1,
494 IDX_STR_INACTIVE = 2
495};
496
497}
498
499std::unique_ptr<PanelLayout> SwNavigationPI::Create(weld::Widget* pParent,
500 const css::uno::Reference<css::frame::XFrame>& rxFrame,
501 SfxBindings* pBindings)
502{
503 if( pParent == nullptr )
504 throw css::lang::IllegalArgumentException("no parent window given to SwNavigationPI::Create", nullptr, 0);
505 if( !rxFrame.is() )
506 throw css::lang::IllegalArgumentException("no XFrame given to SwNavigationPI::Create", nullptr, 0);
507 if( pBindings == nullptr )
508 throw css::lang::IllegalArgumentException("no SfxBindings given to SwNavigationPI::Create", nullptr, 0);
509 return std::make_unique<SwNavigationPI>(pParent, rxFrame, pBindings, nullptr);
510}
511
513{
514 SwView* pView = GetCreateView();
515 if (!pView)
516 return;
517 if (m_xEdit->get_text().isEmpty())
518 return;
519 sal_Int64 page_value = m_xEdit->get_text().toInt32();
520 SwWrtShell& rSh = m_pCreateView->GetWrtShell();
521 sal_Int64 max = rSh.GetPageCnt();
522 if (page_value <= 0)
523 m_xEdit->set_value(1);
524 else if (page_value > max)
525 m_xEdit->set_value(max);
526 else
527 m_xEdit->set_value(page_value);
528 m_xEdit->set_position(-1);
529}
530
532 const css::uno::Reference<css::frame::XFrame>& rxFrame,
533 SfxBindings* _pBindings, SfxNavigator* pNavigatorDlg)
534 : PanelLayout(pParent, "NavigatorPanel", "modules/swriter/ui/navigatorpanel.ui")
535 , m_aDocFullName(SID_DOCFULLNAME, *_pBindings, *this)
536 , m_aPageStats(FN_STAT_PAGE, *_pBindings, *this)
537 , m_xContent1ToolBox(m_xBuilder->weld_toolbar("content1"))
538 , m_xContent2ToolBox(m_xBuilder->weld_toolbar("content2"))
539 , m_xContent3ToolBox(m_xBuilder->weld_toolbar("content3"))
540 , m_xContent4ToolBox(m_xBuilder->weld_toolbar("content4"))
541 , m_xContent5ToolBox(m_xBuilder->weld_toolbar("content5"))
542 , m_xContent6ToolBox(m_xBuilder->weld_toolbar("content6"))
543 , m_xContent2Dispatch(new ToolbarUnoDispatcher(*m_xContent2ToolBox, *m_xBuilder, rxFrame))
544 , m_xContent3Dispatch(new ToolbarUnoDispatcher(*m_xContent3ToolBox, *m_xBuilder, rxFrame))
545 , m_xHeadingsMenu(m_xBuilder->weld_menu("headingsmenu"))
546 , m_xDragModeMenu(m_xBuilder->weld_menu("dragmodemenu"))
547 , m_xUpdateMenu(m_xBuilder->weld_menu("updatemenu"))
548 , m_xInsertMenu(m_xBuilder->weld_menu("insertmenu"))
549 , m_xGlobalToolBox(m_xBuilder->weld_toolbar("global"))
550 , m_xEdit(m_xBuilder->weld_spin_button("spinbutton"))
551 , m_xContentBox(m_xBuilder->weld_widget("contentbox"))
552 , m_xContentTree(new SwContentTree(m_xBuilder->weld_tree_view("contenttree"), this))
553 , m_xGlobalBox(m_xBuilder->weld_widget("globalbox"))
554 , m_xGlobalTree(new SwGlobalTree(m_xBuilder->weld_tree_view("globaltree"), this))
555 , m_xDocListBox(m_xBuilder->weld_combo_box("documents"))
556 , m_aPageChgIdle("SwNavigationPI m_aPageChgIdle")
557 , m_xNavigatorDlg(pNavigatorDlg)
558 , m_pContentView(nullptr)
559 , m_pContentWrtShell(nullptr)
560 , m_pActContView(nullptr)
561 , m_pCreateView(nullptr)
562 , m_pConfig(SW_MOD()->GetNavigationConfig())
563 , m_rBindings(*_pBindings)
564 , m_nRegionMode(RegionMode::NONE)
565 , m_bIsZoomedIn(false)
566 , m_bGlobalMode(false)
567{
568 m_xContainer->connect_container_focus_changed(LINK(this, SwNavigationPI, SetFocusChildHdl));
569
570 Reference<XToolbarController> xController =
571 m_xContent2Dispatch->GetControllerForCommand(".uno:NavElement");
572 NavElementToolBoxControl* pToolBoxControl =
573 dynamic_cast<NavElementToolBoxControl*>(xController.get());
574 assert(pToolBoxControl);
575 m_pNavigateByComboBox = pToolBoxControl->GetComboBox();
576
577 // Restore content tree settings before calling UpdateInitShow. UpdateInitShow calls Fillbox,
578 // which calls Display and UpdateTracking. Incorrect outline levels could be displayed and
579 // unexpected content tracking could occur if these content tree settings are not done before.
580 m_xContentTree->SetOutlineLevel(static_cast<sal_uInt8>(m_pConfig->GetOutlineLevel()));
581 m_xContentTree->SetOutlineTracking(static_cast<sal_uInt8>(m_pConfig->GetOutlineTracking()));
583 {
584 if (eCntTypeId != ContentTypeId::OUTLINE)
585 m_xContentTree->SetContentTypeTracking(
586 eCntTypeId, m_pConfig->IsContentTypeTrack(eCntTypeId));
587 }
588
589 if (const ContentTypeId nRootType = m_pConfig->GetRootType();
590 nRootType != ContentTypeId::UNKNOWN)
591 {
592 m_xContentTree->SetRootType(nRootType);
593 m_xContent5ToolBox->set_item_active("root", true);
594 if (nRootType == ContentTypeId::OUTLINE || nRootType == ContentTypeId::DRAWOBJECT)
595 m_xContentTree->set_selection_mode(SelectionMode::Multiple);
596 else
597 m_xContentTree->set_selection_mode(SelectionMode::Single);
598 }
599 else
600 m_xContentTree->set_selection_mode(SelectionMode::Single);
601
603
605
614 m_xDocListBox->set_size_request(42, -1); // set a nominal width so it takes width of surroundings
615
616 // Insert the numeric field in the toolbox.
617 m_xEdit->set_accessible_name(m_xEdit->get_tooltip_text());
618 m_xEdit->set_width_chars(3);
619 m_xEdit->connect_activate(LINK(this, SwNavigationPI, EditActionHdl));
620 m_xEdit->connect_value_changed(LINK(this, SwNavigationPI, PageEditModifyHdl));
621 m_xEdit->connect_changed(LINK(this, SwNavigationPI, PageModifiedHdl));
622 m_xEdit->set_help_id("modules/swriter/ui/navigatorpanel/numericfield");
623
624 if (!IsGlobalDoc())
625 {
626 m_xContent1ToolBox->set_item_visible("contenttoggle", false);
627 }
628
629 const TranslateId REGIONNAME_ARY[] =
630 {
631 STR_HYPERLINK,
632 STR_LINK_REGION,
633 STR_COPY_REGION
634 };
635
636 const TranslateId REGIONMODE_ARY[] =
637 {
638 STR_HIDDEN,
639 STR_ACTIVE,
640 STR_INACTIVE
641 };
642
643 static_assert(SAL_N_ELEMENTS(REGIONNAME_ARY) == SAL_N_ELEMENTS(REGIONMODE_ARY), "### unexpected size!");
644 static_assert(SAL_N_ELEMENTS(REGIONNAME_ARY) == static_cast<sal_uInt16>(RegionMode::EMBEDDED) + 1, "### unexpected size!");
645
646 for (sal_uInt16 i = 0; i <= static_cast<sal_uInt16>(RegionMode::EMBEDDED); ++i)
647 {
648 m_aStatusArr[i] = SwResId(REGIONMODE_ARY[i]);
649 }
650
651 m_aStatusArr[3] = SwResId(STR_ACTIVE_VIEW);
652
653 bool bFloatingNavigator = ParentIsFloatingWindow(m_xNavigatorDlg);
654
656
657 m_xContentTree->ShowTree();
658 m_xContent6ToolBox->set_item_active("listbox", true);
659 m_xContent6ToolBox->set_item_sensitive("listbox", bFloatingNavigator);
660
661// TreeListBox for global document
662 m_xGlobalTree->set_selection_mode(SelectionMode::Multiple);
663
664// Handler
665 Link<const OUString&, void> aLk = LINK(this, SwNavigationPI, ToolBoxSelectHdl);
666 m_xContent1ToolBox->connect_clicked(aLk);
667 m_xContent3ToolBox->connect_clicked(aLk);
668 m_xContent5ToolBox->connect_clicked(aLk);
669 m_xContent6ToolBox->connect_clicked(aLk);
670 m_xGlobalToolBox->connect_clicked(aLk);
671 m_xDocListBox->connect_changed(LINK(this, SwNavigationPI, DocListBoxSelectHdl));
672 m_xContent5ToolBox->set_item_menu("headings", m_xHeadingsMenu.get());
673 m_xHeadingsMenu->connect_activate(LINK(this, SwNavigationPI, HeadingsMenuSelectHdl));
674 m_xContent5ToolBox->connect_menu_toggled(LINK(this, SwNavigationPI, ToolBox5DropdownClickHdl));
675 m_xContent6ToolBox->set_item_menu("dragmode", m_xDragModeMenu.get());
676 m_xDragModeMenu->connect_activate(LINK(this, SwNavigationPI, DropModeMenuSelectHdl));
677 m_xContent6ToolBox->connect_menu_toggled(LINK(this, SwNavigationPI, ToolBox6DropdownClickHdl));
678 m_xGlobalToolBox->set_item_menu("update", m_xUpdateMenu.get());
679 m_xUpdateMenu->connect_activate(LINK(this, SwNavigationPI, GlobalMenuSelectHdl));
680 m_xGlobalToolBox->set_item_menu("insert", m_xInsertMenu.get());
681 m_xInsertMenu->connect_activate(LINK(this, SwNavigationPI, GlobalMenuSelectHdl));
682 m_xGlobalToolBox->connect_menu_toggled(LINK(this, SwNavigationPI, ToolBoxClickHdl));
683 m_xGlobalToolBox->set_item_active("globaltoggle", true);
684 m_pNavigateByComboBox->connect_changed(LINK(this, SwNavigationPI, NavigateByComboBoxSelectHdl));
685
686// set toolbar of both modes to widest of each
687 m_xGlobalToolBox->set_size_request(m_xContent1ToolBox->get_preferred_size().Width() +
688 m_xContent2ToolBox->get_preferred_size().Width() +
689 m_xContent3ToolBox->get_preferred_size().Width() +
690 m_xContent4ToolBox->get_preferred_size().Width(), -1);
691
693
694 if(IsGlobalDoc())
695 {
696 SwView *pActView = GetCreateView();
697 if (pActView && pActView->GetWrtShellPtr())
698 m_xGlobalToolBox->set_item_active("save",
699 pActView->GetWrtShellPtr()->IsGlblDocSaveLinks());
701 ToggleTree();
702 if (bFloatingNavigator)
703 m_xGlobalTree->grab_focus();
704 }
705 else if (bFloatingNavigator)
706 m_xContentTree->grab_focus();
707 UsePage();
708 m_aPageChgIdle.SetInvokeHandler(LINK(this, SwNavigationPI, ChangePageHdl));
709 m_aPageChgIdle.SetPriority(TaskPriority::LOWEST);
710
711 m_xContentTree->set_accessible_name(SwResId(STR_ACCESS_TL_CONTENT));
712 m_xGlobalTree->set_accessible_name(SwResId(STR_ACCESS_TL_GLOBAL));
713 m_xDocListBox->set_accessible_name(m_aStatusArr[3]);
714
715 m_aExpandedSize = m_xContainer->get_preferred_size();
716
718 {
719 m_xBuilder->weld_container("gridcontent16")->hide();
720 m_xDocListBox->hide();
721 m_xGlobalBox->hide();
722 m_xGlobalToolBox->hide();
723 m_xGlobalTree->HideTree();
724 }
725}
726
728{
729 if (m_xNavigatorDlg)
730 return m_xNavigatorDlg->GetFrameWeld();
732}
733
735{
736 if (IsGlobalDoc() && !IsGlobalMode())
737 {
738 SwView *pView = GetCreateView();
739 SwWrtShell &rSh = pView->GetWrtShell();
740 if (!rSh.IsAllProtect())
741 pView->GetDocShell()->SetReadOnlyUI(false);
742 }
743
745
746 if (m_oObjectShell)
747 {
748 if (m_oObjectShell->Is())
749 (*m_oObjectShell)->DoClose();
750 m_oObjectShell.reset();
751 }
752
753 m_xDocListBox.reset();
754 m_xGlobalTree.reset();
755 m_xGlobalBox.reset();
756 m_xContentTree.reset();
757 m_xContentBox.reset();
758 m_xGlobalToolBox.reset();
759 m_xEdit.reset();
760 m_xHeadingsMenu.reset();
761 m_xDragModeMenu.reset();
762 m_xUpdateMenu.reset();
763 m_xInsertMenu.reset();
764 m_xContent2Dispatch.reset();
765 m_xContent3Dispatch.reset();
766 m_xContent1ToolBox.reset();
767 m_xContent2ToolBox.reset();
768 m_xContent3ToolBox.reset();
769 m_xContent4ToolBox.reset();
770 m_xContent5ToolBox.reset();
771 m_xContent6ToolBox.reset();
772
774
777}
778
779void SwNavigationPI::NotifyItemUpdate(sal_uInt16 nSID, SfxItemState /*eState*/,
780 const SfxPoolItem* /*pState*/)
781{
782 if (nSID == SID_DOCFULLNAME)
783 {
784 SwView *pActView = GetCreateView();
785 if(pActView)
786 {
787 SwWrtShell* pWrtShell = pActView->GetWrtShellPtr();
788 m_xContentTree->SetActiveShell(pWrtShell);
789 bool bGlobal = IsGlobalDoc();
790 m_xContent1ToolBox->set_item_visible("contenttoggle", bGlobal);
791 if ((!bGlobal && IsGlobalMode()) || (!IsGlobalMode() && m_pConfig->IsGlobalActive()))
792 {
793 ToggleTree();
794 }
795 if (bGlobal)
796 {
797 m_xGlobalToolBox->set_item_active("save", pWrtShell->IsGlblDocSaveLinks());
798 }
799 }
800 else
801 {
802 m_xContentTree->SetActiveShell(nullptr);
803 }
805 }
806 else if (nSID == FN_STAT_PAGE)
807 {
809 {
810 SwView *pActView = GetCreateView();
811 if(pActView)
812 {
813 SwWrtShell &rSh = pActView->GetWrtShell();
814 m_xEdit->set_max(rSh.GetPageCnt());
815 m_xEdit->set_width_chars(3);
816 }
817 }
818 }
819}
820
822{
823 // if the parent isn't a float, then the navigator is displayed in
824 // the sidebar or is otherwise docked. While the navigator could change
825 // its size, the sidebar can not, and the navigator would just waste
826 // space. Therefore disable this button.
827 bool bParentIsFloatingWindow(ParentIsFloatingWindow(m_xNavigatorDlg));
828 m_xContent6ToolBox->set_item_sensitive("listbox", bParentIsFloatingWindow);
829 // show content if docked
830 if (!bParentIsFloatingWindow && IsZoomedIn())
831 ZoomOut();
832 if (!IsZoomedIn())
833 FillBox();
834}
835
837{
838 // update documents listbox
839 UpdateListBox();
840}
841
842// Notification on modified DocInfo
844{
845 if(&rBrdc == m_pCreateView)
846 {
847 if (rHint.GetId() == SfxHintId::Dying)
848 {
850 m_pCreateView = nullptr;
851 m_xContentTree->SetActiveShell(nullptr);
852 }
853 }
854 else
855 {
856 if (const SfxEventHint* pHint = dynamic_cast<const SfxEventHint*>(&rHint))
857 {
858 SfxEventHintId eEventId = pHint->GetEventId();
859 if (eEventId == SfxEventHintId::OpenDoc)
860 {
861 SwView *pActView = GetCreateView();
862 if(pActView)
863 {
864 SwWrtShell* pWrtShell = pActView->GetWrtShellPtr();
865 m_xContentTree->SetActiveShell(pWrtShell);
866 if (m_xGlobalTree->get_visible())
867 {
868 bool bUpdateAll = m_xGlobalTree->Update(false);
869 // If no update is needed, then update the font colors
870 // at the entries of broken links.
871 m_xGlobalTree->Display(!bUpdateAll);
872 }
873 }
874 }
875 }
876 }
877}
878
879IMPL_LINK( SwNavigationPI, HeadingsMenuSelectHdl, const OUString&, rMenuId, void )
880{
881 if (!rMenuId.isEmpty())
882 m_xContentTree->SetOutlineLevel(rMenuId.toUInt32());
883}
884
886{
887 if (!m_xDocListBox) // disposed
888 return;
889
890 m_xDocListBox->freeze();
891 m_xDocListBox->clear();
892 SwView *pActView = GetCreateView();
893 bool bDisable = pActView == nullptr;
895 sal_Int32 nCount = 0;
896 sal_Int32 nAct = 0;
897 sal_Int32 nConstPos = 0;
898 const SwView* pConstView = m_xContentTree->IsConstantView() &&
899 m_xContentTree->GetActiveWrtShell() ?
900 &m_xContentTree->GetActiveWrtShell()->GetView():
901 nullptr;
902 while (pView)
903 {
904 SfxObjectShell* pDoc = pView->GetDocShell();
905 // #i53333# don't show help pages here
906 if ( !pDoc->IsHelpDocument() )
907 {
908 OUString sEntry = pDoc->GetTitle() + " (";
909 if (pView == pActView)
910 {
911 nAct = nCount;
912 sEntry += m_aStatusArr[IDX_STR_ACTIVE];
913 }
914 else
915 sEntry += m_aStatusArr[IDX_STR_INACTIVE];
916 sEntry += ")";
917 m_xDocListBox->append_text(sEntry);
918
919 if (pConstView && pView == pConstView)
920 nConstPos = nCount;
921
922 nCount++;
923 }
924 pView = SwModule::GetNextView(pView);
925 }
926 m_xDocListBox->append_text(m_aStatusArr[3]); // "Active Window"
927 nCount++;
928
929 if(m_xContentTree->GetHiddenWrtShell())
930 {
931 OUString sEntry = m_xContentTree->GetHiddenWrtShell()->GetView().
932 GetDocShell()->GetTitle() +
933 " (" +
934 m_aStatusArr[IDX_STR_HIDDEN] +
935 ")";
936 m_xDocListBox->append_text(sEntry);
937 bDisable = false;
938 }
939
940 m_xDocListBox->thaw();
941
942 if(m_xContentTree->IsActiveView())
943 {
944 //Either the name of the current Document or "Active Document".
945 m_xDocListBox->set_active(pActView ? nAct : --nCount);
946 }
947 else if(m_xContentTree->IsHiddenView())
948 {
949 m_xDocListBox->set_active(nCount);
950 }
951 else
952 m_xDocListBox->set_active(nConstPos);
953
954 m_xDocListBox->set_sensitive(!bDisable);
955}
956
957IMPL_LINK(SwNavigationPI, DoneLink, SfxPoolItem const *, pItem, void)
958{
959 const SfxViewFrameItem* pFrameItem = dynamic_cast<SfxViewFrameItem const *>( pItem );
960 if( !pFrameItem )
961 return;
962
963 SfxViewFrame* pFrame = pFrameItem->GetFrame();
964 if(pFrame)
965 {
966 m_xContentTree->clear();
967 m_pContentView = dynamic_cast<SwView*>( pFrame->GetViewShell() );
968 OSL_ENSURE(m_pContentView, "no SwView");
969 if(m_pContentView)
970 m_pContentWrtShell = m_pContentView->GetWrtShellPtr();
971 else
972 m_pContentWrtShell = nullptr;
973 m_oObjectShell.emplace( pFrame->GetObjectShell() );
974 FillBox();
975 }
976}
977
979{
980 OUString sFileName;
981 SotClipboardFormatId nFormat;
982 if( rData.HasFormat( nFormat = SotClipboardFormatId::FILE_LIST ))
983 {
984 FileList aFileList;
985 rData.GetFileList( nFormat, aFileList );
986 sFileName = aFileList.GetFile( 0 );
987 }
988 else if( rData.HasFormat( nFormat = SotClipboardFormatId::STRING ) ||
989 rData.HasFormat( nFormat = SotClipboardFormatId::SIMPLE_FILE ) ||
990 rData.HasFormat( nFormat = SotClipboardFormatId::FILENAME ))
991 {
992 (void)rData.GetString(nFormat, sFileName);
993 }
994 else if( rData.HasFormat( nFormat = SotClipboardFormatId::SOLK ) ||
995 rData.HasFormat( nFormat = SotClipboardFormatId::NETSCAPE_BOOKMARK )||
996 rData.HasFormat( nFormat = SotClipboardFormatId::FILECONTENT ) ||
997 rData.HasFormat( nFormat = SotClipboardFormatId::FILEGRPDESCRIPTOR ) ||
998 rData.HasFormat( nFormat = SotClipboardFormatId::UNIFORMRESOURCELOCATOR ))
999 {
1000 INetBookmark aBkmk { OUString(), OUString() };
1001 if (rData.GetINetBookmark(nFormat, aBkmk))
1002 sFileName = aBkmk.GetURL();
1003 }
1004 if( !sFileName.isEmpty() )
1005 {
1007 }
1008 return sFileName;
1009}
1010
1012{
1013 return ( !m_xContentTree->IsInDrag() &&
1014 ( m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::SIMPLE_FILE ) ||
1015 m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::STRING ) ||
1016 m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::SOLK ) ||
1017 m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::NETSCAPE_BOOKMARK )||
1018 m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::FILECONTENT ) ||
1019 m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::FILEGRPDESCRIPTOR ) ||
1020 m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::UNIFORMRESOURCELOCATOR ) ||
1021 m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::FILENAME )))
1024}
1025
1027{
1028 TransferableDataHelper aData( rEvt.maDropEvent.Transferable );
1030 if (m_xContentTree->IsInDrag())
1031 return nRet;
1032
1033 OUString sFileName = SwNavigationPI::CreateDropFileName(aData);
1034 if (sFileName.isEmpty())
1035 return nRet;
1036
1037 INetURLObject aTemp(sFileName);
1038 GraphicDescriptor aDesc(aTemp);
1039 if (aDesc.Detect()) // accept no graphics
1040 return nRet;
1041
1042 if (-1 != sFileName.indexOf('#'))
1043 return nRet;
1044
1045 if (m_sContentFileName.isEmpty() || m_sContentFileName != sFileName)
1046 {
1047 nRet = rEvt.mnAction;
1048 sFileName = comphelper::string::stripEnd(sFileName, 0);
1049 m_sContentFileName = sFileName;
1050 if(m_oObjectShell)
1051 {
1052 m_xContentTree->SetHiddenShell( nullptr );
1053 (*m_oObjectShell)->DoClose();
1054 m_oObjectShell.reset();
1055 }
1056 SfxStringItem aFileItem(SID_FILE_NAME, sFileName );
1057 SfxStringItem aOptionsItem( SID_OPTIONS, "HRC" );
1058 SfxLinkItem aLink( SID_DONELINK,
1059 LINK( this, SwNavigationPI, DoneLink ) );
1060 if (SwView* pView = GetActiveView())
1061 pView->GetViewFrame().GetDispatcher()->ExecuteList(
1062 SID_OPENDOC, SfxCallMode::ASYNCHRON,
1063 { &aFileItem, &aOptionsItem, &aLink });
1064 }
1065 return nRet;
1066}
1067
1069{
1070 m_nRegionMode = nNewMode;
1072
1073 OUString sImageId;
1074 switch (nNewMode)
1075 {
1076 case RegionMode::NONE:
1077 sImageId = RID_BMP_DROP_REGION;
1078 break;
1079 case RegionMode::LINK:
1080 sImageId = RID_BMP_DROP_LINK;
1081 break;
1082 case RegionMode::EMBEDDED:
1083 sImageId = RID_BMP_DROP_COPY;
1084 break;
1085 }
1086 m_xContent6ToolBox->set_item_icon_name("dragmode", sImageId);
1087}
1088
1090{
1092 {
1093 m_xGlobalTree->HideTree();
1094 return;
1095 }
1096
1097 bool bGlobalDoc = IsGlobalDoc();
1098 if (!IsGlobalMode() && bGlobalDoc)
1099 {
1100 if (IsZoomedIn())
1101 ZoomOut();
1102 m_xGlobalBox->show();
1103 m_xGlobalTree->ShowTree();
1104 m_xGlobalToolBox->show();
1105 m_xContentBox->hide();
1106 m_xContentTree->HideTree();
1107 m_xContent1ToolBox->hide();
1108 m_xContent2ToolBox->hide();
1109 m_xContent3ToolBox->hide();
1110 m_xContent4ToolBox->hide();
1111 m_xContent5ToolBox->hide();
1112 m_xContent6ToolBox->hide();
1113 m_xDocListBox->hide();
1114 SetGlobalMode(true);
1115 }
1116 else
1117 {
1118 m_xGlobalBox->hide();
1119 m_xGlobalTree->HideTree();
1120 m_xGlobalToolBox->hide();
1121 if (!IsZoomedIn())
1122 {
1123 m_xContentBox->show();
1124 m_xContentTree->ShowTree();
1125 m_xContent1ToolBox->show();
1126 m_xContent2ToolBox->show();
1127 m_xContent3ToolBox->show();
1128 m_xContent4ToolBox->show();
1129 m_xContent5ToolBox->show();
1130 m_xContent6ToolBox->show();
1131 m_xDocListBox->show();
1132 }
1133 SetGlobalMode(false);
1134 }
1135}
1136
1138{
1139 bool bRet = false;
1140 SwView *pView = GetCreateView();
1141 if (pView)
1142 {
1143 SwWrtShell &rSh = pView->GetWrtShell();
1144 bRet = rSh.IsGlobalDoc();
1145 }
1146 return bRet;
1147}
1148
1149IMPL_LINK_NOARG(SwNavigationPI, ChangePageHdl, Timer *, void)
1150{
1151 if (!m_xDocListBox) // disposed
1152 return;
1153 // tdf#134959 if the SpinButton changed value this Timer was launched, now
1154 // change to the desired page, but we leave focus where it currently is,
1155 // i.e. typically remaining in the spinbutton, or whatever other widget the
1156 // user moved to in the meantime
1157 EditAction();
1158}
1159
1160void SwNavigationPI::SelectNavigateByContentType(const OUString& rContentTypeName)
1161{
1162 if (auto nPos = m_pNavigateByComboBox->find_text(rContentTypeName); nPos != -1)
1163 {
1166 }
1167}
1168
1170{
1171 // tdf#134959 if the user presses enter to activate the Entry
1172 // go to the page, and on success we move focus to the document
1173 if (EditAction())
1174 m_pCreateView->GetEditWin().GrabFocus();
1175 return true;
1176}
1177
1179{
1180 if (m_aPageChgIdle.IsActive())
1181 m_aPageChgIdle.Stop();
1182 m_aPageChgIdle.Start();
1183}
1184
1186{
1187 if (!m_pCreateView)
1188 {
1189 SwView* pView = SwModule::GetFirstView();
1190 while (pView)
1191 {
1192 if(&pView->GetViewFrame().GetBindings() == &m_rBindings)
1193 {
1194 const_cast<SwNavigationPI*>(this)->m_pCreateView = pView;
1195 const_cast<SwNavigationPI*>(this)->StartListening(*m_pCreateView);
1196 break;
1197 }
1198 pView = SwModule::GetNextView(pView);
1199 }
1200 }
1201 return m_pCreateView;
1202}
1203
1205{
1206private:
1207 std::unique_ptr<SwNavigationPI> m_xNavi;
1208public:
1209 SwNavigatorWin(SfxBindings* _pBindings, SfxChildWindow* _pMgr,
1210 vcl::Window* pParent, SfxChildWinInfo* pInfo);
1211 virtual void StateChanged(StateChangedType nStateChange) override;
1212 virtual void dispose() override
1213 {
1214 m_xNavi.reset();
1216 }
1217 virtual ~SwNavigatorWin() override
1218 {
1219 disposeOnce();
1220 }
1221};
1222
1224 vcl::Window* pParent, SfxChildWinInfo* pInfo)
1225 : SfxNavigator(_pBindings, _pMgr, pParent, pInfo)
1226 , m_xNavi(std::make_unique<SwNavigationPI>(m_xContainer.get(), _pBindings->GetActiveFrame(), _pBindings, this))
1227{
1228 _pBindings->Invalidate(SID_NAVIGATOR);
1229
1230 SwNavigationConfig* pNaviConfig = SW_MOD()->GetNavigationConfig();
1231
1232 SetMinOutputSizePixel(GetOptimalSize());
1233 if (pNaviConfig->IsSmall())
1234 m_xNavi->ZoomIn();
1235}
1236
1238{
1239 SfxNavigator::StateChanged(nStateChange);
1240 if (nStateChange == StateChangedType::InitShow)
1241 m_xNavi->UpdateInitShow();
1242}
1243
1245
1247 SfxBindings* pBindings, SfxChildWinInfo* pInfo)
1248 : SfxNavigatorWrapper(_pParent, nId)
1249{
1250 SetWindow(VclPtr<SwNavigatorWin>::Create(pBindings, this, _pParent, pInfo));
1251 Initialize();
1252}
1253
1254/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxApplication * SfxGetpApp()
SFX2_DLLPUBLIC bool ParentIsFloatingWindow(const vcl::Window *pParent)
OUString GetFile(size_t nIndex) const
bool Detect(bool bExtendedInfo=false)
const OUString & GetURL() const
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
weld::ComboBox * GetComboBox()
Definition: workctrl.hxx:181
virtual weld::Window * GetFrameWeld() const
std::unique_ptr< weld::Builder > m_xBuilder
std::unique_ptr< weld::Container > m_xContainer
void Invalidate(sal_uInt16 nId)
void SetWindow(const VclPtr< vcl::Window > &p)
virtual void dispose()
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
virtual void StateChanged(StateChangedType nStateChange) override
virtual void dispose() override
void SetMinOutputSizePixel(const Size &rSize)
SfxHintId GetId() const
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
void SetReadOnlyUI(bool bReadOnly=true)
OUString GetTitle(sal_uInt16 nMaxLen=0) const
bool IsHelpDocument() const
SfxViewFrame * GetFrame() const
SfxViewShell * GetViewShell() const
SfxViewFrame * GetFrame() const
SfxBindings & GetBindings()
SfxDispatcher * GetDispatcher()
virtual SfxObjectShell * GetObjectShell() override
SfxViewFrame & GetViewFrame() const
constexpr tools::Long Height() const
void setHeight(tools::Long nHeight)
TreeListBox for content indicator.
Definition: conttree.hxx:91
bool GotoNextFootnoteAnchor()
Definition: trvlfnfl.cxx:339
bool GotoHeaderText()
jump from the content to the header
Definition: crstrvl.cxx:132
void SwapPam()
Definition: crsrsh.cxx:1262
void MakeOutlineSel(SwOutlineNodes::size_type nSttPos, SwOutlineNodes::size_type nEndPos, bool bWithChildren, bool bKillPams=true)
Definition: crstrvl.cxx:1348
void GetPageNum(sal_uInt16 &rnPhyNum, sal_uInt16 &rnVirtNum, bool bAtCursorPos=true, const bool bCalcFrame=true)
Definition: crsrsh.cxx:1509
bool GotoFootnoteText()
jump from content to footnote
Definition: trvlfnfl.cxx:89
void ClearMark()
Definition: crsrsh.cxx:1225
bool GotoPrevFootnoteAnchor()
Definition: trvlfnfl.cxx:344
SwOutlineNodes::size_type GetOutlinePos(sal_uInt8 nLevel=UCHAR_MAX, SwPaM *pPaM=nullptr)
search "outline position" before previous outline node at given level
Definition: crstrvl.cxx:1319
bool IsCursorPtAtEnd() const
Definition: crsrsh.hxx:920
bool GotoFooterText()
jump from the content to the footer
Definition: crstrvl.cxx:160
sal_uInt16 GetPageCnt()
Definition: crsrsh.cxx:1591
bool IsAllProtect() const
Definition: crsrsh.hxx:790
void SetGlblDocSaveLinks(bool bFlag)
Definition: edglbldc.cxx:38
bool IsGlblDocSaveLinks() const
Definition: edglbldc.cxx:48
bool IsOutlineMovable(SwOutlineNodes::size_type nIdx) const
May an outline be moved or copied? Check whether it's in text body, not in table, and not read-only (...
Definition: ednumber.cxx:622
bool MoveOutlinePara(SwOutlineNodes::difference_type nOffset)
Definition: ednumber.cxx:543
bool IsGlobalDoc() const
Interfaces for GlobalDocument.
Definition: edglbldc.cxx:33
FrameTypeFlags GetFrameType(const Point *pPt, bool bStopAtFly) const
For return values see above FrameType.
Definition: fews.cxx:237
bool IsFrameSelected() const
Definition: feshview.cxx:1133
static SwView * GetNextView(SwView const *)
Definition: swmodul1.cxx:128
static SwView * GetFirstView()
Definition: swmodul1.cxx:121
sal_Int32 GetOutlineLevel() const
Definition: navicfg.hxx:60
sal_Int32 GetOutlineTracking() const
Definition: navicfg.hxx:105
void SetSmall(bool bSet)
Definition: navicfg.hxx:88
bool IsGlobalActive() const
Definition: navicfg.hxx:96
bool IsSmall() const
Definition: navicfg.hxx:87
RegionMode GetRegionMode() const
Definition: navicfg.hxx:69
bool IsContentTypeTrack(ContentTypeId eCntTypeId)
Definition: navicfg.hxx:114
void SetRegionMode(RegionMode nSet)
Definition: navicfg.hxx:70
ContentTypeId GetRootType() const
Definition: navicfg.hxx:51
SfxBindings & m_rBindings
Definition: navipi.hxx:86
SwNavigationPI(weld::Widget *pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > &rxFrame, SfxBindings *_pBindings, SfxNavigator *pNavigatorDlg)
Definition: navipi.cxx:531
void ZoomIn()
Definition: navipi.cxx:458
std::unique_ptr< weld::Widget > m_xGlobalBox
Definition: navipi.hxx:70
virtual void NotifyItemUpdate(const sal_uInt16 nSId, const SfxItemState eState, const SfxPoolItem *pState) override
Definition: navipi.cxx:779
bool IsZoomedIn() const
Definition: navipi.hxx:96
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: navipi.cxx:843
bool IsGlobalDoc() const
Definition: navipi.cxx:1137
void SetGlobalMode(bool bSet)
Definition: navipi.hxx:127
RegionMode m_nRegionMode
Definition: navipi.hxx:88
weld::ComboBox * m_pNavigateByComboBox
Definition: navipi.hxx:94
std::unique_ptr< weld::Toolbar > m_xContent4ToolBox
Definition: navipi.hxx:57
void ZoomOut()
Definition: navipi.cxx:425
SwView * GetCreateView() const
Definition: navipi.cxx:1185
sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt)
Definition: navipi.cxx:1026
bool IsGlobalMode() const
Definition: navipi.hxx:161
Size m_aExpandedSize
Definition: navipi.hxx:89
Idle m_aPageChgIdle
Definition: navipi.hxx:73
std::optional< SfxObjectShellLock > m_oObjectShell
Definition: navipi.hxx:79
static OUString CreateDropFileName(const TransferableDataHelper &rData)
Definition: navipi.cxx:978
static std::unique_ptr< PanelLayout > Create(weld::Widget *pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > &rxFrame, SfxBindings *pBindings)
Definition: navipi.cxx:499
virtual ~SwNavigationPI() override
Definition: navipi.cxx:734
std::unique_ptr< weld::Toolbar > m_xContent1ToolBox
Definition: navipi.hxx:54
std::unique_ptr< weld::Toolbar > m_xGlobalToolBox
Definition: navipi.hxx:66
std::unique_ptr< weld::Toolbar > m_xContent2ToolBox
Definition: navipi.hxx:55
std::unique_ptr< ToolbarUnoDispatcher > m_xContent3Dispatch
Definition: navipi.hxx:61
std::unique_ptr< weld::SpinButton > m_xEdit
Definition: navipi.hxx:67
bool m_bIsZoomedIn
Definition: navipi.hxx:91
std::unique_ptr< SwContentTree > m_xContentTree
Definition: navipi.hxx:69
SwView * m_pActContView
Definition: navipi.hxx:82
void MoveOutline(SwOutlineNodes::size_type nSource, SwOutlineNodes::size_type nTarget)
Definition: navipi.cxx:73
std::unique_ptr< weld::Menu > m_xDragModeMenu
Definition: navipi.hxx:63
std::unique_ptr< weld::Menu > m_xUpdateMenu
Definition: navipi.hxx:64
std::unique_ptr< weld::Toolbar > m_xContent3ToolBox
Definition: navipi.hxx:56
sal_Int8 AcceptDrop()
Definition: navipi.cxx:1011
bool EditAction()
Definition: navipi.cxx:394
SwNavigationConfig * m_pConfig
Definition: navipi.hxx:85
void FillBox()
Definition: navipi.cxx:151
virtual weld::Window * GetFrameWeld() const override
Definition: navipi.cxx:727
void UpdateInitShow()
Definition: navipi.cxx:821
void UpdateListBox()
Definition: navipi.cxx:885
std::unique_ptr< weld::Toolbar > m_xContent5ToolBox
Definition: navipi.hxx:58
::sfx2::sidebar::ControllerItem m_aDocFullName
Definition: navipi.hxx:51
void UsePage()
Definition: navipi.cxx:178
void ToggleTree()
Definition: navipi.cxx:1089
VclPtr< SfxNavigator > m_xNavigatorDlg
Definition: navipi.hxx:77
static OUString CleanEntry(const OUString &rEntry)
Definition: navipi.cxx:58
void SelectNavigateByContentType(const OUString &rContentTypeName)
Definition: navipi.cxx:1160
void SetRegionDropMode(RegionMode nNewMode)
Definition: navipi.cxx:1068
SwWrtShell * m_pContentWrtShell
Definition: navipi.hxx:81
OUString m_aStatusArr[4]
Definition: navipi.hxx:75
std::unique_ptr< weld::Menu > m_xInsertMenu
Definition: navipi.hxx:65
std::unique_ptr< weld::Menu > m_xHeadingsMenu
Definition: navipi.hxx:62
std::unique_ptr< SwGlobalTree > m_xGlobalTree
Definition: navipi.hxx:71
OUString m_sContentFileName
Definition: navipi.hxx:74
std::unique_ptr< ToolbarUnoDispatcher > m_xContent2Dispatch
Definition: navipi.hxx:60
std::unique_ptr< weld::Widget > m_xContentBox
Definition: navipi.hxx:68
SwView * m_pCreateView
Definition: navipi.hxx:83
::sfx2::sidebar::ControllerItem m_aPageStats
Definition: navipi.hxx:52
void UpdateNavigateBy()
Definition: navipi.cxx:133
std::unique_ptr< weld::ComboBox > m_xDocListBox
Definition: navipi.hxx:72
std::unique_ptr< weld::Toolbar > m_xContent6ToolBox
Definition: navipi.hxx:59
virtual void dispose() override
Definition: navipi.cxx:1212
SwNavigatorWin(SfxBindings *_pBindings, SfxChildWindow *_pMgr, vcl::Window *pParent, SfxChildWinInfo *pInfo)
Definition: navipi.cxx:1223
virtual ~SwNavigatorWin() override
Definition: navipi.cxx:1217
virtual void StateChanged(StateChangedType nStateChange) override
Definition: navipi.cxx:1237
std::unique_ptr< SwNavigationPI > m_xNavi
Definition: navipi.cxx:1207
SwNavigatorWrapper(vcl::Window *pParent, sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo *pInfo)
Definition: navipi.cxx:1246
static constexpr auto npos
Definition: ndarr.hxx:81
Definition: view.hxx:146
SwWrtShell & GetWrtShell() const
Definition: view.hxx:423
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:424
SwEditWin & GetEditWin()
Definition: view.hxx:426
SwDocShell * GetDocShell()
Definition: view.cxx:1193
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
bool EndPg(bool bSelect=false)
Definition: move.cxx:388
void LeaveSelFrameMode()
Definition: select.cxx:729
bool GotoPage(sal_uInt16 nPage, bool bRecord)
Definition: move.cxx:611
bool SttPg(bool bSelect=false)
Definition: move.cxx:382
void GotoFootnoteAnchor(const SwTextFootnote &rTextFootnote)
Definition: move.cxx:747
void GotoOutline(SwOutlineNodes::size_type nIdx)
Definition: move.cxx:655
void UnSelectFrame()
Definition: select.cxx:332
void MoveCursor(bool bWithSelect=false)
Definition: move.cxx:74
const SwView & GetView() const
Definition: wrtsh.hxx:443
bool IsActive() const
void SetPriority(TaskPriority ePriority)
void Stop()
void SetInvokeHandler(const Link< Timer *, void > &rLink)
bool GetString(SotClipboardFormatId nFormat, OUString &rStr) const
bool GetFileList(SotClipboardFormatId nFormat, FileList &rFileList) const
bool HasFormat(SotClipboardFormatId nFormat) const
bool GetINetBookmark(SotClipboardFormatId nFormat, INetBookmark &rBmk) const
reference_type * get() const
std::vector< Value >::difference_type difference_type
void GrabFocus()
bool HasFocus() const
virtual int find_text(const OUString &rStr) const=0
virtual OUString get_active_id() const=0
virtual void set_active(int pos)=0
void connect_changed(const Link< ComboBox &, void > &rLink)
#define FN_PREV_FOOTNOTE
Definition: cmdid.h:731
#define FN_FOOTNOTE_TO_ANCHOR
Definition: cmdid.h:729
#define FN_TO_FOOTER
Definition: cmdid.h:737
#define FN_NAV_ELEMENT
Definition: cmdid.h:188
#define FN_TO_HEADER
Definition: cmdid.h:736
#define FN_STAT_PAGE
Definition: cmdid.h:864
#define FN_START_OF_PAGE
Definition: cmdid.h:687
#define FN_SET_REMINDER
Definition: cmdid.h:286
#define FN_NEXT_FOOTNOTE
Definition: cmdid.h:730
#define FN_END_OF_PAGE
Definition: cmdid.h:688
int nCount
#define max(a, b)
SfxEventHintId
FrameTypeFlags
values can be combined via logical or
Definition: fesh.hxx:63
DocumentType eType
SotClipboardFormatId
constexpr OUStringLiteral HID_NAVIGATOR_TOOLBOX
Definition: helpids.h:33
constexpr OUStringLiteral HID_NAVIGATOR_GLOBAL_TOOLBOX
Definition: helpids.h:35
constexpr OUStringLiteral HID_NAVIGATOR_LISTBOX
Definition: helpids.h:34
constexpr sal_uInt16 KEY_MOD1
sal_uInt16 nPos
#define SAL_N_ELEMENTS(arr)
constexpr OUStringLiteral aData
Definition: ww8scan.hxx:48
OString stripEnd(const OString &rIn, char c)
RegionMode
int i
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
IMPL_LINK(SwNavigationPI, DocListBoxSelectHdl, weld::ComboBox &, rBox, void)
Definition: navipi.cxx:111
static void lcl_UnSelectFrame(SwWrtShell *pSh)
Definition: navipi.cxx:101
SFX_IMPL_DOCKINGWINDOW(SwNavigatorWrapper, SID_NAVIGATOR)
IMPL_LINK_NOARG(SwNavigationPI, PageModifiedHdl, weld::Entry &, void)
Definition: navipi.cxx:512
Reference< XNameAccess > m_xContainer
sal_Int16 nId
SfxItemState
const css::datatransfer::dnd::DropTargetDropEvent maDropEvent
Reference< XController > xController
ContentTypeId
Definition: swcont.hxx:30
SwView * GetActiveView()
Definition: swmodul1.cxx:115
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:168
#define SW_MOD()
Definition: swmodule.hxx:254
constexpr sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:92
#define DND_ACTION_COPY
#define DND_ACTION_NONE
unsigned char sal_uInt8
signed char sal_Int8
StateChangedType