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