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