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