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 <vcl/toolbox.hxx>
32 #include <swtypes.hxx>
33 #include <swmodule.hxx>
34 #include <view.hxx>
35 #include <navicfg.hxx>
36 #include <wrtsh.hxx>
37 #include <docsh.hxx>
38 #include <navipi.hxx>
39 #include <workctrl.hxx>
40 #include <edtwin.hxx>
41 #include <sfx2/app.hxx>
42 #include <cmdid.h>
43 #include <helpids.h>
44 
45 #include <strings.hrc>
46 #include <bitmaps.hlst>
47 
48 #include <memory>
49 
50 #include <uiobject.hxx>
51 
52 using namespace ::com::sun::star::uno;
53 using namespace ::com::sun::star::frame;
54 
56 std::unique_ptr<SfxChildWindowContext> SwNavigationChild::CreateImpl( vcl::Window *pParent,
57  SfxBindings *pBindings, SfxChildWinInfo* /*pInfo*/ )
58 {
59  return std::make_unique<SwNavigationChild>(pParent,
60  /* cast is safe here! */static_cast< sal_uInt16 >(SwView::GetInterfaceId()),
61  pBindings);
62 }
64 {
65  auto pFact = std::make_unique<SfxChildWinContextFactory>(
67  /* cast is safe here! */static_cast< sal_uInt16 >(SwView::GetInterfaceId()) );
68  SfxChildWindowContext::RegisterChildWindowContext(pMod, SID_NAVIGATOR, std::move(pFact));
69 }
70 
71 
72 // Filter the control characters out of the Outline-Entry
73 
74 OUString SwNavigationPI::CleanEntry(const OUString& rEntry)
75 {
76  if (rEntry.isEmpty())
77  return rEntry;
78 
79  OUStringBuffer aEntry(rEntry);
80  for (sal_Int32 i = 0; i < rEntry.getLength(); ++i)
81  if(aEntry[i] == 10 || aEntry[i] == 9)
82  aEntry[i] = 0x20;
83 
84  return aEntry.makeStringAndClear();
85 }
86 
87 // Execution of the drag operation with and without the children.
88 
90 {
91  SwView *pView = GetCreateView();
92  SwWrtShell &rSh = pView->GetWrtShell();
93  if(nTarget < nSource || nTarget == SwOutlineNodes::npos)
94  nTarget ++;
95  if ( rSh.IsOutlineMovable( nSource ))
96  {
97 
98  SwOutlineNodes::difference_type nMove = nTarget-nSource; //( nDir<0 ) ? 1 : 0 ;
99  rSh.GotoOutline(nSource);
100  rSh.MakeOutlineSel(nSource, nSource, true);
101  // While moving, the selected children does not counting.
102  const SwOutlineNodes::size_type nLastOutlinePos = rSh.GetOutlinePos(MAXLEVEL);
103  if(nMove > 1 && nLastOutlinePos < nTarget)
104  {
105  if(!rSh.IsCursorPtAtEnd())
106  rSh.SwapPam();
107  nMove -= nLastOutlinePos - nSource;
108  }
109  if( nMove < 1 || nLastOutlinePos < nTarget )
110  rSh.MoveOutlinePara( nMove );
111  rSh.ClearMark();
112  rSh.GotoOutline( nSource + nMove);
113  }
114 
115 }
116 
117 // After goto cancel the status frame selection
118 static void lcl_UnSelectFrame(SwWrtShell *pSh)
119 {
120  if (pSh->IsFrameSelected())
121  {
122  pSh->UnSelectFrame();
123  pSh->LeaveSelFrameMode();
124  }
125 }
126 
127 // Select the document view
128 IMPL_LINK(SwNavigationPI, DocListBoxSelectHdl, weld::ComboBox&, rBox, void)
129 {
130  int nEntryIdx = rBox.get_active();
131  SwView *pView ;
132  pView = SwModule::GetFirstView();
133  while (nEntryIdx-- && pView)
134  {
135  pView = SwModule::GetNextView(pView);
136  }
137  if(!pView)
138  {
139  nEntryIdx == 0 ?
140  m_xContentTree->ShowHiddenShell():
141  m_xContentTree->ShowActualView();
142 
143  }
144  else
145  {
146  m_xContentTree->SetConstantShell(pView->GetWrtShellPtr());
147  }
148 }
149 
150 // Filling of the list box for outline view or documents
151 // The PI will be set to full size
153 {
155  {
156  m_xContentTree->SetHiddenShell( m_pContentWrtShell );
157  m_xContentTree->Display( false );
158  }
159  else
160  {
161  SwView *pView = GetCreateView();
162  if(!pView)
163  {
164  m_xContentTree->SetActiveShell(nullptr);
165  }
166  else if( pView != m_pActContView)
167  {
168  SwWrtShell* pWrtShell = pView->GetWrtShellPtr();
169  m_xContentTree->SetActiveShell(pWrtShell);
170  }
171  else
172  m_xContentTree->Display( true );
173  m_pActContView = pView;
174  }
175 }
176 
178 {
179  SwView *pView = GetCreateView();
180  SwWrtShell *pSh = pView ? &pView->GetWrtShell() : nullptr;
181  m_xEdit->set_value(1);
182  if (pSh)
183  {
184  const sal_uInt16 nPageCnt = pSh->GetPageCnt();
185  sal_uInt16 nPhyPage, nVirPage;
186  pSh->GetPageNum(nPhyPage, nVirPage);
187 
188  m_xEdit->set_max(nPageCnt);
189  m_xEdit->set_width_chars(3);
190  m_xEdit->set_value(nPhyPage);
191  }
192 }
193 
194 // Select handler of the toolboxes
195 IMPL_LINK(SwNavigationPI, ToolBoxSelectHdl, const OString&, rCommand, void)
196 {
197  SwView *pView = GetCreateView();
198  if (!pView)
199  return;
200  SwWrtShell &rSh = pView->GetWrtShell();
201  // Get MouseModifier for Outline-Move
202 
203  int nFuncId = 0;
204  bool bFocusToDoc = false;
205  if (rCommand == ".uno:ScrollToPrevious")
206  {
207  rSh.GetView().GetViewFrame()->GetDispatcher()->Execute(FN_SCROLL_PREV, SfxCallMode::ASYNCHRON);
208  }
209  else if (rCommand == ".uno:ScrollToNext")
210  {
211  rSh.GetView().GetViewFrame()->GetDispatcher()->Execute(FN_SCROLL_NEXT, SfxCallMode::ASYNCHRON);
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_xContent3ToolBox->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_xContent3ToolBox->set_menu_item_active("dragmode", !m_xContent3ToolBox->get_menu_item_active("dragmode"));
321  else if (rCommand == "headings")
322  m_xContent2ToolBox->set_menu_item_active("headings", !m_xContent2ToolBox->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, ToolBox3DropdownClickHdl, const OString&, rCommand, void)
347 {
348  if (!m_xContent3ToolBox->get_menu_item_active(rCommand))
349  return;
350 
351  if (rCommand == "dragmode")
352  {
353  switch (m_nRegionMode)
354  {
355  case RegionMode::NONE:
356  m_xDragModeMenu->set_active("hyperlink", true);
357  break;
358  case RegionMode::LINK:
359  m_xDragModeMenu->set_active("link", true);
360  break;
362  m_xDragModeMenu->set_active("copy", true);
363  break;
364  }
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, ToolBox2DropdownClickHdl, const OString&, rCommand, void)
384 {
385  if (!m_xContent2ToolBox->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  sal_uInt16 nPhyPage, nVirPage;
416  rSh.GetPageNum(nPhyPage, nVirPage);
417  if (nPhyPage == nNewPage)
418  return false;
419 
420  rSh.GotoPage(nNewPage, true);
423 
424  return true;
425 }
426 
428 {
429  if (!IsZoomedIn())
430  return;
431  SfxNavigator* pNav = dynamic_cast<SfxNavigator*>(GetParent());
432  if (!pNav)
433  return;
434  m_bIsZoomedIn = false;
435  FillBox();
436  if (IsGlobalMode())
437  {
438  m_xGlobalBox->show();
439  m_xGlobalTree->ShowTree();
440  }
441  else
442  {
443  m_xContentBox->show();
444  m_xContentTree->ShowTree();
445  m_xDocListBox->show();
446  }
447 
448  Size aOptimalSize(GetOptimalSize());
449  Size aNewSize(pNav->GetOutputSizePixel());
450  aNewSize.setHeight( m_aExpandedSize.Height() );
451  pNav->SetMinOutputSizePixel(aOptimalSize);
452  pNav->SetOutputSizePixel(aNewSize);
453 
454  m_xContentTree->Select(); // Enable toolbox
455  m_pConfig->SetSmall(false);
456  m_xContent3ToolBox->set_item_active("listbox", true);
457 }
458 
460 {
461  if (IsZoomedIn())
462  return;
463  SfxNavigator* pNav = dynamic_cast<SfxNavigator*>(GetParent());
464  if (!pNav)
465  return;
466 
467  m_aExpandedSize = GetSizePixel();
468 
469  m_xContentBox->hide();
470  m_xContentTree->HideTree();
471  m_xGlobalBox->hide();
472  m_xGlobalTree->HideTree();
473  m_xDocListBox->hide();
474  m_bIsZoomedIn = true;
475 
476  Size aOptimalSize(GetOptimalSize());
477  Size aNewSize(pNav->GetOutputSizePixel());
478  aNewSize.setHeight( aOptimalSize.Height() );
479  pNav->SetMinOutputSizePixel(aOptimalSize);
480  pNav->SetOutputSizePixel(aNewSize);
481 
482  m_xContentTree->Select(); // Enable toolbox
483 
484  m_pConfig->SetSmall(true);
485  m_xContent3ToolBox->set_item_active("listbox", false);
486 }
487 
488 namespace {
489 
491 {
492  IDX_STR_HIDDEN = 0,
493  IDX_STR_ACTIVE = 1,
494  IDX_STR_INACTIVE = 2
495 };
496 
497 }
498 
500  const css::uno::Reference<css::frame::XFrame>& rxFrame,
501  SfxBindings* pBindings)
502 {
503  if( pParent == nullptr )
504  throw css::lang::IllegalArgumentException("no parent window given to SwNavigationPI::Create", nullptr, 0);
505  if( !rxFrame.is() )
506  throw css::lang::IllegalArgumentException("no XFrame given to SwNavigationPI::Create", nullptr, 0);
507  if( pBindings == nullptr )
508  throw css::lang::IllegalArgumentException("no SfxBindings given to SwNavigationPI::Create", nullptr, 0);
509  return VclPtr<SwNavigationPI>::Create(pParent, rxFrame, pBindings);
510 }
511 
513  const css::uno::Reference<css::frame::XFrame>& rxFrame,
514  SfxBindings* _pBindings)
515  : PanelLayout(pParent, "NavigatorPanel", "modules/swriter/ui/navigatorpanel.ui", rxFrame)
516  , m_aDocFullName(SID_DOCFULLNAME, *_pBindings, *this)
517  , m_aPageStats(FN_STAT_PAGE, *_pBindings, *this)
518  , m_xContent1ToolBox(m_xBuilder->weld_toolbar("content1"))
519  , m_xContent2ToolBox(m_xBuilder->weld_toolbar("content2"))
520  , m_xContent3ToolBox(m_xBuilder->weld_toolbar("content3"))
521  , m_xContent1Dispatch(new ToolbarUnoDispatcher(*m_xContent1ToolBox, *m_xBuilder, rxFrame))
522  , m_xHeadingsMenu(m_xBuilder->weld_menu("headingsmenu"))
523  , m_xDragModeMenu(m_xBuilder->weld_menu("dragmodemenu"))
524  , m_xUpdateMenu(m_xBuilder->weld_menu("updatemenu"))
525  , m_xInsertMenu(m_xBuilder->weld_menu("insertmenu"))
526  , m_xGlobalToolBox(m_xBuilder->weld_toolbar("global"))
527  , m_xEdit(m_xBuilder->weld_spin_button("spinbutton"))
528  , m_xContentBox(m_xBuilder->weld_widget("contentbox"))
529  , m_xContentTree(new SwContentTree(m_xBuilder->weld_tree_view("contenttree"), this))
530  , m_xGlobalBox(m_xBuilder->weld_widget("globalbox"))
531  , m_xGlobalTree(new SwGlobalTree(m_xBuilder->weld_tree_view("globaltree"), this))
532  , m_xDocListBox(m_xBuilder->weld_combo_box("documents"))
533  , m_pContentView(nullptr)
534  , m_pContentWrtShell(nullptr)
535  , m_pActContView(nullptr)
536  , m_pCreateView(nullptr)
537  , m_pConfig(SW_MOD()->GetNavigationConfig())
538  , m_rBindings(*_pBindings)
539  , m_nRegionMode(RegionMode::NONE)
540  , m_bIsZoomedIn(false)
541  , m_bGlobalMode(false)
542 {
543  set_id("NavigatorPanelParent"); // for uitest/writer_tests5/tdf114724.py
544 
545  GetCreateView();
546 
551  m_xDocListBox->set_help_id(HID_NAVIGATOR_LISTBOX);
552  m_xDocListBox->set_size_request(42, -1); // set a nominal width so it takes width of surroundings
553 
554  // Insert the numeric field in the toolbox.
555  m_xEdit->set_accessible_name(m_xEdit->get_tooltip_text());
556  m_xEdit->set_width_chars(3);
557  m_xEdit->connect_value_changed(LINK(this, SwNavigationPI, PageEditModifyHdl));
558  m_xEdit->set_help_id("modules/swriter/ui/navigatorpanel/numericfield");
559 
560  if (!IsGlobalDoc())
561  {
562  m_xContent1ToolBox->set_item_visible("contenttoggle", false);
563  }
564 
565  const char* REGIONNAME_ARY[] =
566  {
567  STR_HYPERLINK,
568  STR_LINK_REGION,
569  STR_COPY_REGION
570  };
571 
572  const char* REGIONMODE_ARY[] =
573  {
574  STR_HIDDEN,
575  STR_ACTIVE,
576  STR_INACTIVE
577  };
578 
579  static_assert(SAL_N_ELEMENTS(REGIONNAME_ARY) == SAL_N_ELEMENTS(REGIONMODE_ARY), "### unexpected size!");
580  static_assert(SAL_N_ELEMENTS(REGIONNAME_ARY) == static_cast<sal_uInt16>(RegionMode::EMBEDDED) + 1, "### unexpected size!");
581 
582  for (sal_uInt16 i = 0; i <= static_cast<sal_uInt16>(RegionMode::EMBEDDED); ++i)
583  {
584  m_aStatusArr[i] = SwResId(REGIONMODE_ARY[i]);
585  }
586 
587  m_aStatusArr[3] = SwResId(STR_ACTIVE_VIEW);
588 
589  bool bFloatingNavigator = SfxChildWindowContext::GetFloatingWindow(GetParent()) != nullptr;
590 
591  m_xContentTree->set_selection_mode(SelectionMode::Single);
592  m_xContentTree->ShowTree();
593  m_xContent3ToolBox->set_item_active("listbox", true);
594  m_xContent3ToolBox->set_item_sensitive("listbox", bFloatingNavigator);
595 
596 // TreeListBox for global document
597  m_xGlobalTree->set_selection_mode(SelectionMode::Multiple);
598 
599 // Handler
600  Link<const OString&, void> aLk = LINK(this, SwNavigationPI, ToolBoxSelectHdl);
601  m_xContent1ToolBox->connect_clicked(aLk);
602  m_xContent2ToolBox->connect_clicked(aLk);
603  m_xContent3ToolBox->connect_clicked(aLk);
604  m_xGlobalToolBox->connect_clicked(aLk);
605  m_xDocListBox->connect_changed(LINK(this, SwNavigationPI, DocListBoxSelectHdl));
606  m_xContent2ToolBox->set_item_menu("headings", m_xHeadingsMenu.get());
607  m_xHeadingsMenu->connect_activate(LINK(this, SwNavigationPI, HeadingsMenuSelectHdl));
608  m_xContent2ToolBox->connect_menu_toggled(LINK(this, SwNavigationPI, ToolBox2DropdownClickHdl));
609  m_xContent3ToolBox->set_item_menu("dragmode", m_xDragModeMenu.get());
610  m_xDragModeMenu->connect_activate(LINK(this, SwNavigationPI, DropModeMenuSelectHdl));
611  m_xContent3ToolBox->connect_menu_toggled(LINK(this, SwNavigationPI, ToolBox3DropdownClickHdl));
612  m_xGlobalToolBox->set_item_menu("update", m_xUpdateMenu.get());
613  m_xUpdateMenu->connect_activate(LINK(this, SwNavigationPI, GlobalMenuSelectHdl));
614  m_xGlobalToolBox->set_item_menu("insert", m_xInsertMenu.get());
615  m_xInsertMenu->connect_activate(LINK(this, SwNavigationPI, GlobalMenuSelectHdl));
616  m_xGlobalToolBox->connect_menu_toggled(LINK(this, SwNavigationPI, ToolBoxClickHdl));
617  m_xGlobalToolBox->set_item_active("globaltoggle", true);
618 
619 // set toolbar of both modes to widest of each
620  m_xGlobalToolBox->set_size_request(m_xContent1ToolBox->get_preferred_size().Width(), -1);
621 
623 
624  if(IsGlobalDoc())
625  {
626  SwView *pActView = GetCreateView();
627  m_xGlobalToolBox->set_item_active("save",
628  pActView->GetWrtShellPtr()->IsGlblDocSaveLinks());
629  if (m_pConfig->IsGlobalActive())
630  ToggleTree();
631  if (bFloatingNavigator)
632  m_xGlobalTree->grab_focus();
633  }
634  else if (bFloatingNavigator)
635  m_xContentTree->grab_focus();
636  UsePage();
637  m_aPageChgIdle.SetInvokeHandler(LINK(this, SwNavigationPI, ChangePageHdl));
638  m_aPageChgIdle.SetPriority(TaskPriority::LOWEST);
639 
640  m_xContentTree->set_accessible_name(SwResId(STR_ACCESS_TL_CONTENT));
641  m_xGlobalTree->set_accessible_name(SwResId(STR_ACCESS_TL_GLOBAL));
642  m_xDocListBox->set_accessible_name(m_aStatusArr[3]);
643 
645 }
646 
648 {
649  disposeOnce();
650 }
651 
653 {
654  if (IsGlobalDoc() && !IsGlobalMode())
655  {
656  SwView *pView = GetCreateView();
657  SwWrtShell &rSh = pView->GetWrtShell();
658  if (!rSh.IsAllProtect())
659  pView->GetDocShell()->SetReadOnlyUI(false);
660  }
661 
663 
664  if (m_pxObjectShell)
665  {
666  if (m_pxObjectShell->Is())
667  (*m_pxObjectShell)->DoClose();
668  m_pxObjectShell.reset();
669  }
670 
671  m_xDocListBox.reset();
672  m_xGlobalTree.reset();
673  m_xGlobalBox.reset();
674  m_xContentTree.reset();
675  m_xContentBox.reset();
676  m_xGlobalToolBox.reset();
677  m_xEdit.reset();
678  m_xHeadingsMenu.reset();
679  m_xDragModeMenu.reset();
680  m_xUpdateMenu.reset();
681  m_xInsertMenu.reset();
682  m_xContent1Dispatch.reset();
683  m_xContent1ToolBox.reset();
684  m_xContent2ToolBox.reset();
685  m_xContent3ToolBox.reset();
686 
688 
691 
693 }
694 
695 void SwNavigationPI::NotifyItemUpdate(sal_uInt16 nSID, SfxItemState /*eState*/,
696  const SfxPoolItem* /*pState*/)
697 {
698  if (nSID == SID_DOCFULLNAME)
699  {
700  SwView *pActView = GetCreateView();
701  if(pActView)
702  {
703  SwWrtShell* pWrtShell = pActView->GetWrtShellPtr();
704  m_xContentTree->SetActiveShell(pWrtShell);
705  bool bGlobal = IsGlobalDoc();
706  m_xContent1ToolBox->set_item_visible("contenttoggle", bGlobal);
707  if ((!bGlobal && IsGlobalMode()) || (!IsGlobalMode() && m_pConfig->IsGlobalActive()))
708  {
709  ToggleTree();
710  }
711  if (bGlobal)
712  {
713  m_xGlobalToolBox->set_item_active("save", pWrtShell->IsGlblDocSaveLinks());
714  }
715  }
716  else
717  {
718  m_xContentTree->SetActiveShell(nullptr);
719  }
720  UpdateListBox();
721  }
722  else if (nSID == FN_STAT_PAGE)
723  {
724  SwView *pActView = GetCreateView();
725  if(pActView)
726  {
727  SwWrtShell &rSh = pActView->GetWrtShell();
728  m_xEdit->set_max(rSh.GetPageCnt());
729  m_xEdit->set_width_chars(3);
730  }
731  }
732 }
733 
735 {
736  PanelLayout::StateChanged(nStateChange);
737  if (nStateChange == StateChangedType::InitShow)
738  {
739  // if the parent isn't a float, then the navigator is displayed in
740  // the sidebar or is otherwise docked. While the navigator could change
741  // its size, the sidebar can not, and the navigator would just waste
742  // space. Therefore disable this button.
743  m_xContent3ToolBox->set_item_sensitive("listbox", SfxChildWindowContext::GetFloatingWindow(GetParent()) != nullptr);
744  // show content if docked
745  if (SfxChildWindowContext::GetFloatingWindow(GetParent()) == nullptr && IsZoomedIn())
746  ZoomOut();
747  }
748  else if (nStateChange == StateChangedType::ControlFocus)
749  {
750  if (m_xContentTree)
751  {
752  // update documents listbox
753  UpdateListBox();
754  }
755  }
756 }
757 
758 // Notification on modified DocInfo
759 void SwNavigationPI::Notify( SfxBroadcaster& rBrdc, const SfxHint& rHint )
760 {
761  if(&rBrdc == m_pCreateView)
762  {
763  if (rHint.GetId() == SfxHintId::Dying)
764  {
766  m_pCreateView = nullptr;
767  }
768  }
769  else
770  {
771  if (const SfxEventHint* pHint = dynamic_cast<const SfxEventHint*>(&rHint))
772  {
773  SfxEventHintId eEventId = pHint->GetEventId();
774  if (eEventId == SfxEventHintId::OpenDoc)
775  {
776  SwView *pActView = GetCreateView();
777  if(pActView)
778  {
779  SwWrtShell* pWrtShell = pActView->GetWrtShellPtr();
780  m_xContentTree->SetActiveShell(pWrtShell);
781  if (m_xGlobalTree->get_visible())
782  {
783  bool bUpdateAll = m_xGlobalTree->Update(false);
784  // If no update is needed, then update the font colors
785  // at the entries of broken links.
786  m_xGlobalTree->Display(!bUpdateAll);
787  }
788  }
789  }
790  }
791  }
792 }
793 
794 IMPL_LINK( SwNavigationPI, HeadingsMenuSelectHdl, const OString&, rMenuId, void )
795 {
796  if (!rMenuId.isEmpty())
797  m_xContentTree->SetOutlineLevel(rMenuId.toUInt32());
798 }
799 
801 {
802  if (isDisposed())
803  return;
804 
805  m_xDocListBox->freeze();
806  m_xDocListBox->clear();
807  SwView *pActView = GetCreateView();
808  bool bDisable = pActView == nullptr;
809  SwView *pView = SwModule::GetFirstView();
810  sal_Int32 nCount = 0;
811  sal_Int32 nAct = 0;
812  sal_Int32 nConstPos = 0;
813  const SwView* pConstView = m_xContentTree->IsConstantView() &&
814  m_xContentTree->GetActiveWrtShell() ?
815  &m_xContentTree->GetActiveWrtShell()->GetView():
816  nullptr;
817  while (pView)
818  {
819  SfxObjectShell* pDoc = pView->GetDocShell();
820  // #i53333# don't show help pages here
821  if ( !pDoc->IsHelpDocument() )
822  {
823  OUString sEntry = pDoc->GetTitle() + " (";
824  if (pView == pActView)
825  {
826  nAct = nCount;
827  sEntry += m_aStatusArr[IDX_STR_ACTIVE];
828  }
829  else
830  sEntry += m_aStatusArr[IDX_STR_INACTIVE];
831  sEntry += ")";
832  m_xDocListBox->append_text(sEntry);
833 
834  if (pConstView && pView == pConstView)
835  nConstPos = nCount;
836 
837  nCount++;
838  }
839  pView = SwModule::GetNextView(pView);
840  }
841  m_xDocListBox->append_text(m_aStatusArr[3]); // "Active Window"
842  nCount++;
843 
844  if(m_xContentTree->GetHiddenWrtShell())
845  {
846  OUString sEntry = m_xContentTree->GetHiddenWrtShell()->GetView().
847  GetDocShell()->GetTitle() +
848  " (" +
849  m_aStatusArr[IDX_STR_HIDDEN] +
850  ")";
851  m_xDocListBox->append_text(sEntry);
852  bDisable = false;
853  }
854 
855  m_xDocListBox->thaw();
856 
857  if(m_xContentTree->IsActiveView())
858  {
859  //Either the name of the current Document or "Active Document".
860  m_xDocListBox->set_active(pActView ? nAct : --nCount);
861  }
862  else if(m_xContentTree->IsHiddenView())
863  {
864  m_xDocListBox->set_active(nCount);
865  }
866  else
867  m_xDocListBox->set_active(nConstPos);
868 
869  m_xDocListBox->set_sensitive(!bDisable);
870 }
871 
872 IMPL_LINK(SwNavigationPI, DoneLink, SfxPoolItem const *, pItem, void)
873 {
874  const SfxViewFrameItem* pFrameItem = dynamic_cast<SfxViewFrameItem const *>( pItem );
875  if( pFrameItem )
876  {
877  SfxViewFrame* pFrame = pFrameItem->GetFrame();
878  if(pFrame)
879  {
880  m_xContentTree->clear();
881  m_pContentView = dynamic_cast<SwView*>( pFrame->GetViewShell() );
882  OSL_ENSURE(m_pContentView, "no SwView");
883  if(m_pContentView)
884  m_pContentWrtShell = m_pContentView->GetWrtShellPtr();
885  else
886  m_pContentWrtShell = nullptr;
887  m_pxObjectShell.reset( new SfxObjectShellLock(pFrame->GetObjectShell()) );
888  FillBox();
889  }
890  }
891 }
892 
894 {
895  OUString sFileName;
896  SotClipboardFormatId nFormat;
897  if( rData.HasFormat( nFormat = SotClipboardFormatId::FILE_LIST ))
898  {
899  FileList aFileList;
900  rData.GetFileList( nFormat, aFileList );
901  sFileName = aFileList.GetFile( 0 );
902  }
903  else if( rData.HasFormat( nFormat = SotClipboardFormatId::STRING ) ||
904  rData.HasFormat( nFormat = SotClipboardFormatId::SIMPLE_FILE ) ||
905  rData.HasFormat( nFormat = SotClipboardFormatId::FILENAME ))
906  {
907  (void)rData.GetString(nFormat, sFileName);
908  }
909  else if( rData.HasFormat( nFormat = SotClipboardFormatId::SOLK ) ||
910  rData.HasFormat( nFormat = SotClipboardFormatId::NETSCAPE_BOOKMARK )||
911  rData.HasFormat( nFormat = SotClipboardFormatId::FILECONTENT ) ||
912  rData.HasFormat( nFormat = SotClipboardFormatId::FILEGRPDESCRIPTOR ) ||
913  rData.HasFormat( nFormat = SotClipboardFormatId::UNIFORMRESOURCELOCATOR ))
914  {
915  INetBookmark aBkmk { OUString(), OUString() };
916  if (rData.GetINetBookmark(nFormat, aBkmk))
917  sFileName = aBkmk.GetURL();
918  }
919  if( !sFileName.isEmpty() )
920  {
922  }
923  return sFileName;
924 }
925 
927 {
928  return ( !m_xContentTree->IsInDrag() &&
929  ( m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::SIMPLE_FILE ) ||
930  m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::STRING ) ||
931  m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::SOLK ) ||
932  m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::NETSCAPE_BOOKMARK )||
933  m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::FILECONTENT ) ||
934  m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::FILEGRPDESCRIPTOR ) ||
935  m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::UNIFORMRESOURCELOCATOR ) ||
936  m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::FILENAME )))
938  : DND_ACTION_NONE;
939 }
940 
942 {
943  TransferableDataHelper aData( rEvt.maDropEvent.Transferable );
944  sal_Int8 nRet = DND_ACTION_NONE;
945  if (m_xContentTree->IsInDrag())
946  return nRet;
947 
948  OUString sFileName = SwNavigationPI::CreateDropFileName(aData);
949  if (sFileName.isEmpty())
950  return nRet;
951 
952  INetURLObject aTemp(sFileName);
953  GraphicDescriptor aDesc(aTemp);
954  if (aDesc.Detect()) // accept no graphics
955  return nRet;
956 
957  if (-1 != sFileName.indexOf('#'))
958  return nRet;
959 
960  if (m_sContentFileName.isEmpty() || m_sContentFileName != sFileName)
961  {
962  nRet = rEvt.mnAction;
963  sFileName = comphelper::string::stripEnd(sFileName, 0);
964  m_sContentFileName = sFileName;
965  if(m_pxObjectShell)
966  {
967  m_xContentTree->SetHiddenShell( nullptr );
968  (*m_pxObjectShell)->DoClose();
969  m_pxObjectShell.reset();
970  }
971  SfxStringItem aFileItem(SID_FILE_NAME, sFileName );
972  SfxStringItem aOptionsItem( SID_OPTIONS, "HRC" );
973  SfxLinkItem aLink( SID_DONELINK,
974  LINK( this, SwNavigationPI, DoneLink ) );
976  SID_OPENDOC, SfxCallMode::ASYNCHRON,
977  { &aFileItem, &aOptionsItem, &aLink });
978  }
979  return nRet;
980 }
981 
983 {
984  m_nRegionMode = nNewMode;
986 
987  OUString sImageId;
988  switch (nNewMode)
989  {
990  case RegionMode::NONE:
991  sImageId = RID_BMP_DROP_REGION;
992  break;
993  case RegionMode::LINK:
994  sImageId = RID_BMP_DROP_LINK;
995  break;
997  sImageId = RID_BMP_DROP_COPY;
998  break;
999  }
1000  m_xContent3ToolBox->set_item_icon_name("dragmode", sImageId);
1001 }
1002 
1004 {
1005  bool bGlobalDoc = IsGlobalDoc();
1006  if (!IsGlobalMode() && bGlobalDoc)
1007  {
1008  SetUpdateMode(false);
1009  if (IsZoomedIn())
1010  ZoomOut();
1011  m_xGlobalBox->show();
1012  m_xGlobalTree->ShowTree();
1013  m_xGlobalToolBox->show();
1014  m_xContentBox->hide();
1015  m_xContentTree->HideTree();
1016  m_xContent1ToolBox->hide();
1017  m_xContent2ToolBox->hide();
1018  m_xContent3ToolBox->hide();
1019  m_xDocListBox->hide();
1020  SetGlobalMode(true);
1021  SetUpdateMode(true);
1022  }
1023  else
1024  {
1025  m_xGlobalBox->hide();
1026  m_xGlobalTree->HideTree();
1027  m_xGlobalToolBox->hide();
1028  if (!IsZoomedIn())
1029  {
1030  m_xContentBox->show();
1031  m_xContentTree->ShowTree();
1032  m_xContent1ToolBox->show();
1033  m_xContent2ToolBox->show();
1034  m_xContent3ToolBox->show();
1035  m_xDocListBox->show();
1036  }
1037  SetGlobalMode(false);
1038  }
1039 }
1040 
1042 {
1043  bool bRet = false;
1044  SwView *pView = GetCreateView();
1045  if (pView)
1046  {
1047  SwWrtShell &rSh = pView->GetWrtShell();
1048  bRet = rSh.IsGlobalDoc();
1049  }
1050  return bRet;
1051 }
1052 
1053 IMPL_LINK_NOARG(SwNavigationPI, ChangePageHdl, Timer *, void)
1054 {
1055  if (IsDisposed())
1056  return;
1057  if (EditAction())
1058  m_xEdit->grab_focus();
1059 }
1060 
1062 {
1063  if (m_aPageChgIdle.IsActive())
1064  m_aPageChgIdle.Stop();
1065  m_aPageChgIdle.Start();
1066 }
1067 
1069 {
1070  if (!m_pCreateView)
1071  {
1072  SwView* pView = SwModule::GetFirstView();
1073  while (pView)
1074  {
1075  if(&pView->GetViewFrame()->GetBindings() == &m_rBindings)
1076  {
1077  const_cast<SwNavigationPI*>(this)->m_pCreateView = pView;
1078  const_cast<SwNavigationPI*>(this)->StartListening(*m_pCreateView);
1079  break;
1080  }
1081  pView = SwModule::GetNextView(pView);
1082  }
1083  }
1084  return m_pCreateView;
1085 }
1086 
1088  sal_uInt16 nId,
1089  SfxBindings* _pBindings )
1090  : SfxChildWindowContext( nId )
1091 {
1092  Reference< XFrame > xFrame = _pBindings->GetActiveFrame();
1093  VclPtr< SwNavigationPI > pNavi = VclPtr< SwNavigationPI >::Create( pParent, xFrame, _pBindings );
1094  _pBindings->Invalidate(SID_NAVIGATOR);
1095 
1096  SwNavigationConfig* pNaviConfig = SW_MOD()->GetNavigationConfig();
1097 
1098  const ContentTypeId nRootType = pNaviConfig->GetRootType();
1099  if( nRootType != ContentTypeId::UNKNOWN )
1100  {
1101  pNavi->m_xContentTree->SetRootType(nRootType);
1102  pNavi->m_xContent2ToolBox->set_item_active("root", true);
1103  if (nRootType == ContentTypeId::OUTLINE)
1104  {
1105  pNavi->m_xContentTree->set_selection_mode(SelectionMode::Multiple);
1106  }
1107  }
1108  pNavi->m_xContentTree->SetOutlineLevel( static_cast< sal_uInt8 >( pNaviConfig->GetOutlineLevel() ) );
1109  pNavi->SetRegionDropMode( pNaviConfig->GetRegionMode() );
1110 
1111  if (SfxNavigator* pNav = dynamic_cast<SfxNavigator*>(pParent))
1112  {
1113  pNav->SetMinOutputSizePixel(pNavi->GetOptimalSize());
1114  if (pNaviConfig->IsSmall())
1115  pNavi->ZoomIn();
1116  }
1117 
1118  SetWindow(pNavi);
1119 }
1120 
1121 /* 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:1087
::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:459
#define FN_TO_FOOTER
Definition: cmdid.h:695
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:689
virtual ~SwNavigationPI() override
Definition: navipi.cxx:647
void SetRegionDropMode(RegionMode nNewMode)
Definition: navipi.cxx:982
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:512
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:119
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:56
void UsePage()
Definition: navipi.cxx:177
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:1208
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:941
SwView * m_pActContView
Definition: navipi.hxx:81
#define FN_TO_HEADER
Definition: cmdid.h:694
#define FN_STAT_PAGE
Definition: cmdid.h:824
#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:800
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:1192
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
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:893
bool EditAction()
Definition: navipi.cxx:399
void ToggleTree()
Definition: navipi.cxx:1003
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:926
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)
SwOutlineNodes::size_type GetOutlinePos(sal_uInt8 nLevel=UCHAR_MAX)
search "outline position" before previous outline node at given level
Definition: crstrvl.cxx:1169
DocumentType eType
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
Definition: uiobject.cxx:164
virtual void dispose() override
Definition: navipi.cxx:652
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:74
int i
sal_uInt16 GetPageCnt()
Definition: crsrsh.cxx:1290
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:695
#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: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:645
Idle m_aPageChgIdle
Definition: navipi.hxx:74
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
OUString SwResId(const char *pId)
Definition: swmodule.cxx:178
void GrabFocus()
SfxViewShell * GetViewShell() const
SwDocShell * GetDocShell()
Definition: view.cxx:1107
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:734
SwView * GetCreateView() const
Definition: navipi.cxx:1068
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:261
void ZoomOut()
Definition: navipi.cxx:427
bool IsGlobalDoc() const
Definition: navipi.cxx:1041
static void RegisterChildWindowContext(SfxModule *pMod)
Definition: navipi.cxx:63
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:499
sal_Int32 GetOutlineLevel() const
Definition: navicfg.hxx:56
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: navipi.cxx:759
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:688
static FloatingWindow * GetFloatingWindow(vcl::Window *pParent)
void ClearMark()
Definition: crsrsh.cxx:938
void FillBox()
Definition: navipi.cxx:152
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:89
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:68
#define FN_END_OF_PAGE
Definition: cmdid.h:646
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:687
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