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