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 <string>
21 #include <comphelper/string.hxx>
22 #include <svl/urlbmk.hxx>
23 #include <svl/stritem.hxx>
24 #include <vcl/builderfactory.hxx>
25 #include <vcl/graphicfilter.hxx>
26 #include <svl/urihelper.hxx>
27 #include <sot/formats.hxx>
28 #include <sot/filelist.hxx>
29 #include <sfx2/event.hxx>
30 #include <sfx2/dispatch.hxx>
31 #include <sfx2/dockwin.hxx>
32 #include <sfx2/navigat.hxx>
33 #include <sfx2/viewfrm.hxx>
34 #include <vcl/toolbox.hxx>
35 #include <vcl/settings.hxx>
36 #include <swtypes.hxx>
37 #include <swmodule.hxx>
38 #include <view.hxx>
39 #include <navicfg.hxx>
40 #include <wrtsh.hxx>
41 #include <docsh.hxx>
42 #include <actctrl.hxx>
43 #include <IMark.hxx>
44 #include <navipi.hxx>
45 #include <content.hxx>
46 #include <workctrl.hxx>
47 #include <section.hxx>
48 #include <edtwin.hxx>
49 #include <sfx2/app.hxx>
50 #include <cmdid.h>
51 #include <helpids.h>
52 
53 #include <strings.hrc>
54 #include <globals.hrc>
55 #include <bitmaps.hlst>
56 
57 #include <unomid.h>
58 #include <memory>
59 
60 #include <uiobject.hxx>
61 
62 using namespace ::com::sun::star::uno;
63 using namespace ::com::sun::star::frame;
64 
66 std::unique_ptr<SfxChildWindowContext> SwNavigationChild::CreateImpl( vcl::Window *pParent,
67  SfxBindings *pBindings, SfxChildWinInfo* /*pInfo*/ )
68 {
69  return std::make_unique<SwNavigationChild>(pParent,
70  /* cast is safe here! */static_cast< sal_uInt16 >(SwView::GetInterfaceId()),
71  pBindings);
72 }
74 {
75  auto pFact = std::make_unique<SfxChildWinContextFactory>(
77  /* cast is safe here! */static_cast< sal_uInt16 >(SwView::GetInterfaceId()) );
78  SfxChildWindowContext::RegisterChildWindowContext(pMod, SID_NAVIGATOR, std::move(pFact));
79 }
80 
81 
82 // Filter the control characters out of the Outline-Entry
83 
84 OUString SwNavigationPI::CleanEntry(const OUString& rEntry)
85 {
86  if (rEntry.isEmpty())
87  return rEntry;
88 
89  OUStringBuffer aEntry(rEntry);
90  for (sal_Int32 i = 0; i < rEntry.getLength(); ++i)
91  if(aEntry[i] == 10 || aEntry[i] == 9)
92  aEntry[i] = 0x20;
93 
94  return aEntry.makeStringAndClear();
95 }
96 
97 // Execution of the drag operation with and without the children.
98 
100  bool bWithChildren)
101 {
102  SwView *pView = GetCreateView();
103  SwWrtShell &rSh = pView->GetWrtShell();
104  if(nTarget < nSource || nTarget == SwOutlineNodes::npos)
105  nTarget ++;
106  if ( rSh.IsOutlineMovable( nSource ))
107  {
108 
109  SwOutlineNodes::difference_type nMove = nTarget-nSource; //( nDir<0 ) ? 1 : 0 ;
110  rSh.GotoOutline(nSource);
111  if (bWithChildren)
112  rSh.MakeOutlineSel(nSource, nSource, true);
113  // While moving, the selected children does not counting.
114  const SwOutlineNodes::size_type nLastOutlinePos = rSh.GetOutlinePos(MAXLEVEL);
115  if(bWithChildren && nMove > 1 &&
116  nLastOutlinePos < nTarget)
117  {
118  if(!rSh.IsCursorPtAtEnd())
119  rSh.SwapPam();
120  nMove -= nLastOutlinePos - nSource;
121  }
122  if(!bWithChildren || nMove < 1 || nLastOutlinePos < nTarget )
123  rSh.MoveOutlinePara( nMove );
124  rSh.ClearMark();
125  rSh.GotoOutline( nSource + nMove);
126  }
127 
128 }
129 
130 // After goto cancel the status frame selection
131 
132 static void lcl_UnSelectFrame(SwWrtShell *pSh)
133 {
134  if (pSh->IsFrameSelected())
135  {
136  pSh->UnSelectFrame();
137  pSh->LeaveSelFrameMode();
138  }
139 }
140 
141 // Select the document view
142 
143 IMPL_LINK( SwNavigationPI, DocListBoxSelectHdl, ListBox&, rBox, void )
144 {
145  int nEntryIdx = rBox.GetSelectedEntryPos();
146  SwView *pView ;
147  pView = SwModule::GetFirstView();
148  while (nEntryIdx-- && pView)
149  {
150  pView = SwModule::GetNextView(pView);
151  }
152  if(!pView)
153  {
154  nEntryIdx == 0 ?
155  m_aContentTree->ShowHiddenShell():
156  m_aContentTree->ShowActualView();
157 
158  }
159  else
160  {
161  m_aContentTree->SetConstantShell(pView->GetWrtShellPtr());
162  }
163 }
164 
165 // Filling of the list box for outline view or documents
166 // The PI will be set to full size
167 
169 {
171  {
173  m_aContentTree->Display( false );
174  }
175  else
176  {
177  SwView *pView = GetCreateView();
178  if(!pView)
179  {
180  m_aContentTree->SetActiveShell(nullptr);
181  }
182  else if( pView != m_pActContView)
183  {
184  SwWrtShell* pWrtShell = pView->GetWrtShellPtr();
185  m_aContentTree->SetActiveShell(pWrtShell);
186  }
187  else
188  m_aContentTree->Display( true );
189  m_pActContView = pView;
190  }
191 }
192 
194 {
195  SwView *pView = GetCreateView();
196  SwWrtShell *pSh = pView ? &pView->GetWrtShell() : nullptr;
197  GetPageEdit().SetValue(1);
198  if (pSh)
199  {
200  const sal_uInt16 nPageCnt = pSh->GetPageCnt();
201  sal_uInt16 nPhyPage, nVirPage;
202  pSh->GetPageNum(nPhyPage, nVirPage);
203 
204  GetPageEdit().SetMax(nPageCnt);
205  GetPageEdit().SetLast(nPageCnt);
206  GetPageEdit().SetValue(nPhyPage);
207  }
208 }
209 
210 // Select handler of the toolboxes
211 
212 IMPL_LINK( SwNavigationPI, ToolBoxSelectHdl, ToolBox *, pBox, void )
213 {
214  const sal_uInt16 nCurrItemId = pBox->GetCurItemId();
215  const OUString sCommand = pBox->GetItemCommand(nCurrItemId);
216  SwView *pView = GetCreateView();
217  if (!pView)
218  return;
219  SwWrtShell &rSh = pView->GetWrtShell();
220  // Get MouseModifier for Outline-Move
221 
222  // Standard: sublevels are taken
223  // do not take sublevels with Ctrl
224  bool bOutlineWithChildren = ( KEY_MOD1 != pBox->GetModifier());
225  int nFuncId = 0;
226  bool bFocusToDoc = false;
227  if (sCommand == "back")
228  {
229  // #i75416# move the execution of the search to an asynchronously called static link
230  bool* pbNext = new bool(false);
231  Application::PostUserEvent(LINK(pView, SwView, MoveNavigationHdl), pbNext);
232  }
233  else if (sCommand == "forward")
234  {
235  // #i75416# move the execution of the search to an asynchronously called static link
236  bool* pbNext = new bool(true);
237  Application::PostUserEvent(LINK(pView, SwView, MoveNavigationHdl), pbNext);
238  }
239  else if (sCommand == "root")
240  {
241  m_aContentTree->ToggleToRoot();
242  }
243  else if (sCommand == "listbox")
244  {
246  {
247  if (IsZoomedIn())
248  {
249  ZoomOut();
250  }
251  else
252  {
253  ZoomIn();
254  }
255  }
256  return;
257  }
258  // Functions that will trigger a direct action.
259  else if (sCommand == "footer")
260  {
261  rSh.MoveCursor();
262  const FrameTypeFlags eType = rSh.GetFrameType(nullptr,false);
263  if (eType & FrameTypeFlags::FOOTER)
264  {
265  if (rSh.EndPg())
266  nFuncId = FN_END_OF_PAGE;
267  }
268  else if (rSh.GotoFooterText())
269  nFuncId = FN_TO_FOOTER;
270  bFocusToDoc = true;
271  }
272  else if (sCommand == "header")
273  {
274  rSh.MoveCursor();
275  const FrameTypeFlags eType = rSh.GetFrameType(nullptr,false);
276  if (eType & FrameTypeFlags::HEADER)
277  {
278  if (rSh.SttPg())
279  nFuncId = FN_START_OF_PAGE;
280  }
281  else if (rSh.GotoHeaderText())
282  nFuncId = FN_TO_HEADER;
283  bFocusToDoc = true;
284  }
285  else if (sCommand == "anchor")
286  {
287  rSh.MoveCursor();
288  const FrameTypeFlags eFrameType = rSh.GetFrameType(nullptr,false);
289  // Jump from the footnote to the anchor.
290  if (eFrameType & FrameTypeFlags::FOOTNOTE)
291  {
292  if (rSh.GotoFootnoteAnchor())
293  nFuncId = FN_FOOTNOTE_TO_ANCHOR;
294  }
295  // Otherwise, jump to the first footnote text;
296  // go to the next footnote if this is not possible;
297  // if this is also not possible got to the footnote before.
298  else
299  {
300  if (rSh.GotoFootnoteText())
301  nFuncId = FN_FOOTNOTE_TO_ANCHOR;
302  else if (rSh.GotoNextFootnoteAnchor())
303  nFuncId = FN_NEXT_FOOTNOTE;
304  else if (rSh.GotoPrevFootnoteAnchor())
305  nFuncId = FN_PREV_FOOTNOTE;
306  }
307  bFocusToDoc = true;
308  }
309  else if (sCommand == "reminder")
310  {
311  MakeMark();
312  }
313  else if (sCommand == "down" ||
314  sCommand == "up" ||
315  sCommand == "promote" ||
316  sCommand == "demote" ||
317  sCommand == "edit")
318  {
319  if (IsGlobalMode())
320  m_aGlobalTree->ExecCommand(sCommand);
321  else
322  m_aContentTree->ExecCommand(sCommand, bOutlineWithChildren);
323  }
324  else if (sCommand == "toggle")
325  {
326  ToggleTree();
327  m_pConfig->SetGlobalActive(IsGlobalMode());
328  }
329  else if (sCommand == "save")
330  {
331  bool bSave = rSh.IsGlblDocSaveLinks();
332  rSh.SetGlblDocSaveLinks( !bSave );
333  pBox->CheckItem(nCurrItemId, !bSave );
334  }
335 
336  if (nFuncId)
337  lcl_UnSelectFrame(&rSh);
338  if (bFocusToDoc)
339  pView->GetEditWin().GrabFocus();
340 }
341 
342 // Click handler of the toolboxes
343 
344 IMPL_LINK( SwNavigationPI, ToolBoxClickHdl, ToolBox *, pBox, void )
345 {
346  const sal_uInt16 nCurrItemId = pBox->GetCurItemId();
347  const OUString sCommand = pBox->GetItemCommand(nCurrItemId);
348  if (sCommand == "update" || sCommand == "insert")
349  m_aGlobalTree->TbxMenuHdl(nCurrItemId, pBox);
350 }
351 
352 IMPL_LINK( SwNavigationPI, ToolBoxDropdownClickHdl, ToolBox*, pBox, void )
353 {
354  const sal_uInt16 nCurrItemId = pBox->GetCurItemId();
355  const OUString sCommand = pBox->GetItemCommand(nCurrItemId);
356  if (sCommand == "navigation")
357  CreateNavigationTool(pBox->GetItemRect(nCurrItemId), true, this);
358  else if (sCommand == "dragmode")
359  {
360  static const char* aHIDs[] =
361  {
365  };
367  for (sal_uInt16 i = 0; i <= static_cast<sal_uInt16>(RegionMode::EMBEDDED); ++i)
368  {
369  pMenu->InsertItem(i + 1, m_aContextArr[i], MenuItemBits::RADIOCHECK);
370  pMenu->SetHelpId(i + 1, aHIDs[i]);
371  }
372  pMenu->CheckItem( static_cast<int>(m_nRegionMode) + 1 );
373  pMenu->SetSelectHdl(LINK(this, SwNavigationPI, MenuSelectHdl));
374  pBox->SetItemDown(nCurrItemId, true);
375  pMenu->Execute(pBox, pBox->GetItemRect(nCurrItemId), PopupMenuFlags::ExecuteDown);
376  pBox->SetItemDown(nCurrItemId, false);
377  pBox->EndSelection();
378  pMenu.disposeAndClear();
379  pBox->Invalidate();
380  }
381  else if (sCommand == "headings")
382  {
384  for (sal_uInt16 i = 101; i <= 100 + MAXLEVEL; ++i)
385  {
386  pMenu->InsertItem(i, OUString::number(i - 100), MenuItemBits::RADIOCHECK);
387  pMenu->SetHelpId(i, HID_NAVI_OUTLINES);
388  }
389  pMenu->CheckItem( m_aContentTree->GetOutlineLevel() + 100 );
390  pMenu->SetSelectHdl(LINK(this, SwNavigationPI, MenuSelectHdl));
391  pBox->SetItemDown( nCurrItemId, true );
392  pMenu->Execute(pBox, pBox->GetItemRect(nCurrItemId), PopupMenuFlags::ExecuteDown);
393  pBox->SetItemDown( nCurrItemId, false );
394  pMenu.disposeAndClear();
395  pBox->EndSelection();
396  pBox->Invalidate();
397  }
398 }
399 
401  : ToolBox(pParent)
402 {
403 }
404 
406 
407 void SwNavHelpToolBox::MouseButtonDown(const MouseEvent &rEvt)
408 {
409  sal_uInt16 nItemId = GetItemId(rEvt.GetPosPixel());
410  if (rEvt.GetButtons() == MOUSE_LEFT && GetItemCommand(nItemId) == "navigation")
411  {
412  m_xDialog->CreateNavigationTool(GetItemRect(nItemId), false, this);
413  return;
414  }
416 }
417 
418 void SwNavigationPI::CreateNavigationTool(const tools::Rectangle& rRect, bool bSetFocus, vcl::Window *pParent)
419 {
420  Reference< XFrame > xFrame = GetCreateView()->GetViewFrame()->GetFrame().GetFrameInterface();
422 
423  tools::Rectangle aRect(rRect);
424  Point aT1 = aRect.TopLeft();
425  aT1 = pPopup->GetParent()->OutputToScreenPixel(pPopup->GetParent()->AbsoluteScreenToOutputPixel(m_aContentToolBox->OutputToAbsoluteScreenPixel(aT1)));
426  aRect.SetPos(aT1);
427  pPopup->StartPopupMode(aRect, FloatWinPopupFlags::Right|FloatWinPopupFlags::AllowTearOff);
428  SetPopupWindow( pPopup );
429  if(bSetFocus)
430  {
431  pPopup->EndPopupMode(FloatWinPopupEndFlags::TearOff);
432  pPopup->GrabFocus();
433  }
434 }
435 
437 {
439 }
440 
442 {
443  const sal_uInt16 nItemId = GetItemId(ScreenToOutputPixel(rHEvt.GetMousePosPixel()));
444  const OUString sCommand(GetItemCommand(nItemId));
445  if (sCommand == "back")
447  else if (sCommand == "forward")
449  ToolBox::RequestHelp(rHEvt);
450 }
451 
453 {
454  m_xDialog.clear();
456 }
457 
459 {
460  disposeOnce();
461 }
462 
463 // Action-Handler Edit:
464 // Switches to the page if the structure view is not turned on.
465 
466 IMPL_LINK( SwNavigationPI, EditAction, NumEditAction&, rEdit, void )
467 {
468  SwView *pView = GetCreateView();
469  if (pView)
470  {
471  if(m_aPageChgIdle.IsActive())
472  m_aPageChgIdle.Stop();
473  m_pCreateView->GetWrtShell().GotoPage(static_cast<sal_uInt16>(rEdit.GetValue()), true);
474  m_pCreateView->GetEditWin().GrabFocus();
475  m_pCreateView->GetViewFrame()->GetBindings().Invalidate(FN_STAT_PAGE);
476  }
477 }
478 
479 // If the page can be set here, the maximum is set.
480 
481 IMPL_LINK( SwNavigationPI, EditGetFocus, Control&, rControl, void )
482 {
483  NumEditAction* pEdit = static_cast<NumEditAction*>(&rControl);
484  SwView *pView = GetCreateView();
485  if (!pView)
486  return;
487  SwWrtShell &rSh = pView->GetWrtShell();
488 
489  const sal_uInt16 nPageCnt = rSh.GetPageCnt();
490  pEdit->SetMax(nPageCnt);
491  pEdit->SetLast(nPageCnt);
492 }
493 
494 // Setting of an automatic mark
496 {
497  SwView *pView = GetCreateView();
498  if (!pView) return;
499  SwWrtShell &rSh = pView->GetWrtShell();
500  IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess();
501 
502  // collect and sort navigator reminder names
503  std::vector< OUString > vNavMarkNames;
504  for(IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getAllMarksBegin();
505  ppMark != pMarkAccess->getAllMarksEnd();
506  ++ppMark)
508  vNavMarkNames.push_back((*ppMark)->GetName());
509  std::sort(vNavMarkNames.begin(), vNavMarkNames.end());
510 
511  // we are maxed out and delete one
512  // nAutoMarkIdx rotates through the available MarkNames
513  // this assumes that IDocumentMarkAccess generates Names in ascending order
514  if(vNavMarkNames.size() == MAX_MARKS)
515  pMarkAccess->deleteMark(pMarkAccess->findMark(vNavMarkNames[m_nAutoMarkIdx]));
516 
518  SwView::SetActMark( m_nAutoMarkIdx );
519 
520  if(++m_nAutoMarkIdx == MAX_MARKS)
521  m_nAutoMarkIdx = 0;
522 }
523 
525 {
526  if (!IsZoomedIn())
527  return;
528  SfxNavigator* pNav = dynamic_cast<SfxNavigator*>(GetParent());
529  if (!pNav)
530  return;
531  m_bIsZoomedIn = false;
532  FillBox();
533  if (IsGlobalMode())
534  {
535  m_aGlobalBox->Show();
537  }
538  else
539  {
540  m_aContentBox->Show();
542  m_aDocListBox->Show();
543  }
544 
545  Size aOptimalSize(GetOptimalSize());
546  Size aNewSize(pNav->GetOutputSizePixel());
547  aNewSize.setHeight( m_aExpandedSize.Height() );
548  pNav->SetMinOutputSizePixel(aOptimalSize);
549  pNav->SetOutputSizePixel(aNewSize);
550 
552  if (pFirst)
553  m_aContentTree->Select(pFirst); // Enable toolbox
554  m_pConfig->SetSmall(false);
556 }
557 
559 {
560  if (IsZoomedIn())
561  return;
562  SfxNavigator* pNav = dynamic_cast<SfxNavigator*>(GetParent());
563  if (!pNav)
564  return;
565 
566  m_aExpandedSize = GetSizePixel();
567 
568  m_aContentBox->Hide();
570  m_aGlobalBox->Hide();
572  m_aDocListBox->Hide();
573  m_bIsZoomedIn = true;
574 
575  Size aOptimalSize(GetOptimalSize());
576  Size aNewSize(pNav->GetOutputSizePixel());
577  aNewSize.setHeight( aOptimalSize.Height() );
578  pNav->SetMinOutputSizePixel(aOptimalSize);
579  pNav->SetOutputSizePixel(aNewSize);
580 
582  if (pFirst)
583  m_aContentTree->Select(pFirst); // Enable toolbox
584  m_pConfig->SetSmall(true);
586 }
587 
588 namespace {
589 
591 {
592  IDX_STR_HIDDEN = 0,
593  IDX_STR_ACTIVE = 1,
594  IDX_STR_INACTIVE = 2
595 };
596 
597 }
598 
600  vcl::Window* pParent)
601  : PanelLayout(pParent, "NavigatorPanel", "modules/swriter/ui/navigatorpanel.ui", nullptr)
602  , SfxControllerItem(SID_DOCFULLNAME, *_pBindings)
603  , m_pContentView(nullptr)
604  , m_pContentWrtShell(nullptr)
605  , m_pActContView(nullptr)
606  , m_pCreateView(nullptr)
607  , m_pPopupWindow(nullptr)
608  , m_pFloatingWindow(nullptr)
609  , m_pConfig(SW_MOD()->GetNavigationConfig())
610  , m_rBindings(*_pBindings)
611  , m_nAutoMarkIdx(1)
612  , m_nRegionMode(RegionMode::NONE)
613  , m_bIsZoomedIn(false)
614  , m_bGlobalMode(false)
615 {
616  get(m_aContentToolBox, "content");
620  get(m_aGlobalToolBox, "global");
621  get(m_aDocListBox, "documents");
622 
623  get(m_aContentBox, "contentbox");
625  m_aContentTree->set_expand(true);
626  get(m_aGlobalBox, "globalbox");
628  m_aGlobalTree->set_expand(true);
629 
630  GetCreateView();
631 
637 
638  // Insert the numeric field in the toolbox.
641  m_xEdit->SetMin(1);
642  m_xEdit->SetFirst(1);
643  m_xEdit->SetActionHdl(LINK(this, SwNavigationPI, EditAction));
644  m_xEdit->SetGetFocusHdl(LINK(this, SwNavigationPI, EditGetFocus));
646  m_xEdit->SetUpHdl(LINK(this, SwNavigationPI, PageEditModifyHdl));
647  m_xEdit->SetDownHdl(LINK(this, SwNavigationPI, PageEditModifyHdl));
648 
649  // Double separators are not allowed, so you have to
650  // determine the suitable size differently.
653  Size aItemWinSize( aFirstRect.Left() - aSecondRect.Left(),
654  aFirstRect.Bottom() - aFirstRect.Top() );
656  aItemWinSize.setWidth( std::max(aItemWinSize.Width(), aOptimalSize.Width()) );
657  m_xEdit->SetSizePixel(aItemWinSize);
659  m_aContentToolBox->InsertWindow( FN_PAGENUMBER, m_xEdit, ToolBoxItemBits::NONE, 4);
661  m_aContentToolBox->SetHelpId(FN_PAGENUMBER, "modules/swriter/ui/navigatorpanel/numericfield");
663  if (!IsGlobalDoc())
664  {
666  }
667 
668  const char* REGIONNAME_ARY[] =
669  {
670  STR_HYPERLINK,
671  STR_LINK_REGION,
672  STR_COPY_REGION
673  };
674 
675  const char* REGIONMODE_ARY[] =
676  {
677  STR_HIDDEN,
678  STR_ACTIVE,
679  STR_INACTIVE
680  };
681 
682  static_assert(SAL_N_ELEMENTS(REGIONNAME_ARY) == SAL_N_ELEMENTS(REGIONMODE_ARY), "### unexpected size!");
683  static_assert(SAL_N_ELEMENTS(REGIONNAME_ARY) == static_cast<sal_uInt16>(RegionMode::EMBEDDED) + 1, "### unexpected size!");
684 
685  for (sal_uInt16 i = 0; i <= static_cast<sal_uInt16>(RegionMode::EMBEDDED); ++i)
686  {
687  m_aContextArr[i] = SwResId(REGIONNAME_ARY[i]);
688  m_aStatusArr[i] = SwResId(REGIONMODE_ARY[i]);
689  }
690 
691  m_aStatusArr[3] = SwResId(STR_ACTIVE_VIEW);
692 
697  m_aContentTree->SetSelectionMode(SelectionMode::Single);
698  m_aContentTree->SetDragDropMode(DragDropMode::CTRL_MOVE |
699  DragDropMode::CTRL_COPY |
700  DragDropMode::ENABLE_TOP);
704 
705 // TreeListBox for global document
706  m_aGlobalTree->SetSelectionMode( SelectionMode::Multiple );
709 
710 // Handler
711  Link<ToolBox *, void> aLk = LINK(this, SwNavigationPI, ToolBoxSelectHdl);
715  DocListBoxSelectHdl));
716  m_aContentToolBox->SetClickHdl( LINK(this, SwNavigationPI, ToolBoxClickHdl) );
717  m_aContentToolBox->SetDropdownClickHdl( LINK(this, SwNavigationPI, ToolBoxDropdownClickHdl) );
718  m_aGlobalToolBox->SetClickHdl( LINK(this, SwNavigationPI, ToolBoxClickHdl) );
719  m_aGlobalToolBox->SetDropdownClickHdl( LINK(this, SwNavigationPI, ToolBoxDropdownClickHdl) );
721 
722  vcl::Font aFont(GetFont());
723  aFont.SetWeight(WEIGHT_NORMAL);
724  GetPageEdit().SetFont(aFont);
725  aFont = m_aContentTree->GetFont();
726  aFont.SetWeight(WEIGHT_NORMAL);
727  m_aContentTree->SetFont(aFont);
728  m_aGlobalTree->SetFont(aFont);
729 
731 
732  sal_uInt16 nNavId = m_aContentToolBox->GetItemId("navigation");
733  m_aContentToolBox->SetItemBits(nNavId, m_aContentToolBox->GetItemBits(nNavId) | ToolBoxItemBits::DROPDOWNONLY );
734  sal_uInt16 nDropId = m_aContentToolBox->GetItemId("dragmode");
735  m_aContentToolBox->SetItemBits(nDropId, m_aContentToolBox->GetItemBits(nDropId) | ToolBoxItemBits::DROPDOWNONLY );
736  sal_uInt16 nOutlineId = m_aContentToolBox->GetItemId("headings");
737  m_aContentToolBox->SetItemBits(nOutlineId, m_aContentToolBox->GetItemBits(nOutlineId) | ToolBoxItemBits::DROPDOWNONLY );
738 
739  if(IsGlobalDoc())
740  {
741  SwView *pActView = GetCreateView();
743  pActView->GetWrtShellPtr()->IsGlblDocSaveLinks());
744  if (m_pConfig->IsGlobalActive())
745  ToggleTree();
747  }
748  else
750  UsePage();
751  m_aPageChgIdle.SetInvokeHandler(LINK(this, SwNavigationPI, ChangePageHdl));
752  m_aPageChgIdle.SetPriority(TaskPriority::LOWEST);
753 
754  m_aContentTree->SetAccessibleName(SwResId(STR_ACCESS_TL_CONTENT));
755  m_aGlobalTree->SetAccessibleName(SwResId(STR_ACCESS_TL_GLOBAL));
757 
759 }
760 
762 {
763  disposeOnce();
764 }
765 
767 {
768  if (IsGlobalDoc() && !IsGlobalMode())
769  {
770  SwView *pView = GetCreateView();
771  SwWrtShell &rSh = pView->GetWrtShell();
772  if (!rSh.IsAllProtect())
773  pView->GetDocShell()->SetReadOnlyUI(false);
774  }
775 
777 
780  if (m_pxObjectShell)
781  {
782  if (m_pxObjectShell->Is())
783  (*m_pxObjectShell)->DoClose();
784  m_pxObjectShell.reset();
785  }
786 
787  if (IsBound())
788  m_rBindings.Release(*this);
789 
800 
802 
804 
806 }
807 
809 {
811  m_pPopupWindow = pWindow;
812  m_pPopupWindow->SetPopupModeEndHdl( LINK( this, SwNavigationPI, PopupModeEndHdl ));
813  m_pPopupWindow->SetDeleteLink_Impl( LINK( this, SwNavigationPI, ClosePopupWindow ));
814 }
815 
817 {
818  if ( m_pPopupWindow->IsVisible() )
819  {
820  // Replace floating window with popup window and destroy
821  // floating window instance.
822  m_pFloatingWindow.disposeAndClear();
823  m_pFloatingWindow = m_pPopupWindow;
824  m_pPopupWindow = nullptr;
825  }
826  else
827  {
828  // Popup window has been closed by the user. No replacement, instance
829  // will destroy itself.
830  m_pPopupWindow = nullptr;
831  }
832 }
833 
834 IMPL_LINK( SwNavigationPI, ClosePopupWindow, SfxPopupWindow *, pWindow, void )
835 {
836  if ( pWindow == m_pFloatingWindow )
837  m_pFloatingWindow = nullptr;
838  else
839  m_pPopupWindow = nullptr;
840 }
841 
842 void SwNavigationPI::StateChanged( sal_uInt16 nSID, SfxItemState /*eState*/,
843  const SfxPoolItem* /*pState*/ )
844 {
845  if(nSID == SID_DOCFULLNAME)
846  {
847  SwView *pActView = GetCreateView();
848  if(pActView)
849  {
850  SwWrtShell* pWrtShell = pActView->GetWrtShellPtr();
851  m_aContentTree->SetActiveShell(pWrtShell);
852  bool bGlobal = IsGlobalDoc();
854  if ((!bGlobal && IsGlobalMode()) || (!IsGlobalMode() && m_pConfig->IsGlobalActive()))
855  {
856  ToggleTree();
857  }
858  if (bGlobal)
859  {
861  }
862  }
863  else
864  {
865  m_aContentTree->SetActiveShell(nullptr);
866  }
867  UpdateListBox();
868  }
869 }
870 
872 {
873  PanelLayout::StateChanged(nStateChange);
874  if (nStateChange == StateChangedType::InitShow)
875  {
876  // if the parent isn't a float, then the navigator is displayed in
877  // the sidebar or is otherwise docked. While the navigator could change
878  // its size, the sidebar can not, and the navigator would just waste
879  // space. Therefore hide this button.
881  }
882  else if (nStateChange == StateChangedType::ControlFocus)
883  {
884  if (m_aContentTree)
885  {
886  // update documents listbox
887  UpdateListBox();
888  }
889  }
890 }
891 
892 // Get the numeric field from the toolbox.
893 
895 {
897 }
898 
899 // Notification on modified DocInfo
900 void SwNavigationPI::Notify( SfxBroadcaster& rBrdc, const SfxHint& rHint )
901 {
902  if(&rBrdc == m_pCreateView)
903  {
904  if (rHint.GetId() == SfxHintId::Dying)
905  {
907  m_pCreateView = nullptr;
908  }
909  }
910  else
911  {
912  if (const SfxEventHint* pHint = dynamic_cast<const SfxEventHint*>(&rHint))
913  {
914  if (pHint->GetEventId() == SfxEventHintId::OpenDoc)
915  {
916  SwView *pActView = GetCreateView();
917  if(pActView)
918  {
919  SwWrtShell* pWrtShell = pActView->GetWrtShellPtr();
920  m_aContentTree->SetActiveShell(pWrtShell);
921  if(m_aGlobalTree->IsVisible())
922  {
923  if(m_aGlobalTree->Update( false ))
925  else
926  // If no update is needed, then paint at least,
927  // because of the red entries for the broken links.
929  }
930  }
931  }
932  }
933  }
934 }
935 
936 IMPL_LINK( SwNavigationPI, MenuSelectHdl, Menu *, pMenu, bool )
937 {
938  sal_uInt16 nMenuId = pMenu->GetCurItemId();
939  if(nMenuId != USHRT_MAX)
940  {
941  if(nMenuId < 100)
942  SetRegionDropMode( static_cast<RegionMode>(--nMenuId));
943  else
944  m_aContentTree->SetOutlineLevel( static_cast< sal_uInt8 >(nMenuId - 100) );
945  }
946  return false;
947 }
948 
950 {
951  if (isDisposed())
952  return;
953 
955  m_aDocListBox->Clear();
956  SwView *pActView = GetCreateView();
957  bool bDisable = pActView == nullptr;
958  SwView *pView = SwModule::GetFirstView();
959  sal_Int32 nCount = 0;
960  sal_Int32 nAct = 0;
961  sal_Int32 nConstPos = 0;
962  const SwView* pConstView = m_aContentTree->IsConstantView() &&
965  nullptr;
966  while (pView)
967  {
968  SfxObjectShell* pDoc = pView->GetDocShell();
969  // #i53333# don't show help pages here
970  if ( !pDoc->IsHelpDocument() )
971  {
972  OUString sEntry = pDoc->GetTitle() + " (";
973  if (pView == pActView)
974  {
975  nAct = nCount;
976  sEntry += m_aStatusArr[IDX_STR_ACTIVE];
977  }
978  else
979  sEntry += m_aStatusArr[IDX_STR_INACTIVE];
980  sEntry += ")";
981  m_aDocListBox->InsertEntry(sEntry);
982 
983  if (pConstView && pView == pConstView)
984  nConstPos = nCount;
985 
986  nCount++;
987  }
988  pView = SwModule::GetNextView(pView);
989  }
990  m_aDocListBox->InsertEntry(m_aStatusArr[3]); // "Active Window"
991  nCount++;
992 
994  {
995  OUString sEntry = m_aContentTree->GetHiddenWrtShell()->GetView().
996  GetDocShell()->GetTitle() +
997  " (" +
998  m_aStatusArr[IDX_STR_HIDDEN] +
999  ")";
1000  m_aDocListBox->InsertEntry(sEntry);
1001  bDisable = false;
1002  }
1004  {
1005  //Either the name of the current Document or "Active Document".
1006  m_aDocListBox->SelectEntryPos( pActView ? nAct : --nCount );
1007  }
1008  else if(m_aContentTree->IsHiddenView())
1009  {
1010  m_aDocListBox->SelectEntryPos(nCount);
1011  }
1012  else
1013  m_aDocListBox->SelectEntryPos(nConstPos);
1014 
1015  m_aDocListBox->Enable( !bDisable );
1017 }
1018 
1019 IMPL_LINK(SwNavigationPI, DoneLink, SfxPoolItem const *, pItem, void)
1020 {
1021  const SfxViewFrameItem* pFrameItem = dynamic_cast<SfxViewFrameItem const *>( pItem );
1022  if( pFrameItem )
1023  {
1024  SfxViewFrame* pFrame = pFrameItem->GetFrame();
1025  if(pFrame)
1026  {
1027  m_aContentTree->Clear();
1028  m_pContentView = dynamic_cast<SwView*>( pFrame->GetViewShell() );
1029  OSL_ENSURE(m_pContentView, "no SwView");
1030  if(m_pContentView)
1031  m_pContentWrtShell = m_pContentView->GetWrtShellPtr();
1032  else
1033  m_pContentWrtShell = nullptr;
1034  m_pxObjectShell.reset( new SfxObjectShellLock(pFrame->GetObjectShell()) );
1035  FillBox();
1036  m_aContentTree->Update();
1037  }
1038  }
1039 }
1040 
1042 {
1043  OUString sFileName;
1044  SotClipboardFormatId nFormat;
1045  if( rData.HasFormat( nFormat = SotClipboardFormatId::FILE_LIST ))
1046  {
1047  FileList aFileList;
1048  rData.GetFileList( nFormat, aFileList );
1049  sFileName = aFileList.GetFile( 0 );
1050  }
1051  else if( rData.HasFormat( nFormat = SotClipboardFormatId::STRING ) ||
1052  rData.HasFormat( nFormat = SotClipboardFormatId::SIMPLE_FILE ) ||
1053  rData.HasFormat( nFormat = SotClipboardFormatId::FILENAME ))
1054  {
1055  (void)rData.GetString(nFormat, sFileName);
1056  }
1057  else if( rData.HasFormat( nFormat = SotClipboardFormatId::SOLK ) ||
1058  rData.HasFormat( nFormat = SotClipboardFormatId::NETSCAPE_BOOKMARK )||
1059  rData.HasFormat( nFormat = SotClipboardFormatId::FILECONTENT ) ||
1060  rData.HasFormat( nFormat = SotClipboardFormatId::FILEGRPDESCRIPTOR ) ||
1061  rData.HasFormat( nFormat = SotClipboardFormatId::UNIFORMRESOURCELOCATOR ))
1062  {
1063  INetBookmark aBkmk { OUString(), OUString() };
1064  if (rData.GetINetBookmark(nFormat, aBkmk))
1065  sFileName = aBkmk.GetURL();
1066  }
1067  if( !sFileName.isEmpty() )
1068  {
1070  }
1071  return sFileName;
1072 }
1073 
1075 {
1076  return ( !SwContentTree::IsInDrag() &&
1077  ( m_aContentTree->IsDropFormatSupported( SotClipboardFormatId::SIMPLE_FILE ) ||
1078  m_aContentTree->IsDropFormatSupported( SotClipboardFormatId::STRING ) ||
1079  m_aContentTree->IsDropFormatSupported( SotClipboardFormatId::SOLK ) ||
1080  m_aContentTree->IsDropFormatSupported( SotClipboardFormatId::NETSCAPE_BOOKMARK )||
1081  m_aContentTree->IsDropFormatSupported( SotClipboardFormatId::FILECONTENT ) ||
1082  m_aContentTree->IsDropFormatSupported( SotClipboardFormatId::FILEGRPDESCRIPTOR ) ||
1083  m_aContentTree->IsDropFormatSupported( SotClipboardFormatId::UNIFORMRESOURCELOCATOR ) ||
1084  m_aContentTree->IsDropFormatSupported( SotClipboardFormatId::FILENAME )))
1085  ? DND_ACTION_COPY
1086  : DND_ACTION_NONE;
1087 }
1088 
1090 {
1091  TransferableDataHelper aData( rEvt.maDropEvent.Transferable );
1092  sal_Int8 nRet = DND_ACTION_NONE;
1094  return nRet;
1095 
1096  OUString sFileName = SwNavigationPI::CreateDropFileName(aData);
1097  if (sFileName.isEmpty())
1098  return nRet;
1099 
1100  INetURLObject aTemp(sFileName);
1101  GraphicDescriptor aDesc(aTemp);
1102  if (aDesc.Detect()) // accept no graphics
1103  return nRet;
1104 
1105  if (-1 != sFileName.indexOf('#'))
1106  return nRet;
1107 
1108  if (m_sContentFileName.isEmpty() || m_sContentFileName != sFileName)
1109  {
1110  nRet = rEvt.mnAction;
1111  sFileName = comphelper::string::stripEnd(sFileName, 0);
1112  m_sContentFileName = sFileName;
1113  if(m_pxObjectShell)
1114  {
1115  m_aContentTree->SetHiddenShell( nullptr );
1116  (*m_pxObjectShell)->DoClose();
1117  m_pxObjectShell.reset();
1118  }
1119  SfxStringItem aFileItem(SID_FILE_NAME, sFileName );
1120  SfxStringItem aOptionsItem( SID_OPTIONS, "HRC" );
1121  SfxLinkItem aLink( SID_DONELINK,
1122  LINK( this, SwNavigationPI, DoneLink ) );
1124  SID_OPENDOC, SfxCallMode::ASYNCHRON,
1125  { &aFileItem, &aOptionsItem, &aLink });
1126  }
1127  return nRet;
1128 }
1129 
1131 {
1132  m_nRegionMode = nNewMode;
1134 
1135  OUString sImageId;
1136  switch (nNewMode)
1137  {
1138  case RegionMode::NONE:
1139  sImageId = RID_BMP_DROP_REGION;
1140  break;
1141  case RegionMode::LINK:
1142  sImageId = RID_BMP_DROP_LINK;
1143  break;
1144  case RegionMode::EMBEDDED:
1145  sImageId = RID_BMP_DROP_COPY;
1146  break;
1147  }
1148  m_aContentToolBox->SetItemImage(m_aContentToolBox->GetItemId("dragmode"), Image(StockImage::Yes, sImageId));
1149 }
1150 
1152 {
1153  bool bGlobalDoc = IsGlobalDoc();
1154  if (!IsGlobalMode() && bGlobalDoc)
1155  {
1156  SetUpdateMode(false);
1157  if (IsZoomedIn())
1158  ZoomOut();
1159  m_aGlobalBox->Show();
1162  m_aContentBox->Hide();
1165  m_aDocListBox->Hide();
1166  SetGlobalMode(true);
1167  SetUpdateMode(true);
1168  }
1169  else
1170  {
1171  m_aGlobalBox->Hide();
1174  if (!IsZoomedIn())
1175  {
1176  m_aContentBox->Show();
1179  m_aDocListBox->Show();
1180  }
1181  SetGlobalMode(false);
1182  }
1183 }
1184 
1186 {
1187  bool bRet = false;
1188  SwView *pView = GetCreateView();
1189  if (pView)
1190  {
1191  SwWrtShell &rSh = pView->GetWrtShell();
1192  bRet = rSh.IsGlobalDoc();
1193  }
1194  return bRet;
1195 }
1196 
1197 IMPL_LINK_NOARG(SwNavigationPI, ChangePageHdl, Timer *, void)
1198 {
1199  if (!IsDisposed())
1200  {
1201  EditAction(GetPageEdit());
1202  GetPageEdit().GrabFocus();
1203  }
1204 }
1205 
1206 IMPL_LINK_NOARG(SwNavigationPI, PageEditModifyHdl, SpinField&, void)
1207 {
1208  if (m_aPageChgIdle.IsActive())
1209  m_aPageChgIdle.Stop();
1210  m_aPageChgIdle.Start();
1211 }
1212 
1214 {
1215  if (!m_pCreateView)
1216  {
1217  SwView* pView = SwModule::GetFirstView();
1218  while (pView)
1219  {
1220  if(&pView->GetViewFrame()->GetBindings() == &m_rBindings)
1221  {
1222  const_cast<SwNavigationPI*>(this)->m_pCreateView = pView;
1223  const_cast<SwNavigationPI*>(this)->StartListening(*m_pCreateView);
1224  break;
1225  }
1226  pView = SwModule::GetNextView(pView);
1227  }
1228  }
1229  return m_pCreateView;
1230 }
1231 
1233  sal_uInt16 nId,
1234  SfxBindings* _pBindings )
1235  : SfxChildWindowContext( nId )
1236 {
1237  VclPtr<SwNavigationPI> pNavi = VclPtr<SwNavigationPI>::Create(_pBindings, pParent);
1238  _pBindings->Invalidate(SID_NAVIGATOR);
1239 
1240  SwNavigationConfig* pNaviConfig = SW_MOD()->GetNavigationConfig();
1241 
1242  const ContentTypeId nRootType = pNaviConfig->GetRootType();
1243  if( nRootType != ContentTypeId::UNKNOWN )
1244  {
1245  pNavi->m_aContentTree->SetRootType(nRootType);
1246  pNavi->m_aContentToolBox->CheckItem(pNavi->m_aContentToolBox->GetItemId("root"));
1247  if (nRootType == ContentTypeId::OUTLINE)
1248  {
1249  pNavi->m_aContentTree->SetSelectionMode(SelectionMode::Multiple);
1250  pNavi->m_aContentTree->SetDragDropMode(DragDropMode::CTRL_MOVE |
1251  DragDropMode::CTRL_COPY |
1252  DragDropMode::ENABLE_TOP);
1253  }
1254  }
1255  pNavi->m_aContentTree->SetOutlineLevel( static_cast< sal_uInt8 >( pNaviConfig->GetOutlineLevel() ) );
1256  pNavi->SetRegionDropMode( pNaviConfig->GetRegionMode() );
1257 
1258  if (SfxNavigator* pNav = dynamic_cast<SfxNavigator*>(pParent))
1259  {
1260  pNav->SetMinOutputSizePixel(pNavi->GetOptimalSize());
1261  if (pNaviConfig->IsSmall())
1262  pNavi->ZoomIn();
1263  }
1264 
1265  SetWindow(pNavi);
1266 }
1267 
1268 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Point TopLeft() const
SfxViewFrame * GetViewFrame() const
SwNavigationChild(vcl::Window *, sal_uInt16 nId, SfxBindings *)
Definition: navipi.cxx:1232
SwNavigationConfig * m_pConfig
Definition: navipi.hxx:92
void SetPos(const Point &rPoint)
bool IsZoomedIn() const
Definition: navipi.hxx:102
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
OString stripEnd(const OString &rIn, sal_Char c)
void SetQuickHelpText(sal_uInt16 nItemId, const OUString &rText)
bool EndPg(bool bSelect=false)
Definition: move.cxx:342
#define HID_NAVIGATOR_GLOBAL_TOOLBOX
Definition: helpids.h:40
void SetMinOutputSizePixel(const Size &rSize)
void ZoomIn()
Definition: navipi.cxx:558
#define FN_TO_FOOTER
Definition: cmdid.h:682
void InsertWindow(sal_uInt16 nItemId, vcl::Window *pWindow, ToolBoxItemBits nBits=ToolBoxItemBits::NONE, ImplToolItems::size_type nPos=APPEND)
void MoveOutline(SwOutlineNodes::size_type nSource, SwOutlineNodes::size_type nTarget, bool bWithCilds)
Definition: navipi.cxx:99
OUString GetTitle(sal_uInt16 nMaxLen=0) const
#define DND_ACTION_COPY
SwView * GetActiveView()
Definition: swmodul1.cxx:123
#define FN_PREV_FOOTNOTE
Definition: cmdid.h:676
virtual ~SwNavigationPI() override
Definition: navipi.cxx:761
void SetMax(sal_Int64 nNewMax)
void SetRegionDropMode(RegionMode nNewMode)
Definition: navipi.cxx:1130
bool GotoNextFootnoteAnchor()
Definition: trvlfnfl.cxx:327
void SetHiddenShell(SwWrtShell *pSh)
After a file is dropped on the Navigator, the new shell will be set.
Definition: content.cxx:2332
void SetHelpId(sal_uInt16 nItemId, const OString &rHelpId)
long Height() const
signed char sal_Int8
bool IsAllProtect() const
Definition: crsrsh.hxx:764
void SetGlobalMode(bool bSet)
Definition: navipi.hxx:132
WinBits const WB_HASBUTTONSATROOT
std::vector< SwNode * >::difference_type difference_type
SfxDispatcher * GetDispatcher()
wrapper iterator: wraps iterator of implementation while hiding MarkBase class; only IMark instances ...
static std::unique_ptr< SfxChildWindowContext > CreateImpl(vcl::Window *pParent, SfxBindings *pBindings, SfxChildWinInfo *pInfo)
soon obsolete !
Definition: navipi.cxx:66
ToolBoxItemBits GetItemBits(sal_uInt16 nItemId) const
void UsePage()
Definition: navipi.cxx:193
void MakeMark()
Definition: navipi.cxx:495
bool MakeOutlineSel(SwOutlineNodes::size_type nSttPos, SwOutlineNodes::size_type nEndPos, bool bWithChildren)
Definition: crstrvl.cxx:1180
void disposeAndClear()
Reference< XFrame > xFrame
static SW_DLLPUBLIC MarkType GetType(const ::sw::mark::IMark &rMark)
Returns the MarkType used to create the mark.
Definition: docbm.cxx:474
const OUString & GetQuickHelpText() const
Provides access to the marks of a document.
void SetAccessibleName(const OUString &rName)
bool IsDropFormatSupported(SotClipboardFormatId nFormat)
void EnableAsyncDrag(bool b)
std::function< std::unique_ptr< UIObject >vcl::Window *)> FactoryFunction
virtual void SetSizePixel(const Size &rNewSize)
virtual OUString CreateFieldText(sal_Int64 nValue) const
#define KEY_MOD1
bool IsActiveView() const
Definition: conttree.hxx:223
virtual void dispose() override
void SetWeight(FontWeight)
OUString m_aStatusArr[4]
Definition: navipi.hxx:82
void GetPageNum(sal_uInt16 &rnPhyNum, sal_uInt16 &rnVirtNum, bool bAtCursorPos=true, const bool bCalcFrame=true)
Definition: crsrsh.cxx:1196
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
void ShowItem(sal_uInt16 nItemId, bool bVisible=true)
bool GotoFootnoteAnchor()
jump from footnote to anchor
Definition: trvlfnfl.cxx:156
#define HID_NAVI_DRAG_COPY
Definition: helpids.h:27
SwEditWin & GetEditWin()
Definition: view.hxx:403
sal_uInt16 Execute(vcl::Window *pWindow, const Point &rPopupPos)
sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt)
Definition: navipi.cxx:1089
SwView * m_pActContView
Definition: navipi.hxx:87
~SwNavHelpToolBox() override
Definition: navipi.cxx:458
void SetDropDownLineCount(sal_uInt16 nLines)
#define FN_TO_HEADER
Definition: cmdid.h:681
void Clear()
void SetHelpId(const OString &)
#define FN_STAT_PAGE
Definition: cmdid.h:808
#define HID_NAVIGATOR_TOOLBOX
Definition: helpids.h:37
virtual bool Select(SvTreeListEntry *pEntry, bool bSelect=true) override
Definition: content.cxx:3387
void Invalidate(sal_uInt16 nId)
bool GetINetBookmark(SotClipboardFormatId nFormat, INetBookmark &rBmk)
bool GotoHeaderText()
jump from the content to the header
Definition: crstrvl.cxx:127
virtual SfxObjectShell * GetObjectShell() override
virtual void RequestHelp(const HelpEvent &rHEvt) override
Definition: navipi.cxx:441
bool HasFormat(SotClipboardFormatId nFormat) const
void HideTree()
folded together will not be glidled
Definition: content.cxx:2739
static OUString GetToolTip(bool bNext)
Definition: workctrl.cxx:420
bool IsBound() const
SfxHintId GetId() const
void UpdateListBox()
Definition: navipi.cxx:949
SwWrtShell & GetWrtShell() const
Definition: view.hxx:400
virtual Size GetOptimalSize() const override
void SetMin(sal_Int64 nNewMin)
SfxApplication * SfxGetpApp()
void SwapPam()
Definition: crsrsh.cxx:963
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
StateChangedType
const SwView & GetView() const
Definition: wrtsh.hxx:428
virtual const_iterator_t findMark(const OUString &rMark) const =0
Finds a mark by name.
void SetDropdownClickHdl(const Link< ToolBox *, void > &rLink)
void Enable(bool bEnable=true, bool bChild=true)
void SetForceMakeVisible(bool bEnable)
SvTreeListEntry * FirstSelected() const
const vcl::Font & GetFont() const
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:653
WinBits const WB_HSCROLL
bool GotoFootnoteText()
jump from content to footnote
Definition: trvlfnfl.cxx:83
void SetDragDropMode(DragDropMode)
virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem *pState) override
Definition: navipi.cxx:842
bool IsGlblDocSaveLinks() const
Definition: edglbldc.cxx:49
SfxFrame & GetFrame() const
#define DND_ACTION_NONE
ContentTypeId GetRootType() const
Definition: navicfg.hxx:47
VclPtr< ListBox > m_aDocListBox
Definition: navipi.hxx:78
static OUString CreateDropFileName(TransferableDataHelper &rData)
Definition: navipi.cxx:1041
void ToggleTree()
Definition: navipi.cxx:1151
const sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:95
VclPtr< VclContainer > m_aGlobalBox
Definition: navipi.hxx:76
bool IsConstantView() const
Definition: conttree.hxx:222
long Top() const
const IDocumentMarkAccess * getIDocumentMarkAccess() const
Provides access to the document bookmark interface.
Definition: viewsh.cxx:2595
SwWrtShell * m_pContentWrtShell
Definition: navipi.hxx:86
SwWrtShell * GetHiddenWrtShell()
Definition: conttree.hxx:227
SotClipboardFormatId
void SetOutlineLevel(sal_uInt8 nSet)
Definition: content.cxx:3351
VclPtr< SwNavigationPI > m_xDialog
Definition: navipi.hxx:50
sal_Int8 AcceptDrop()
Definition: navipi.cxx:1074
bool Update(bool bHard)
Definition: glbltree.cxx:1101
#define MOUSE_LEFT
RegionMode GetRegionMode() const
Definition: navicfg.hxx:65
void SetWindow(vcl::Window *pWin)
const SwWrtShell * GetActiveWrtShell() const
Definition: conttree.hxx:226
tools::Rectangle GetItemRect(sal_uInt16 nItemId)
const Point & GetMousePosPixel() const
#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:1157
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
Definition: uiobject.cxx:157
bool IsHiddenView() const
Definition: conttree.hxx:224
virtual void dispose() override
Definition: navipi.cxx:766
void SetActiveShell(SwWrtShell *pSh)
Document change - set new Shell.
Definition: content.cxx:2346
virtual std::unique_ptr< ILazyDeleter > deleteMark(const IDocumentMarkAccess::const_iterator_t &ppMark)=0
Deletes a mark.
virtual const_iterator_t getAllMarksBegin() const =0
returns a STL-like random access iterator to the begin of the sequence of marks.
void SetRootType(ContentTypeId nType)
Definition: content.cxx:3420
void clear()
void SetSelectHdl(const Link< Menu *, bool > &rLink)
SwNavHelpToolBox(Window *pParent)
Definition: navipi.cxx:400
#define SW_MOD()
Definition: swmodule.hxx:256
VclPtr< ToolBox > m_aGlobalToolBox
Definition: navipi.hxx:72
static constexpr auto npos
Definition: ndarr.hxx:80
#define HID_NAVI_OUTLINES
Definition: helpids.h:28
virtual const_iterator_t getAllMarksEnd() const =0
returns a STL-like random access iterator to the end of the sequence of marks.
static OUString CleanEntry(const OUString &rEntry)
Definition: navipi.cxx:84
sal_uInt16 GetPageCnt()
Definition: crsrsh.cxx:1278
void setMaxWidthChars(sal_Int32 nWidth)
virtual void dispose()
RegionMode
Definition: swcont.hxx:51
VclPtr< SfxPopupWindow > m_pFloatingWindow
Definition: navipi.hxx:90
bool GetString(SotClipboardFormatId nFormat, OUString &rStr)
void SelectEntryPos(sal_Int32 nPos, bool bSelect=true)
#define HID_NAVIGATOR_LISTBOX
Definition: helpids.h:38
SfxBindings & GetBindings()
int i
#define HID_NAVI_DRAG_LINK
Definition: helpids.h:26
bool IsGlobalMode() const
Definition: navipi.hxx:158
::sw::mark::IMark * SetBookmark(const vcl::KeyCode &, const OUString &rName, IDocumentMarkAccess::MarkType eMark=IDocumentMarkAccess::MarkType::BOOKMARK)
Definition: crbm.cxx:80
void SetUpdateMode(bool bUpdate)
void SetItemBits(sal_uInt16 nItemId, ToolBoxItemBits nBits)
FrameTypeFlags
values can be combined via logical or
Definition: fesh.hxx:62
void CreateNavigationTool(const tools::Rectangle &rRect, bool bSetFocus, vcl::Window *pParent)
Definition: navipi.cxx:418
SwNavigationPI(SfxBindings *, vcl::Window *)
Definition: navipi.cxx:599
OUString m_sContentFileName
Definition: navipi.hxx:80
VclPtr< SwGlobalTree > m_aGlobalTree
Definition: navipi.hxx:77
VclPtr< SwContentTree > m_aContentTree
Definition: navipi.hxx:75
WEIGHT_NORMAL
void CheckItem(sal_uInt16 nItemId, bool bCheck=true)
long Bottom() const
static SwView * GetFirstView()
Definition: swmodul1.cxx:129
OUString GetFile(size_t nIndex) const
sal_Int32 InsertEntry(const OUString &rStr, sal_Int32 nPos=LISTBOX_APPEND)
VclPtr< SwNavHelpToolBox > m_aContentToolBox
Definition: navipi.hxx:71
void SetDialog(SwNavigationPI *pDialog)
Definition: navipi.hxx:56
void SetActionHdl(const Link< NumEditAction &, void > &rLink)
Definition: actctrl.hxx:39
vcl::Window * GetItemWindow(sal_uInt16 nItemId) const
#define FN_START_OF_PAGE
Definition: cmdid.h:632
Idle m_aPageChgIdle
Definition: navipi.hxx:79
GUIDCNamePair const aData
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
OUString SwResId(const char *pId)
Definition: swmodule.cxx:190
void SetSelectHdl(const Link< ListBox &, void > &rLink)
void SetSelectHdl(const Link< ToolBox *, void > &rLink)
DocumentType const eType
Point ScreenToOutputPixel(const Point &rPos) const
void GrabFocus()
void SetClickHdl(const Link< ToolBox *, void > &rLink)
VclPtr< SfxPopupWindow > m_pPopupWindow
Definition: navipi.hxx:89
WinBits const WB_LEFT
SfxViewShell * GetViewShell() const
void SetStyle(WinBits nStyle)
Point OutputToAbsoluteScreenPixel(const Point &rPos) const
SwDocShell * GetDocShell()
Definition: view.cxx:1128
void SetSmall(bool bSet)
Definition: navicfg.hxx:84
WinBits const WB_REPEAT
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
static void RegisterChildWindowContext(SfxModule *, sal_uInt16, std::unique_ptr< SfxChildWinContextFactory >)
void CheckItem(sal_uInt16 nItemId, bool bCheck=true)
bool SttPg(bool bSelect=false)
Definition: move.cxx:336
VclPtr< VclContainer > m_aContentBox
Definition: navipi.hxx:74
bool GotoPrevFootnoteAnchor()
Definition: trvlfnfl.cxx:332
void HideTree()
Definition: glbltree.cxx:1059
SwView * GetCreateView() const
Definition: navipi.cxx:1213
void SetSpaceBetweenEntries(short nSpace)
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
VCL_BUILDER_FACTORY(SlideTransitionBox)
virtual void dispose() override
SwView * m_pCreateView
Definition: navipi.hxx:88
static bool IsInDrag()
Definition: conttree.hxx:205
SAL_DLLPRIVATE void SetDeleteLink_Impl(const Link< SfxPopupWindow *, void > &rLink)
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE) override
#define FN_SCROLL_NAVIGATION
Definition: cmdid.h:169
void InsertItem(sal_uInt16 nItemId, const OUString &rStr, MenuItemBits nItemBits=MenuItemBits::NONE, const OString &rIdent=OString(), sal_uInt16 nPos=MENU_APPEND)
void ZoomOut()
Definition: navipi.cxx:524
void SetSelectionMode(SelectionMode)
bool IsGlobalDoc() const
Definition: navipi.cxx:1185
static void RegisterChildWindowContext(SfxModule *pMod)
Definition: navipi.cxx:73
#define FN_PAGENUMBER
Definition: cmdid.h:115
OUString GetItemCommand(sal_uInt16 nItemId) const
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:401
void SetLineCount(ImplToolItems::size_type nNewLines)
SfxItemState
#define HID_NAVI_DRAG_HYP
Definition: helpids.h:25
weld::Entry & rEdit
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
void Stop()
SfxViewFrame * GetFrame() const
void MoveCursor(bool bWithSelect=false)
Definition: move.cxx:66
WinBits const WB_BORDER
Size m_aExpandedSize
Definition: navipi.hxx:97
void SetFirst(sal_Int64 nNewFirst)
void SetFont(const vcl::Font &rNewFont)
bool IsCursorPtAtEnd() const
Definition: crsrsh.hxx:898
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:261
VclPtr< NumEditAction > m_xEdit
Definition: navipi.hxx:73
void SetItemImage(sal_uInt16 nItemId, const Image &rImage)
void SetFont(const vcl::Font &rFont)
bool IsVisible() const
void ShowTree()
Definition: content.cxx:2725
bool IsHelpDocument() const
static VclPtr< reference_type > Create(Arg &&...arg)
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
sal_Int32 GetOutlineLevel() const
Definition: navicfg.hxx:56
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: navipi.cxx:900
void InsertSeparator(ImplToolItems::size_type nPos=APPEND, sal_uInt16 nPixSize=0)
bool GetFileList(SotClipboardFormatId nFormat, FileList &rFileList)
virtual void dispose() override
Definition: navipi.cxx:452
void GotoOutline(SwOutlineNodes::size_type nIdx)
Definition: move.cxx:608
void UnSelectFrame()
Definition: select.cxx:327
void Display(bool bOnlyUpdateUserData=false)
Definition: glbltree.cxx:660
const OUString & GetURL() const
void SetInvokeHandler(const Link< Timer *, void > &rLink)
long Left() const
NumEditAction & GetPageEdit()
Definition: navipi.cxx:894
#define FN_NEXT_FOOTNOTE
Definition: cmdid.h:675
static FloatingWindow * GetFloatingWindow(vcl::Window *pParent)
void ClearMark()
Definition: crsrsh.cxx:926
void FillBox()
Definition: navipi.cxx:168
WinBits const WB_TABSTOP
static SwView * GetNextView(SwView const *)
Definition: swmodul1.cxx:136
void LeaveSelFrameMode()
Definition: select.cxx:724
SfxBindings & m_rBindings
Definition: navipi.hxx:93
void InsertBreak(ImplToolItems::size_type nPos=APPEND)
bool m_bIsZoomedIn
Definition: navipi.hxx:99
WinBits const WB_HASBUTTONS
sal_uInt16 GetItemId(ImplToolItems::size_type nPos) const
void SetUpHdl(const Link< SpinField &, void > &rLink)
reference_type * get() const
void SetDownHdl(const Link< SpinField &, void > &rLink)
void Release(SfxControllerItem &rBinding)
WinBits GetStyle() const
void SetPriority(TaskPriority ePriority)
FactoryFunction GetUITestFactory() const override
Definition: navipi.cxx:436
void SetGetFocusHdl(const Link< Control &, void > &rLink)
void HideItem(sal_uInt16 nItemId)
sal_uInt16 m_nAutoMarkIdx
Definition: navipi.hxx:95
#define FN_END_OF_PAGE
Definition: cmdid.h:633
void SetLast(sal_Int64 nNewLast)
void SetHelpId(sal_uInt16 nItemId, const OString &rHelpId)
virtual Size CalcMinimumSizeForText(const OUString &rString) const override
bool MoveOutlinePara(SwOutlineNodes::difference_type nOffset)
Definition: ednumber.cxx:574
void Display(bool bActiveView)
Show the file.
Definition: content.cxx:1702
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:674
WinBits const WB_SPIN
OUString m_aContextArr[3]
Definition: navipi.hxx:81
#define MAX_MARKS
Definition: view.hxx:85
void SetReadOnlyUI(bool bReadOnly=true)
WinBits const WB_CLIPCHILDREN
void Clear()
FrameTypeFlags GetFrameType(const Point *pPt, bool bStopAtFly) const
For return values see above FrameType.
Definition: fews.cxx:236
virtual void RequestHelp(const HelpEvent &rHEvt) override
void ShowTree()
Definition: glbltree.cxx:1053
bool IsFrameSelected() const
Definition: feshview.cxx:1166
void SetGlblDocSaveLinks(bool bFlag)
Definition: edglbldc.cxx:39
std::unique_ptr< SfxObjectShellLock > m_pxObjectShell
Definition: navipi.hxx:84
bool IsSmall() const
Definition: navicfg.hxx:83
virtual void SetValue(sal_Int64 nNewValue)
Definition: view.hxx:146
static void SetActMark(sal_Int32 nSet)
Definition: viewmdi.cxx:662
void set_expand(bool bExpand)
bool GotoFooterText()
jump from the content to the footer
Definition: crstrvl.cxx:155
void SetPopupWindow(SfxPopupWindow *)
Definition: navipi.cxx:808
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
bool IsGlobalDoc() const
Interfaces for GlobalDocument.
Definition: edglbldc.cxx:34
RegionMode m_nRegionMode
Definition: navipi.hxx:96
void setHeight(long nHeight)
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo