LibreOffice Module sw (master)  1
navipi.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <comphelper/string.hxx>
21 #include <svl/urlbmk.hxx>
22 #include <svl/stritem.hxx>
23 #include <vcl/graphicfilter.hxx>
24 #include <sot/formats.hxx>
25 #include <sot/filelist.hxx>
26 #include <sfx2/event.hxx>
27 #include <sfx2/dispatch.hxx>
28 #include <sfx2/navigat.hxx>
29 #include <sfx2/viewfrm.hxx>
30 #include <tools/urlobj.hxx>
31 #include <vcl/toolbox.hxx>
32 #include <swtypes.hxx>
33 #include <swmodule.hxx>
34 #include <view.hxx>
35 #include <navicfg.hxx>
36 #include <wrtsh.hxx>
37 #include <docsh.hxx>
38 #include <actctrl.hxx>
39 #include <navipi.hxx>
40 #include <workctrl.hxx>
41 #include <edtwin.hxx>
42 #include <sfx2/app.hxx>
43 #include <cmdid.h>
44 #include <helpids.h>
45 
46 #include <strings.hrc>
47 #include <bitmaps.hlst>
48 
49 #include <memory>
50 
51 #include <uiobject.hxx>
52 
53 using namespace ::com::sun::star::uno;
54 using namespace ::com::sun::star::frame;
55 
57 std::unique_ptr<SfxChildWindowContext> SwNavigationChild::CreateImpl( vcl::Window *pParent,
58  SfxBindings *pBindings, SfxChildWinInfo* /*pInfo*/ )
59 {
60  return std::make_unique<SwNavigationChild>(pParent,
61  /* cast is safe here! */static_cast< sal_uInt16 >(SwView::GetInterfaceId()),
62  pBindings);
63 }
65 {
66  auto pFact = std::make_unique<SfxChildWinContextFactory>(
68  /* cast is safe here! */static_cast< sal_uInt16 >(SwView::GetInterfaceId()) );
69  SfxChildWindowContext::RegisterChildWindowContext(pMod, SID_NAVIGATOR, std::move(pFact));
70 }
71 
72 
73 // Filter the control characters out of the Outline-Entry
74 
75 OUString SwNavigationPI::CleanEntry(const OUString& rEntry)
76 {
77  if (rEntry.isEmpty())
78  return rEntry;
79 
80  OUStringBuffer aEntry(rEntry);
81  for (sal_Int32 i = 0; i < rEntry.getLength(); ++i)
82  if(aEntry[i] == 10 || aEntry[i] == 9)
83  aEntry[i] = 0x20;
84 
85  return aEntry.makeStringAndClear();
86 }
87 
88 // Execution of the drag operation with and without the children.
89 
91  bool bWithChildren)
92 {
93  SwView *pView = GetCreateView();
94  SwWrtShell &rSh = pView->GetWrtShell();
95  if(nTarget < nSource || nTarget == SwOutlineNodes::npos)
96  nTarget ++;
97  if ( rSh.IsOutlineMovable( nSource ))
98  {
99 
100  SwOutlineNodes::difference_type nMove = nTarget-nSource; //( nDir<0 ) ? 1 : 0 ;
101  rSh.GotoOutline(nSource);
102  if (bWithChildren)
103  rSh.MakeOutlineSel(nSource, nSource, true);
104  // While moving, the selected children does not counting.
105  const SwOutlineNodes::size_type nLastOutlinePos = rSh.GetOutlinePos(MAXLEVEL);
106  if(bWithChildren && nMove > 1 &&
107  nLastOutlinePos < nTarget)
108  {
109  if(!rSh.IsCursorPtAtEnd())
110  rSh.SwapPam();
111  nMove -= nLastOutlinePos - nSource;
112  }
113  if(!bWithChildren || nMove < 1 || nLastOutlinePos < nTarget )
114  rSh.MoveOutlinePara( nMove );
115  rSh.ClearMark();
116  rSh.GotoOutline( nSource + nMove);
117  }
118 
119 }
120 
121 // After goto cancel the status frame selection
122 
123 static void lcl_UnSelectFrame(SwWrtShell *pSh)
124 {
125  if (pSh->IsFrameSelected())
126  {
127  pSh->UnSelectFrame();
128  pSh->LeaveSelFrameMode();
129  }
130 }
131 
132 // Select the document view
133 
134 IMPL_LINK( SwNavigationPI, DocListBoxSelectHdl, ListBox&, rBox, void )
135 {
136  int nEntryIdx = rBox.GetSelectedEntryPos();
137  SwView *pView ;
138  pView = SwModule::GetFirstView();
139  while (nEntryIdx-- && pView)
140  {
141  pView = SwModule::GetNextView(pView);
142  }
143  if(!pView)
144  {
145  nEntryIdx == 0 ?
146  m_aContentTree->ShowHiddenShell():
147  m_aContentTree->ShowActualView();
148 
149  }
150  else
151  {
152  m_aContentTree->SetConstantShell(pView->GetWrtShellPtr());
153  }
154 }
155 
156 // Filling of the list box for outline view or documents
157 // The PI will be set to full size
158 
160 {
162  {
164  m_aContentTree->Display( false );
165  }
166  else
167  {
168  SwView *pView = GetCreateView();
169  if(!pView)
170  {
171  m_aContentTree->SetActiveShell(nullptr);
172  }
173  else if( pView != m_pActContView)
174  {
175  SwWrtShell* pWrtShell = pView->GetWrtShellPtr();
176  m_aContentTree->SetActiveShell(pWrtShell);
177  }
178  else
179  m_aContentTree->Display( true );
180  m_pActContView = pView;
181  }
182 }
183 
185 {
186  SwView *pView = GetCreateView();
187  SwWrtShell *pSh = pView ? &pView->GetWrtShell() : nullptr;
188  GetPageEdit().set_value(1);
189  if (pSh)
190  {
191  const sal_uInt16 nPageCnt = pSh->GetPageCnt();
192  sal_uInt16 nPhyPage, nVirPage;
193  pSh->GetPageNum(nPhyPage, nVirPage);
194 
195  GetPageEdit().set_max(nPageCnt);
196  GetPageEdit().set_value(nPhyPage);
197  }
198 }
199 
200 // Select handler of the toolboxes
201 
202 IMPL_LINK( SwNavigationPI, ToolBoxSelectHdl, ToolBox *, pBox, void )
203 {
204  const sal_uInt16 nCurrItemId = pBox->GetCurItemId();
205  const OUString sCommand = pBox->GetItemCommand(nCurrItemId);
206  SwView *pView = GetCreateView();
207  if (!pView)
208  return;
209  SwWrtShell &rSh = pView->GetWrtShell();
210  // Get MouseModifier for Outline-Move
211 
212  // Standard: sublevels are taken
213  // do not take sublevels with Ctrl
214  bool bOutlineWithChildren = ( KEY_MOD1 != pBox->GetModifier());
215  int nFuncId = 0;
216  bool bFocusToDoc = false;
217  if (sCommand == ".uno:ScrollToPrevious")
218  {
219  rSh.GetView().GetViewFrame()->GetDispatcher()->Execute(FN_SCROLL_PREV, SfxCallMode::ASYNCHRON);
220  }
221  else if (sCommand == ".uno:ScrollToNext")
222  {
223  rSh.GetView().GetViewFrame()->GetDispatcher()->Execute(FN_SCROLL_NEXT, SfxCallMode::ASYNCHRON);
224  }
225  else if (sCommand == "root")
226  {
227  m_aContentTree->ToggleToRoot();
228  }
229  else if (sCommand == "listbox")
230  {
232  {
233  if (IsZoomedIn())
234  {
235  ZoomOut();
236  }
237  else
238  {
239  ZoomIn();
240  }
241  }
242  return;
243  }
244  // Functions that will trigger a direct action.
245  else if (sCommand == "footer")
246  {
247  rSh.MoveCursor();
248  const FrameTypeFlags eType = rSh.GetFrameType(nullptr,false);
249  if (eType & FrameTypeFlags::FOOTER)
250  {
251  if (rSh.EndPg())
252  nFuncId = FN_END_OF_PAGE;
253  }
254  else if (rSh.GotoFooterText())
255  nFuncId = FN_TO_FOOTER;
256  bFocusToDoc = true;
257  }
258  else if (sCommand == "header")
259  {
260  rSh.MoveCursor();
261  const FrameTypeFlags eType = rSh.GetFrameType(nullptr,false);
262  if (eType & FrameTypeFlags::HEADER)
263  {
264  if (rSh.SttPg())
265  nFuncId = FN_START_OF_PAGE;
266  }
267  else if (rSh.GotoHeaderText())
268  nFuncId = FN_TO_HEADER;
269  bFocusToDoc = true;
270  }
271  else if (sCommand == "anchor")
272  {
273  rSh.MoveCursor();
274  const FrameTypeFlags eFrameType = rSh.GetFrameType(nullptr,false);
275  // Jump from the footnote to the anchor.
276  if (eFrameType & FrameTypeFlags::FOOTNOTE)
277  {
278  if (rSh.GotoFootnoteAnchor())
279  nFuncId = FN_FOOTNOTE_TO_ANCHOR;
280  }
281  // Otherwise, jump to the first footnote text;
282  // go to the next footnote if this is not possible;
283  // if this is also not possible got to the footnote before.
284  else
285  {
286  if (rSh.GotoFootnoteText())
287  nFuncId = FN_FOOTNOTE_TO_ANCHOR;
288  else if (rSh.GotoNextFootnoteAnchor())
289  nFuncId = FN_NEXT_FOOTNOTE;
290  else if (rSh.GotoPrevFootnoteAnchor())
291  nFuncId = FN_PREV_FOOTNOTE;
292  }
293  bFocusToDoc = true;
294  }
295  else if (sCommand == "reminder")
296  {
297  rSh.GetView().GetViewFrame()->GetDispatcher()->Execute(FN_SET_REMINDER, SfxCallMode::ASYNCHRON);
298  }
299  else if (sCommand == "down" ||
300  sCommand == "up" ||
301  sCommand == "promote" ||
302  sCommand == "demote" ||
303  sCommand == "edit")
304  {
305  if (IsGlobalMode())
306  m_aGlobalTree->ExecCommand(sCommand);
307  else
308  m_aContentTree->ExecCommand(sCommand, bOutlineWithChildren);
309  }
310  else if (sCommand == "toggle")
311  {
312  ToggleTree();
313  m_pConfig->SetGlobalActive(IsGlobalMode());
314  }
315  else if (sCommand == "save")
316  {
317  bool bSave = rSh.IsGlblDocSaveLinks();
318  rSh.SetGlblDocSaveLinks( !bSave );
319  pBox->CheckItem(nCurrItemId, !bSave );
320  }
321 
322  if (nFuncId)
323  lcl_UnSelectFrame(&rSh);
324  if (bFocusToDoc)
325  pView->GetEditWin().GrabFocus();
326 }
327 
328 // Click handler of the toolboxes
329 
330 IMPL_LINK( SwNavigationPI, ToolBoxClickHdl, ToolBox *, pBox, void )
331 {
332  const sal_uInt16 nCurrItemId = pBox->GetCurItemId();
333  const OUString sCommand = pBox->GetItemCommand(nCurrItemId);
334  if (sCommand == "update" || sCommand == "insert")
335  m_aGlobalTree->TbxMenuHdl(nCurrItemId, pBox);
336 }
337 
338 IMPL_LINK( SwNavigationPI, ToolBoxDropdownClickHdl, ToolBox*, pBox, void )
339 {
340  const sal_uInt16 nCurrItemId = pBox->GetCurItemId();
341  const OUString sCommand = pBox->GetItemCommand(nCurrItemId);
342  if (sCommand == "dragmode")
343  {
344  static const char* aHIDs[] =
345  {
349  };
351  for (sal_uInt16 i = 0; i <= static_cast<sal_uInt16>(RegionMode::EMBEDDED); ++i)
352  {
353  pMenu->InsertItem(i + 1, m_aContextArr[i], MenuItemBits::RADIOCHECK);
354  pMenu->SetHelpId(i + 1, aHIDs[i]);
355  }
356  pMenu->CheckItem( static_cast<int>(m_nRegionMode) + 1 );
357  pMenu->SetSelectHdl(LINK(this, SwNavigationPI, MenuSelectHdl));
358  pBox->SetItemDown(nCurrItemId, true);
359  pMenu->Execute(pBox, pBox->GetItemRect(nCurrItemId), PopupMenuFlags::ExecuteDown);
360  pBox->SetItemDown(nCurrItemId, false);
361  pBox->EndSelection();
362  pMenu.disposeAndClear();
363  pBox->Invalidate();
364  }
365  else if (sCommand == "headings")
366  {
368  for (sal_uInt16 i = 101; i <= 100 + MAXLEVEL; ++i)
369  {
370  pMenu->InsertItem(i, OUString::number(i - 100), MenuItemBits::RADIOCHECK);
371  pMenu->SetHelpId(i, HID_NAVI_OUTLINES);
372  }
373  pMenu->CheckItem( m_aContentTree->GetOutlineLevel() + 100 );
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  pMenu.disposeAndClear();
379  pBox->EndSelection();
380  pBox->Invalidate();
381  }
382 }
383 
385 {
387 }
388 
389 // Action-Handler Edit:
390 // Switches to the page if the structure view is not turned on.
392 {
393  SwView *pView = GetCreateView();
394  if (pView)
395  {
398  m_pCreateView->GetWrtShell().GotoPage(GetPageEdit().get_value(), true);
401  }
402 }
403 
405 {
406  if (!IsZoomedIn())
407  return;
408  SfxNavigator* pNav = dynamic_cast<SfxNavigator*>(GetParent());
409  if (!pNav)
410  return;
411  m_bIsZoomedIn = false;
412  FillBox();
413  if (IsGlobalMode())
414  {
415  m_aGlobalBox->Show();
417  }
418  else
419  {
420  m_aContentBox->Show();
422  m_aDocListBox->Show();
423  }
424 
425  Size aOptimalSize(GetOptimalSize());
426  Size aNewSize(pNav->GetOutputSizePixel());
427  aNewSize.setHeight( m_aExpandedSize.Height() );
428  pNav->SetMinOutputSizePixel(aOptimalSize);
429  pNav->SetOutputSizePixel(aNewSize);
430 
432  if (pFirst)
433  m_aContentTree->Select(pFirst); // Enable toolbox
434  m_pConfig->SetSmall(false);
435  m_aContentToolBox->CheckItem(m_aContentToolBox->GetItemId("listbox"));
436 }
437 
439 {
440  if (IsZoomedIn())
441  return;
442  SfxNavigator* pNav = dynamic_cast<SfxNavigator*>(GetParent());
443  if (!pNav)
444  return;
445 
446  m_aExpandedSize = GetSizePixel();
447 
448  m_aContentBox->Hide();
450  m_aGlobalBox->Hide();
452  m_aDocListBox->Hide();
453  m_bIsZoomedIn = true;
454 
455  Size aOptimalSize(GetOptimalSize());
456  Size aNewSize(pNav->GetOutputSizePixel());
457  aNewSize.setHeight( aOptimalSize.Height() );
458  pNav->SetMinOutputSizePixel(aOptimalSize);
459  pNav->SetOutputSizePixel(aNewSize);
460 
462  if (pFirst)
463  m_aContentTree->Select(pFirst); // Enable toolbox
464  m_pConfig->SetSmall(true);
465  m_aContentToolBox->CheckItem(m_aContentToolBox->GetItemId("listbox"), false);
466 }
467 
468 namespace {
469 
471 {
472  IDX_STR_HIDDEN = 0,
473  IDX_STR_ACTIVE = 1,
474  IDX_STR_INACTIVE = 2
475 };
476 
477 }
478 
480  const css::uno::Reference<css::frame::XFrame>& rxFrame,
481  SfxBindings* pBindings)
482 {
483  if( pParent == nullptr )
484  throw css::lang::IllegalArgumentException("no parent window given to SwNavigationPI::Create", nullptr, 0);
485  if( !rxFrame.is() )
486  throw css::lang::IllegalArgumentException("no XFrame given to SwNavigationPI::Create", nullptr, 0);
487  if( pBindings == nullptr )
488  throw css::lang::IllegalArgumentException("no SfxBindings given to SwNavigationPI::Create", nullptr, 0);
489  return VclPtr<SwNavigationPI>::Create(pParent, rxFrame, pBindings);
490 }
491 
493  const css::uno::Reference<css::frame::XFrame>& rxFrame,
494  SfxBindings* _pBindings)
495  : PanelLayout(pParent, "NavigatorPanel", "modules/swriter/ui/navigatorpanel.ui", rxFrame/*, true*/)
496  , m_aDocFullName(SID_DOCFULLNAME, *_pBindings, *this)
497  , m_aPageStats(FN_STAT_PAGE, *_pBindings, *this)
498  , m_pContentView(nullptr)
499  , m_pContentWrtShell(nullptr)
500  , m_pActContView(nullptr)
501  , m_pCreateView(nullptr)
502  , m_pConfig(SW_MOD()->GetNavigationConfig())
503  , m_rBindings(*_pBindings)
504  , m_nRegionMode(RegionMode::NONE)
505  , m_bIsZoomedIn(false)
506  , m_bGlobalMode(false)
507 {
508  get(m_aContentToolBox, "content");
509  m_aContentToolBox->SetLineCount(2);
510  m_aContentToolBox->InsertBreak(4);
511  get(m_aGlobalToolBox, "global");
512  get(m_aDocListBox, "documents");
513 
514  get(m_aContentBox, "contentbox");
516  m_aContentTree->set_expand(true);
517  get(m_aGlobalBox, "globalbox");
519  m_aGlobalTree->set_expand(true);
520 
521  GetCreateView();
522 
528 
529  // Insert the numeric field in the toolbox.
531  m_xEdit->set_accessible_name(m_xEdit->GetQuickHelpText());
532  m_xEdit->connect_value_changed(LINK(this, SwNavigationPI, PageEditModifyHdl));
533 
534  // Double separators are not allowed, so you have to
535  // determine the suitable size differently.
536  tools::Rectangle aFirstRect = m_aContentToolBox->GetItemRect(m_aContentToolBox->GetItemId("anchor"));
537  tools::Rectangle aSecondRect = m_aContentToolBox->GetItemRect(m_aContentToolBox->GetItemId("header"));
538  Size aItemWinSize( aFirstRect.Left() - aSecondRect.Left(),
539  aFirstRect.Bottom() - aFirstRect.Top() );
540  Size aOptimalSize(m_xEdit->GetSizePixel());
541  aItemWinSize.setWidth( std::max(aItemWinSize.Width(), aOptimalSize.Width()) );
542  aItemWinSize.setHeight( std::max(aItemWinSize.Height(), aOptimalSize.Height()) );
543  m_xEdit->SetSizePixel(aItemWinSize);
544  m_aContentToolBox->InsertSeparator(4);
545  m_aContentToolBox->InsertWindow( FN_PAGENUMBER, m_xEdit, ToolBoxItemBits::NONE, 4);
546  m_aContentToolBox->InsertSeparator(4);
547  m_aContentToolBox->SetHelpId(FN_PAGENUMBER, "modules/swriter/ui/navigatorpanel/numericfield");
548  m_aContentToolBox->ShowItem(FN_PAGENUMBER);
549  if (!IsGlobalDoc())
550  {
551  m_aContentToolBox->HideItem(m_aContentToolBox->GetItemId("toggle"));
552  }
553 
554  const char* REGIONNAME_ARY[] =
555  {
556  STR_HYPERLINK,
557  STR_LINK_REGION,
558  STR_COPY_REGION
559  };
560 
561  const char* REGIONMODE_ARY[] =
562  {
563  STR_HIDDEN,
564  STR_ACTIVE,
565  STR_INACTIVE
566  };
567 
568  static_assert(SAL_N_ELEMENTS(REGIONNAME_ARY) == SAL_N_ELEMENTS(REGIONMODE_ARY), "### unexpected size!");
569  static_assert(SAL_N_ELEMENTS(REGIONNAME_ARY) == static_cast<sal_uInt16>(RegionMode::EMBEDDED) + 1, "### unexpected size!");
570 
571  for (sal_uInt16 i = 0; i <= static_cast<sal_uInt16>(RegionMode::EMBEDDED); ++i)
572  {
573  m_aContextArr[i] = SwResId(REGIONNAME_ARY[i]);
574  m_aStatusArr[i] = SwResId(REGIONMODE_ARY[i]);
575  }
576 
577  m_aStatusArr[3] = SwResId(STR_ACTIVE_VIEW);
578 
583  m_aContentTree->SetSelectionMode(SelectionMode::Single);
584  m_aContentTree->SetDragDropMode(DragDropMode::CTRL_MOVE |
585  DragDropMode::CTRL_COPY |
586  DragDropMode::ENABLE_TOP);
589  m_aContentToolBox->CheckItem(m_aContentToolBox->GetItemId("listbox"));
590  m_aContentToolBox->ShowItem(m_aContentToolBox->GetItemId("listbox"), SfxChildWindowContext::GetFloatingWindow(GetParent()) != nullptr);
591 
592 // TreeListBox for global document
593  m_aGlobalTree->SetSelectionMode( SelectionMode::Multiple );
596 
597 // Handler
598  Link<ToolBox *, void> aLk = LINK(this, SwNavigationPI, ToolBoxSelectHdl);
599  m_aContentToolBox->SetSelectHdl( aLk );
602  DocListBoxSelectHdl));
603  m_aContentToolBox->SetClickHdl( LINK(this, SwNavigationPI, ToolBoxClickHdl) );
604  m_aContentToolBox->SetDropdownClickHdl( LINK(this, SwNavigationPI, ToolBoxDropdownClickHdl) );
605  m_aGlobalToolBox->SetClickHdl( LINK(this, SwNavigationPI, ToolBoxClickHdl) );
606  m_aGlobalToolBox->SetDropdownClickHdl( LINK(this, SwNavigationPI, ToolBoxDropdownClickHdl) );
608 
609  vcl::Font aFont(GetFont());
610  aFont.SetWeight(WEIGHT_NORMAL);
611  GetPageEdit().SetFont(aFont);
612  aFont = m_aContentTree->GetFont();
613  aFont.SetWeight(WEIGHT_NORMAL);
614  m_aContentTree->SetFont(aFont);
615  m_aGlobalTree->SetFont(aFont);
616 
618 
619  sal_uInt16 nNavId = m_aContentToolBox->GetItemId("navigation");
620  m_aContentToolBox->SetItemBits(nNavId, m_aContentToolBox->GetItemBits(nNavId) | ToolBoxItemBits::DROPDOWNONLY );
621  sal_uInt16 nDropId = m_aContentToolBox->GetItemId("dragmode");
622  m_aContentToolBox->SetItemBits(nDropId, m_aContentToolBox->GetItemBits(nDropId) | ToolBoxItemBits::DROPDOWNONLY );
623  sal_uInt16 nOutlineId = m_aContentToolBox->GetItemId("headings");
624  m_aContentToolBox->SetItemBits(nOutlineId, m_aContentToolBox->GetItemBits(nOutlineId) | ToolBoxItemBits::DROPDOWNONLY );
625 
626  if(IsGlobalDoc())
627  {
628  SwView *pActView = GetCreateView();
630  pActView->GetWrtShellPtr()->IsGlblDocSaveLinks());
631  if (m_pConfig->IsGlobalActive())
632  ToggleTree();
634  }
635  else
637  UsePage();
638  m_aPageChgIdle.SetInvokeHandler(LINK(this, SwNavigationPI, ChangePageHdl));
639  m_aPageChgIdle.SetPriority(TaskPriority::LOWEST);
640 
641  m_aContentTree->SetAccessibleName(SwResId(STR_ACCESS_TL_CONTENT));
642  m_aGlobalTree->SetAccessibleName(SwResId(STR_ACCESS_TL_GLOBAL));
644 
646 }
647 
649 {
650  disposeOnce();
651 }
652 
654 {
655  if (IsGlobalDoc() && !IsGlobalMode())
656  {
657  SwView *pView = GetCreateView();
658  SwWrtShell &rSh = pView->GetWrtShell();
659  if (!rSh.IsAllProtect())
660  pView->GetDocShell()->SetReadOnlyUI(false);
661  }
662 
664 
665  m_aContentToolBox->GetItemWindow(FN_PAGENUMBER)->disposeOnce();
666  m_aContentToolBox->Clear();
667  if (m_pxObjectShell)
668  {
669  if (m_pxObjectShell->Is())
670  (*m_pxObjectShell)->DoClose();
671  m_pxObjectShell.reset();
672  }
673 
682 
684 
687 
689 }
690 
691 void SwNavigationPI::NotifyItemUpdate(sal_uInt16 nSID, SfxItemState /*eState*/,
692  const SfxPoolItem* /*pState*/)
693 {
694  if (nSID == SID_DOCFULLNAME)
695  {
696  SwView *pActView = GetCreateView();
697  if(pActView)
698  {
699  SwWrtShell* pWrtShell = pActView->GetWrtShellPtr();
700  m_aContentTree->SetActiveShell(pWrtShell);
701  bool bGlobal = IsGlobalDoc();
702  m_aContentToolBox->ShowItem(m_aContentToolBox->GetItemId("toggle"), bGlobal);
703  if ((!bGlobal && IsGlobalMode()) || (!IsGlobalMode() && m_pConfig->IsGlobalActive()))
704  {
705  ToggleTree();
706  }
707  if (bGlobal)
708  {
710  }
711  }
712  else
713  {
714  m_aContentTree->SetActiveShell(nullptr);
715  }
716  UpdateListBox();
717  }
718  else if (nSID == FN_STAT_PAGE)
719  {
720  SwView *pActView = GetCreateView();
721  if(pActView)
722  {
723  SwWrtShell &rSh = pActView->GetWrtShell();
724  GetPageEdit().set_max(rSh.GetPageCnt());
725  }
726  }
727 
728 }
729 
731 {
732  PanelLayout::StateChanged(nStateChange);
733  if (nStateChange == StateChangedType::InitShow)
734  {
735  // if the parent isn't a float, then the navigator is displayed in
736  // the sidebar or is otherwise docked. While the navigator could change
737  // its size, the sidebar can not, and the navigator would just waste
738  // space. Therefore hide this button.
739  m_aContentToolBox->ShowItem(m_aContentToolBox->GetItemId("listbox"), SfxChildWindowContext::GetFloatingWindow(GetParent()) != nullptr);
740  // show content if docked
741  if (SfxChildWindowContext::GetFloatingWindow(GetParent()) == nullptr && IsZoomedIn())
742  ZoomOut();
743  }
744  else if (nStateChange == StateChangedType::ControlFocus)
745  {
746  if (m_aContentTree)
747  {
748  // update documents listbox
749  UpdateListBox();
750  }
751  }
752 }
753 
754 // Get the numeric field from the toolbox.
755 
757 {
758  return *static_cast<NumEditAction*>(m_aContentToolBox->GetItemWindow(FN_PAGENUMBER));
759 }
760 
761 // Notification on modified DocInfo
762 void SwNavigationPI::Notify( SfxBroadcaster& rBrdc, const SfxHint& rHint )
763 {
764  if(&rBrdc == m_pCreateView)
765  {
766  if (rHint.GetId() == SfxHintId::Dying)
767  {
769  m_pCreateView = nullptr;
770  }
771  }
772  else
773  {
774  if (const SfxEventHint* pHint = dynamic_cast<const SfxEventHint*>(&rHint))
775  {
776  SfxEventHintId eEventId = pHint->GetEventId();
777  if (eEventId == SfxEventHintId::OpenDoc)
778  {
779  SwView *pActView = GetCreateView();
780  if(pActView)
781  {
782  SwWrtShell* pWrtShell = pActView->GetWrtShellPtr();
783  m_aContentTree->SetActiveShell(pWrtShell);
784  if(m_aGlobalTree->IsVisible())
785  {
786  if(m_aGlobalTree->Update( false ))
788  else
789  // If no update is needed, then paint at least,
790  // because of the red entries for the broken links.
792  }
793  }
794  }
795  }
796  }
797 }
798 
799 IMPL_LINK( SwNavigationPI, MenuSelectHdl, Menu *, pMenu, bool )
800 {
801  sal_uInt16 nMenuId = pMenu->GetCurItemId();
802  if(nMenuId != USHRT_MAX)
803  {
804  if(nMenuId < 100)
805  SetRegionDropMode( static_cast<RegionMode>(--nMenuId));
806  else
807  m_aContentTree->SetOutlineLevel( static_cast< sal_uInt8 >(nMenuId - 100) );
808  }
809  return false;
810 }
811 
813 {
814  if (isDisposed())
815  return;
816 
818  m_aDocListBox->Clear();
819  SwView *pActView = GetCreateView();
820  bool bDisable = pActView == nullptr;
821  SwView *pView = SwModule::GetFirstView();
822  sal_Int32 nCount = 0;
823  sal_Int32 nAct = 0;
824  sal_Int32 nConstPos = 0;
825  const SwView* pConstView = m_aContentTree->IsConstantView() &&
828  nullptr;
829  while (pView)
830  {
831  SfxObjectShell* pDoc = pView->GetDocShell();
832  // #i53333# don't show help pages here
833  if ( !pDoc->IsHelpDocument() )
834  {
835  OUString sEntry = pDoc->GetTitle() + " (";
836  if (pView == pActView)
837  {
838  nAct = nCount;
839  sEntry += m_aStatusArr[IDX_STR_ACTIVE];
840  }
841  else
842  sEntry += m_aStatusArr[IDX_STR_INACTIVE];
843  sEntry += ")";
844  m_aDocListBox->InsertEntry(sEntry);
845 
846  if (pConstView && pView == pConstView)
847  nConstPos = nCount;
848 
849  nCount++;
850  }
851  pView = SwModule::GetNextView(pView);
852  }
853  m_aDocListBox->InsertEntry(m_aStatusArr[3]); // "Active Window"
854  nCount++;
855 
857  {
858  OUString sEntry = m_aContentTree->GetHiddenWrtShell()->GetView().
859  GetDocShell()->GetTitle() +
860  " (" +
861  m_aStatusArr[IDX_STR_HIDDEN] +
862  ")";
863  m_aDocListBox->InsertEntry(sEntry);
864  bDisable = false;
865  }
867  {
868  //Either the name of the current Document or "Active Document".
869  m_aDocListBox->SelectEntryPos( pActView ? nAct : --nCount );
870  }
871  else if(m_aContentTree->IsHiddenView())
872  {
873  m_aDocListBox->SelectEntryPos(nCount);
874  }
875  else
876  m_aDocListBox->SelectEntryPos(nConstPos);
877 
878  m_aDocListBox->Enable( !bDisable );
880 }
881 
882 IMPL_LINK(SwNavigationPI, DoneLink, SfxPoolItem const *, pItem, void)
883 {
884  const SfxViewFrameItem* pFrameItem = dynamic_cast<SfxViewFrameItem const *>( pItem );
885  if( pFrameItem )
886  {
887  SfxViewFrame* pFrame = pFrameItem->GetFrame();
888  if(pFrame)
889  {
890  m_aContentTree->Clear();
891  m_pContentView = dynamic_cast<SwView*>( pFrame->GetViewShell() );
892  OSL_ENSURE(m_pContentView, "no SwView");
893  if(m_pContentView)
894  m_pContentWrtShell = m_pContentView->GetWrtShellPtr();
895  else
896  m_pContentWrtShell = nullptr;
897  m_pxObjectShell.reset( new SfxObjectShellLock(pFrame->GetObjectShell()) );
898  FillBox();
899  m_aContentTree->Update();
900  }
901  }
902 }
903 
905 {
906  OUString sFileName;
907  SotClipboardFormatId nFormat;
908  if( rData.HasFormat( nFormat = SotClipboardFormatId::FILE_LIST ))
909  {
910  FileList aFileList;
911  rData.GetFileList( nFormat, aFileList );
912  sFileName = aFileList.GetFile( 0 );
913  }
914  else if( rData.HasFormat( nFormat = SotClipboardFormatId::STRING ) ||
915  rData.HasFormat( nFormat = SotClipboardFormatId::SIMPLE_FILE ) ||
916  rData.HasFormat( nFormat = SotClipboardFormatId::FILENAME ))
917  {
918  (void)rData.GetString(nFormat, sFileName);
919  }
920  else if( rData.HasFormat( nFormat = SotClipboardFormatId::SOLK ) ||
921  rData.HasFormat( nFormat = SotClipboardFormatId::NETSCAPE_BOOKMARK )||
922  rData.HasFormat( nFormat = SotClipboardFormatId::FILECONTENT ) ||
923  rData.HasFormat( nFormat = SotClipboardFormatId::FILEGRPDESCRIPTOR ) ||
924  rData.HasFormat( nFormat = SotClipboardFormatId::UNIFORMRESOURCELOCATOR ))
925  {
926  INetBookmark aBkmk { OUString(), OUString() };
927  if (rData.GetINetBookmark(nFormat, aBkmk))
928  sFileName = aBkmk.GetURL();
929  }
930  if( !sFileName.isEmpty() )
931  {
933  }
934  return sFileName;
935 }
936 
938 {
939  return ( !SwContentTree::IsInDrag() &&
940  ( m_aContentTree->IsDropFormatSupported( SotClipboardFormatId::SIMPLE_FILE ) ||
941  m_aContentTree->IsDropFormatSupported( SotClipboardFormatId::STRING ) ||
942  m_aContentTree->IsDropFormatSupported( SotClipboardFormatId::SOLK ) ||
943  m_aContentTree->IsDropFormatSupported( SotClipboardFormatId::NETSCAPE_BOOKMARK )||
944  m_aContentTree->IsDropFormatSupported( SotClipboardFormatId::FILECONTENT ) ||
945  m_aContentTree->IsDropFormatSupported( SotClipboardFormatId::FILEGRPDESCRIPTOR ) ||
946  m_aContentTree->IsDropFormatSupported( SotClipboardFormatId::UNIFORMRESOURCELOCATOR ) ||
947  m_aContentTree->IsDropFormatSupported( SotClipboardFormatId::FILENAME )))
949  : DND_ACTION_NONE;
950 }
951 
953 {
954  TransferableDataHelper aData( rEvt.maDropEvent.Transferable );
955  sal_Int8 nRet = DND_ACTION_NONE;
957  return nRet;
958 
959  OUString sFileName = SwNavigationPI::CreateDropFileName(aData);
960  if (sFileName.isEmpty())
961  return nRet;
962 
963  INetURLObject aTemp(sFileName);
964  GraphicDescriptor aDesc(aTemp);
965  if (aDesc.Detect()) // accept no graphics
966  return nRet;
967 
968  if (-1 != sFileName.indexOf('#'))
969  return nRet;
970 
971  if (m_sContentFileName.isEmpty() || m_sContentFileName != sFileName)
972  {
973  nRet = rEvt.mnAction;
974  sFileName = comphelper::string::stripEnd(sFileName, 0);
975  m_sContentFileName = sFileName;
976  if(m_pxObjectShell)
977  {
978  m_aContentTree->SetHiddenShell( nullptr );
979  (*m_pxObjectShell)->DoClose();
980  m_pxObjectShell.reset();
981  }
982  SfxStringItem aFileItem(SID_FILE_NAME, sFileName );
983  SfxStringItem aOptionsItem( SID_OPTIONS, "HRC" );
984  SfxLinkItem aLink( SID_DONELINK,
985  LINK( this, SwNavigationPI, DoneLink ) );
987  SID_OPENDOC, SfxCallMode::ASYNCHRON,
988  { &aFileItem, &aOptionsItem, &aLink });
989  }
990  return nRet;
991 }
992 
994 {
995  m_nRegionMode = nNewMode;
997 
998  OUString sImageId;
999  switch (nNewMode)
1000  {
1001  case RegionMode::NONE:
1002  sImageId = RID_BMP_DROP_REGION;
1003  break;
1004  case RegionMode::LINK:
1005  sImageId = RID_BMP_DROP_LINK;
1006  break;
1007  case RegionMode::EMBEDDED:
1008  sImageId = RID_BMP_DROP_COPY;
1009  break;
1010  }
1011  m_aContentToolBox->SetItemImage(m_aContentToolBox->GetItemId("dragmode"), Image(StockImage::Yes, sImageId));
1012 }
1013 
1015 {
1016  bool bGlobalDoc = IsGlobalDoc();
1017  if (!IsGlobalMode() && bGlobalDoc)
1018  {
1019  SetUpdateMode(false);
1020  if (IsZoomedIn())
1021  ZoomOut();
1022  m_aGlobalBox->Show();
1025  m_aContentBox->Hide();
1027  m_aContentToolBox->Hide();
1028  m_aDocListBox->Hide();
1029  SetGlobalMode(true);
1030  SetUpdateMode(true);
1031  }
1032  else
1033  {
1034  m_aGlobalBox->Hide();
1037  if (!IsZoomedIn())
1038  {
1039  m_aContentBox->Show();
1041  m_aContentToolBox->Show();
1042  m_aDocListBox->Show();
1043  }
1044  SetGlobalMode(false);
1045  }
1046 }
1047 
1049 {
1050  bool bRet = false;
1051  SwView *pView = GetCreateView();
1052  if (pView)
1053  {
1054  SwWrtShell &rSh = pView->GetWrtShell();
1055  bRet = rSh.IsGlobalDoc();
1056  }
1057  return bRet;
1058 }
1059 
1060 IMPL_LINK_NOARG(SwNavigationPI, ChangePageHdl, Timer *, void)
1061 {
1062  if (!IsDisposed())
1063  {
1064  EditAction();
1065  GetPageEdit().GrabFocus();
1066  }
1067 }
1068 
1070 {
1071  if (m_aPageChgIdle.IsActive())
1072  m_aPageChgIdle.Stop();
1073  m_aPageChgIdle.Start();
1074 }
1075 
1077 {
1078  if (!m_pCreateView)
1079  {
1080  SwView* pView = SwModule::GetFirstView();
1081  while (pView)
1082  {
1083  if(&pView->GetViewFrame()->GetBindings() == &m_rBindings)
1084  {
1085  const_cast<SwNavigationPI*>(this)->m_pCreateView = pView;
1086  const_cast<SwNavigationPI*>(this)->StartListening(*m_pCreateView);
1087  break;
1088  }
1089  pView = SwModule::GetNextView(pView);
1090  }
1091  }
1092  return m_pCreateView;
1093 }
1094 
1096  sal_uInt16 nId,
1097  SfxBindings* _pBindings )
1098  : SfxChildWindowContext( nId )
1099 {
1100  Reference< XFrame > xFrame = _pBindings->GetActiveFrame();
1101  VclPtr< SwNavigationPI > pNavi = VclPtr< SwNavigationPI >::Create( pParent, xFrame, _pBindings );
1102  _pBindings->Invalidate(SID_NAVIGATOR);
1103 
1104  SwNavigationConfig* pNaviConfig = SW_MOD()->GetNavigationConfig();
1105 
1106  const ContentTypeId nRootType = pNaviConfig->GetRootType();
1107  if( nRootType != ContentTypeId::UNKNOWN )
1108  {
1109  pNavi->m_aContentTree->SetRootType(nRootType);
1110  pNavi->m_aContentToolBox->CheckItem(pNavi->m_aContentToolBox->GetItemId("root"));
1111  if (nRootType == ContentTypeId::OUTLINE)
1112  {
1113  pNavi->m_aContentTree->SetSelectionMode(SelectionMode::Multiple);
1114  pNavi->m_aContentTree->SetDragDropMode(DragDropMode::CTRL_MOVE |
1115  DragDropMode::CTRL_COPY |
1116  DragDropMode::ENABLE_TOP);
1117  }
1118  }
1119  pNavi->m_aContentTree->SetOutlineLevel( static_cast< sal_uInt8 >( pNaviConfig->GetOutlineLevel() ) );
1120  pNavi->SetRegionDropMode( pNaviConfig->GetRegionMode() );
1121 
1122  if (SfxNavigator* pNav = dynamic_cast<SfxNavigator*>(pParent))
1123  {
1124  pNav->SetMinOutputSizePixel(pNavi->GetOptimalSize());
1125  if (pNaviConfig->IsSmall())
1126  pNavi->ZoomIn();
1127  }
1128 
1129  SetWindow(pNavi);
1130 }
1131 
1132 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OString stripEnd(const OString &rIn, char c)
SfxViewFrame * GetViewFrame() const
SwNavigationChild(vcl::Window *, sal_uInt16 nId, SfxBindings *)
Definition: navipi.cxx:1095
::sfx2::sidebar::ControllerItem m_aPageStats
Definition: navipi.hxx:60
SwNavigationConfig * m_pConfig
Definition: navipi.hxx:81
bool IsZoomedIn() const
Definition: navipi.hxx:90
ContentTypeId
Definition: swcont.hxx:28
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
bool IsGlobalActive() const
Definition: navicfg.hxx:92
const css::datatransfer::dnd::DropTargetDropEvent maDropEvent
bool EndPg(bool bSelect=false)
Definition: move.cxx:346
#define HID_NAVIGATOR_GLOBAL_TOOLBOX
Definition: helpids.h:40
void SetMinOutputSizePixel(const Size &rSize)
constexpr sal_uInt16 KEY_MOD1
void ZoomIn()
Definition: navipi.cxx:438
#define FN_TO_FOOTER
Definition: cmdid.h:693
void MoveOutline(SwOutlineNodes::size_type nSource, SwOutlineNodes::size_type nTarget, bool bWithCilds)
Definition: navipi.cxx:90
OUString GetTitle(sal_uInt16 nMaxLen=0) const
#define DND_ACTION_COPY
SwView * GetActiveView()
Definition: swmodul1.cxx:115
const char aData[]
Definition: ww8scan.hxx:47
#define FN_PREV_FOOTNOTE
Definition: cmdid.h:687
virtual ~SwNavigationPI() override
Definition: navipi.cxx:648
void SetRegionDropMode(RegionMode nNewMode)
Definition: navipi.cxx:993
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:2336
SwNavigationPI(vcl::Window *pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > &rxFrame, SfxBindings *_pBindings)
Definition: navipi.cxx:492
void SetHelpId(sal_uInt16 nItemId, const OString &rHelpId)
long Height() const
signed char sal_Int8
bool IsAllProtect() const
Definition: crsrsh.hxx:764
void SetGlobalMode(bool bSet)
Definition: navipi.hxx:114
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:57
void UsePage()
Definition: navipi.cxx:184
void disposeAndClear()
Reference< XFrame > xFrame
css::uno::Reference< css::frame::XFrame > GetActiveFrame() const
void SetAccessibleName(const OUString &rName)
bool IsDropFormatSupported(SotClipboardFormatId nFormat)
void EnableAsyncDrag(bool b)
std::function< std::unique_ptr< UIObject >vcl::Window *)> FactoryFunction
bool IsActiveView() const
Definition: conttree.hxx:227
void SetWeight(FontWeight)
OUString m_aStatusArr[4]
Definition: navipi.hxx:73
void GetPageNum(sal_uInt16 &rnPhyNum, sal_uInt16 &rnVirtNum, bool bAtCursorPos=true, const bool bCalcFrame=true)
Definition: crsrsh.cxx:1200
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:952
SwView * m_pActContView
Definition: navipi.hxx:78
void SetDropDownLineCount(sal_uInt16 nLines)
#define FN_TO_HEADER
Definition: cmdid.h:692
void Clear()
void SetHelpId(const OString &)
#define FN_STAT_PAGE
Definition: cmdid.h:819
#define HID_NAVIGATOR_TOOLBOX
Definition: helpids.h:37
virtual bool Select(SvTreeListEntry *pEntry, bool bSelect=true) override
Definition: content.cxx:3521
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
bool HasFormat(SotClipboardFormatId nFormat) const
void HideTree()
Definition: content.cxx:2740
void connect_value_changed(const Link< weld::SpinButton &, void > &rLink)
Definition: actctrl.hxx:55
SfxHintId GetId() const
void UpdateListBox()
Definition: navipi.cxx:812
SwWrtShell & GetWrtShell() const
Definition: view.hxx:400
bool MakeOutlineSel(SwOutlineNodes::size_type nSttPos, SwOutlineNodes::size_type nEndPos, bool bWithChildren, bool bKillPams=true)
Definition: crstrvl.cxx:1180
virtual Size GetOptimalSize() const override
SfxApplication * SfxGetpApp()
void SwapPam()
Definition: crsrsh.cxx:967
bool IsActive() const
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
StateChangedType
const SwView & GetView() const
Definition: wrtsh.hxx:428
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:651
::sfx2::sidebar::ControllerItem m_aDocFullName
Definition: navipi.hxx:59
WinBits const WB_HSCROLL
bool GotoFootnoteText()
jump from content to footnote
Definition: trvlfnfl.cxx:83
void SetDragDropMode(DragDropMode)
bool IsGlblDocSaveLinks() const
Definition: edglbldc.cxx:49
int nCount
#define DND_ACTION_NONE
ContentTypeId GetRootType() const
Definition: navicfg.hxx:47
VclPtr< ListBox > m_aDocListBox
Definition: navipi.hxx:69
static OUString CreateDropFileName(TransferableDataHelper &rData)
Definition: navipi.cxx:904
void ToggleTree()
Definition: navipi.cxx:1014
const sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:95
VclPtr< VclContainer > m_aGlobalBox
Definition: navipi.hxx:67
bool IsConstantView() const
Definition: conttree.hxx:226
long Top() const
SwWrtShell * m_pContentWrtShell
Definition: navipi.hxx:77
SwWrtShell * GetHiddenWrtShell()
Definition: conttree.hxx:231
SotClipboardFormatId
void SetOutlineLevel(sal_uInt8 nSet)
Definition: content.cxx:3485
sal_Int8 AcceptDrop()
Definition: navipi.cxx:937
bool Update(bool bHard)
Definition: glbltree.cxx:1095
RegionMode GetRegionMode() const
Definition: navicfg.hxx:65
void SetWindow(vcl::Window *pWin)
const SwWrtShell * GetActiveWrtShell() const
Definition: conttree.hxx:230
#define SAL_N_ELEMENTS(arr)
SwOutlineNodes::size_type GetOutlinePos(sal_uInt8 nLevel=UCHAR_MAX)
search "outline position" before previous outline node at given level
Definition: crstrvl.cxx:1157
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
Definition: uiobject.cxx:157
bool IsHiddenView() const
Definition: conttree.hxx:228
virtual void dispose() override
Definition: navipi.cxx:653
void SetActiveShell(SwWrtShell *pSh)
Document change - set new Shell.
Definition: content.cxx:2350
void SetRootType(ContentTypeId nType)
Definition: content.cxx:3554
void SetSelectHdl(const Link< Menu *, bool > &rLink)
#define SW_MOD()
Definition: swmodule.hxx:256
VclPtr< ToolBox > m_aGlobalToolBox
Definition: navipi.hxx:63
static constexpr auto npos
Definition: ndarr.hxx:79
#define HID_NAVI_OUTLINES
Definition: helpids.h:28
static OUString CleanEntry(const OUString &rEntry)
Definition: navipi.cxx:75
sal_uInt16 GetPageCnt()
Definition: crsrsh.cxx:1282
void setMaxWidthChars(sal_Int32 nWidth)
virtual void dispose()
RegionMode
Definition: swcont.hxx:51
void set_max(int nMax)
Definition: actctrl.cxx:38
bool GetString(SotClipboardFormatId nFormat, OUString &rStr)
void SelectEntryPos(sal_Int32 nPos, bool bSelect=true)
virtual void NotifyItemUpdate(const sal_uInt16 nSId, const SfxItemState eState, const SfxPoolItem *pState) override
Definition: navipi.cxx:691
#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:146
void SetUpdateMode(bool bUpdate)
FrameTypeFlags
values can be combined via logical or
Definition: fesh.hxx:62
OUString m_sContentFileName
Definition: navipi.hxx:71
VclPtr< SwGlobalTree > m_aGlobalTree
Definition: navipi.hxx:68
VclPtr< SwContentTree > m_aContentTree
Definition: navipi.hxx:66
WEIGHT_NORMAL
void CheckItem(sal_uInt16 nItemId, bool bCheck=true)
#define FN_SCROLL_NEXT
Definition: cmdid.h:183
long Bottom() const
static SwView * GetFirstView()
Definition: swmodul1.cxx:121
OUString GetFile(size_t nIndex) const
sal_Int32 InsertEntry(const OUString &rStr, sal_Int32 nPos=LISTBOX_APPEND)
#define FN_SCROLL_PREV
Definition: cmdid.h:182
#define FN_START_OF_PAGE
Definition: cmdid.h:643
Idle m_aPageChgIdle
Definition: navipi.hxx:70
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
OUString SwResId(const char *pId)
Definition: swmodule.cxx:178
void SetSelectHdl(const Link< ListBox &, void > &rLink)
void SetSelectHdl(const Link< ToolBox *, void > &rLink)
DocumentType const eType
void GrabFocus()
void SetClickHdl(const Link< ToolBox *, void > &rLink)
SfxViewShell * GetViewShell() const
void SetStyle(WinBits nStyle)
void set_accessible_name(const OUString &rName)
Definition: actctrl.hxx:70
SwDocShell * GetDocShell()
Definition: view.cxx:1107
void SetSmall(bool bSet)
Definition: navicfg.hxx:84
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:340
VclPtr< VclContainer > m_aContentBox
Definition: navipi.hxx:65
bool GotoPrevFootnoteAnchor()
Definition: trvlfnfl.cxx:332
void HideTree()
Definition: glbltree.cxx:1053
virtual void StateChanged(StateChangedType nStateChange) override
Definition: navipi.cxx:730
SwView * GetCreateView() const
Definition: navipi.cxx:1076
void SetSpaceBetweenEntries(short nSpace)
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
virtual void dispose() override
SwView * m_pCreateView
Definition: navipi.hxx:79
static bool IsInDrag()
Definition: conttree.hxx:210
#define FN_SET_REMINDER
Definition: cmdid.h:259
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE) override
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:404
void SetSelectionMode(SelectionMode)
bool IsGlobalDoc() const
Definition: navipi.cxx:1048
static void RegisterChildWindowContext(SfxModule *pMod)
Definition: navipi.cxx:64
#define FN_PAGENUMBER
Definition: cmdid.h:116
void EditAction()
Definition: navipi.cxx:391
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:401
SfxItemState
#define HID_NAVI_DRAG_HYP
Definition: helpids.h:25
void Stop()
SfxViewFrame * GetFrame() const
void MoveCursor(bool bWithSelect=false)
Definition: move.cxx:70
Size m_aExpandedSize
Definition: navipi.hxx:85
bool IsCursorPtAtEnd() const
Definition: crsrsh.hxx:898
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:253
VclPtr< NumEditAction > m_xEdit
Definition: navipi.hxx:64
void SetFont(const vcl::Font &rFont)
bool IsVisible() const
void set_value(int nValue)
Definition: actctrl.hxx:65
SfxEventHintId
void ShowTree()
Definition: content.cxx:2726
bool IsHelpDocument() const
static VclPtr< reference_type > Create(Arg &&...arg)
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
static VclPtr< vcl::Window > Create(vcl::Window *pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > &rxFrame, SfxBindings *pBindings)
Definition: navipi.cxx:479
sal_Int32 GetOutlineLevel() const
Definition: navicfg.hxx:56
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: navipi.cxx:762
bool GetFileList(SotClipboardFormatId nFormat, FileList &rFileList)
void GotoOutline(SwOutlineNodes::size_type nIdx)
Definition: move.cxx:612
void UnSelectFrame()
Definition: select.cxx:322
void Display(bool bOnlyUpdateUserData=false)
Definition: glbltree.cxx:654
const OUString & GetURL() const
void SetInvokeHandler(const Link< Timer *, void > &rLink)
long Left() const
NumEditAction & GetPageEdit()
Definition: navipi.cxx:756
#define FN_NEXT_FOOTNOTE
Definition: cmdid.h:686
static FloatingWindow * GetFloatingWindow(vcl::Window *pParent)
void ClearMark()
Definition: crsrsh.cxx:930
void FillBox()
Definition: navipi.cxx:159
WinBits const WB_TABSTOP
static SwView * GetNextView(SwView const *)
Definition: swmodul1.cxx:128
void LeaveSelFrameMode()
Definition: select.cxx:719
SfxBindings & m_rBindings
Definition: navipi.hxx:82
bool m_bIsZoomedIn
Definition: navipi.hxx:87
WinBits const WB_HASBUTTONS
bool GotoPage(sal_uInt16 nPage, bool bRecord)
Definition: move.cxx:569
sal_uInt16 GetItemId(ImplToolItems::size_type nPos) const
reference_type * get() const
WinBits GetStyle() const
void SetPriority(TaskPriority ePriority)
FactoryFunction GetUITestFactory() const override
Definition: navipi.cxx:384
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
#define FN_END_OF_PAGE
Definition: cmdid.h:644
VclPtr< sfx2::sidebar::SidebarToolBox > m_aContentToolBox
Definition: navipi.hxx:62
void SetHelpId(sal_uInt16 nItemId, const OString &rHelpId)
bool MoveOutlinePara(SwOutlineNodes::difference_type nOffset)
Definition: ednumber.cxx:572
void Display(bool bActiveView)
Show the file.
Definition: content.cxx:1750
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:685
OUString m_aContextArr[3]
Definition: navipi.hxx:72
void setWidth(long nWidth)
void SetReadOnlyUI(bool bReadOnly=true)
WinBits const WB_CLIPCHILDREN
FrameTypeFlags GetFrameType(const Point *pPt, bool bStopAtFly) const
For return values see above FrameType.
Definition: fews.cxx:236
void ShowTree()
Definition: glbltree.cxx:1047
bool IsFrameSelected() const
Definition: feshview.cxx:1158
void SetGlblDocSaveLinks(bool bFlag)
Definition: edglbldc.cxx:39
std::unique_ptr< SfxObjectShellLock > m_pxObjectShell
Definition: navipi.hxx:75
bool IsSmall() const
Definition: navicfg.hxx:83
Definition: view.hxx:146
void set_expand(bool bExpand)
bool GotoFooterText()
jump from the content to the footer
Definition: crstrvl.cxx:155
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
bool IsGlobalDoc() const
Interfaces for GlobalDocument.
Definition: edglbldc.cxx:34
RegionMode m_nRegionMode
Definition: navipi.hxx:84
void setHeight(long nHeight)
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo