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