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