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