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/viewfrm.hxx>
29#include <tools/urlobj.hxx>
30#include <osl/diagnose.h>
31#include <swtypes.hxx>
32#include <swmodule.hxx>
33#include <view.hxx>
34#include <navicfg.hxx>
35#include <wrtsh.hxx>
36#include <docsh.hxx>
37#include <navipi.hxx>
38#include <edtwin.hxx>
39#include <sfx2/app.hxx>
40#include <cmdid.h>
41#include <helpids.h>
42
43#include <strings.hrc>
44#include <bitmaps.hlst>
45
46#include <memory>
47
48#include <o3tl/enumrange.hxx>
49
50#include <workctrl.hxx>
51
52using namespace ::com::sun::star::uno;
53using namespace ::com::sun::star::frame;
54
55// Filter the control characters out of the Outline-Entry
56OUString SwNavigationPI::CleanEntry(const OUString& rEntry)
57{
58 if (rEntry.isEmpty())
59 return rEntry;
60
61 OUStringBuffer aEntry(rEntry);
62 for (sal_Int32 i = 0; i < rEntry.getLength(); ++i)
63 if(aEntry[i] == 10 || aEntry[i] == 9)
64 aEntry[i] = 0x20;
65
66 return aEntry.makeStringAndClear();
67}
68
69// Execution of the drag operation with and without the children.
70
72{
73 SwView *pView = GetCreateView();
74 SwWrtShell &rSh = pView->GetWrtShell();
75 if(nTarget < nSource || nTarget == SwOutlineNodes::npos)
76 nTarget ++;
77 if ( !rSh.IsOutlineMovable( nSource ))
78 return;
79
80 SwOutlineNodes::difference_type nMove = nTarget-nSource; //( nDir<0 ) ? 1 : 0 ;
81 rSh.GotoOutline(nSource);
82 rSh.MakeOutlineSel(nSource, nSource, true);
83 // While moving, the selected children does not counting.
84 const SwOutlineNodes::size_type nLastOutlinePos = rSh.GetOutlinePos(MAXLEVEL);
85 if(nMove > 1 && nLastOutlinePos < nTarget)
86 {
87 if(!rSh.IsCursorPtAtEnd())
88 rSh.SwapPam();
89 nMove -= nLastOutlinePos - nSource;
90 }
91 if( nMove < 1 || nLastOutlinePos < nTarget )
92 rSh.MoveOutlinePara( nMove );
93 rSh.ClearMark();
94 rSh.GotoOutline( nSource + nMove);
95
96}
97
98// After goto cancel the status frame selection
100{
101 if (pSh->IsFrameSelected())
102 {
103 pSh->UnSelectFrame();
104 pSh->LeaveSelFrameMode();
105 }
106}
107
108// Select the document view
109IMPL_LINK(SwNavigationPI, DocListBoxSelectHdl, weld::ComboBox&, rBox, void)
110{
111 int nEntryIdx = rBox.get_active();
112 SwView *pView ;
113 pView = SwModule::GetFirstView();
114 while (nEntryIdx-- && pView)
115 {
116 pView = SwModule::GetNextView(pView);
117 }
118 if(!pView)
119 {
120 nEntryIdx == 0 ?
121 m_xContentTree->ShowHiddenShell():
122 m_xContentTree->ShowActualView();
123
124 }
125 else
126 {
127 m_xContentTree->SetConstantShell(pView->GetWrtShellPtr());
128 }
129}
130
132{
134 const SfxPoolItem* aArgs[2];
135 aArgs[0] = &aParam;
136 aArgs[1] = nullptr;
137 SfxDispatcher* pDispatcher = GetCreateView()->GetFrame()->GetDispatcher();
138 pDispatcher->Execute(FN_NAV_ELEMENT, SfxCallMode::SYNCHRON, aArgs);
139}
140
141IMPL_LINK(SwNavigationPI, NavigateByComboBoxSelectHdl, weld::ComboBox&, rComboBox, void)
142{
143 m_xContentTree->SelectContentType(rComboBox.get_active_text());
144 UpdateNavigateBy();
145}
146
147// Filling of the list box for outline view or documents
148// The PI will be set to full size
150{
152 {
153 m_xContentTree->SetHiddenShell( m_pContentWrtShell );
154 m_xContentTree->Display( false );
155 }
156 else
157 {
158 SwView *pView = GetCreateView();
159 if(!pView)
160 {
161 m_xContentTree->SetActiveShell(nullptr);
162 }
163 else if( pView != m_pActContView)
164 {
165 SwWrtShell* pWrtShell = pView->GetWrtShellPtr();
166 m_xContentTree->SetActiveShell(pWrtShell);
167 }
168 else
169 m_xContentTree->Display( true );
170 m_pActContView = pView;
171 if (m_pActContView)
172 m_xContentTree->UpdateTracking();
173 }
174}
175
177{
178 SwView *pView = GetCreateView();
179 SwWrtShell *pSh = pView ? &pView->GetWrtShell() : nullptr;
180 m_xEdit->set_value(1);
181 if (pSh)
182 {
183 const sal_uInt16 nPageCnt = pSh->GetPageCnt();
184 sal_uInt16 nPhyPage, nVirPage;
185 pSh->GetPageNum(nPhyPage, nVirPage);
186
187 m_xEdit->set_max(nPageCnt);
188 m_xEdit->set_width_chars(3);
189 m_xEdit->set_value(nPhyPage);
190 }
191}
192
193// Select handler of the toolboxes
194IMPL_LINK(SwNavigationPI, ToolBoxSelectHdl, const OString&, rCommand, void)
195{
196 SwView *pView = GetCreateView();
197 if (!pView)
198 return;
199 SwWrtShell &rSh = pView->GetWrtShell();
200 // Get MouseModifier for Outline-Move
201
202 int nFuncId = 0;
203 bool bFocusToDoc = false;
204 if (rCommand == ".uno:ScrollToPrevious" || rCommand == ".uno:ScrollToNext")
205 {
206 bool *pbNext = new bool(true);
207 if (rCommand == ".uno:ScrollToPrevious")
208 *pbNext = false;
209 pView->MoveNavigationHdl(pbNext);
210 }
211 else if (rCommand == "root")
212 {
213 m_xContentTree->ToggleToRoot();
214 }
215 else if (rCommand == "listbox")
216 {
217 if (ParentIsFloatingWindow(m_xNavigatorDlg))
218 {
219 if (IsZoomedIn())
220 {
221 ZoomOut();
222 }
223 else
224 {
225 ZoomIn();
226 }
227 }
228 return;
229 }
230 // Functions that will trigger a direct action.
231 else if (rCommand == "footer")
232 {
233 rSh.MoveCursor();
234 const FrameTypeFlags eType = rSh.GetFrameType(nullptr,false);
236 {
237 if (rSh.EndPg())
238 nFuncId = FN_END_OF_PAGE;
239 }
240 else if (rSh.GotoFooterText())
241 nFuncId = FN_TO_FOOTER;
242 bFocusToDoc = true;
243 }
244 else if (rCommand == "header")
245 {
246 rSh.MoveCursor();
247 const FrameTypeFlags eType = rSh.GetFrameType(nullptr,false);
249 {
250 if (rSh.SttPg())
251 nFuncId = FN_START_OF_PAGE;
252 }
253 else if (rSh.GotoHeaderText())
254 nFuncId = FN_TO_HEADER;
255 bFocusToDoc = true;
256 }
257 else if (rCommand == "anchor")
258 {
259 rSh.MoveCursor();
260 const FrameTypeFlags eFrameType = rSh.GetFrameType(nullptr,false);
261 // Jump from the footnote to the anchor.
262 if (eFrameType & FrameTypeFlags::FOOTNOTE)
263 {
264 if (rSh.GotoFootnoteAnchor())
265 nFuncId = FN_FOOTNOTE_TO_ANCHOR;
266 }
267 // Otherwise, jump to the first footnote text;
268 // go to the next footnote if this is not possible;
269 // if this is also not possible got to the footnote before.
270 else
271 {
272 if (rSh.GotoFootnoteText())
273 nFuncId = FN_FOOTNOTE_TO_ANCHOR;
274 else if (rSh.GotoNextFootnoteAnchor())
275 nFuncId = FN_NEXT_FOOTNOTE;
276 else if (rSh.GotoPrevFootnoteAnchor())
277 nFuncId = FN_PREV_FOOTNOTE;
278 }
279 bFocusToDoc = true;
280 }
281 else if (rCommand == "reminder")
282 {
283 rSh.GetView().GetViewFrame()->GetDispatcher()->Execute(FN_SET_REMINDER, SfxCallMode::ASYNCHRON);
284 }
285 else if (rCommand == "chapterdown" ||
286 rCommand == "movedown" ||
287 rCommand == "chapterup" ||
288 rCommand == "moveup" ||
289 rCommand == "promote" ||
290 rCommand == "demote" ||
291 rCommand == "edit")
292 {
293 if (IsGlobalMode())
294 m_xGlobalTree->ExecCommand(rCommand);
295 else
296 {
297 // Standard: sublevels are taken
298 // do not take sublevels with Ctrl
299 bool bOutlineWithChildren = (KEY_MOD1 != m_xContent6ToolBox->get_modifier_state());
300 m_xContentTree->ExecCommand(rCommand, bOutlineWithChildren);
301 }
302 }
303 else if (rCommand == "contenttoggle" || rCommand == "globaltoggle")
304 {
305 ToggleTree();
306 bool bGlobalMode = IsGlobalMode();
307 m_pConfig->SetGlobalActive(bGlobalMode);
308 m_xGlobalToolBox->set_item_active("globaltoggle", bGlobalMode);
309 m_xContent1ToolBox->set_item_active("contenttoggle", bGlobalMode);
310 }
311 else if (rCommand == "save")
312 {
313 bool bSave = rSh.IsGlblDocSaveLinks();
314 rSh.SetGlblDocSaveLinks( !bSave );
315 m_xGlobalToolBox->set_item_active(rCommand, !bSave);
316 }
317 else if (rCommand == "dragmode")
318 m_xContent6ToolBox->set_menu_item_active("dragmode", !m_xContent6ToolBox->get_menu_item_active("dragmode"));
319 else if (rCommand == "headings")
320 m_xContent5ToolBox->set_menu_item_active("headings", !m_xContent5ToolBox->get_menu_item_active("headings"));
321 else if (rCommand == "update")
322 m_xGlobalToolBox->set_menu_item_active("update", !m_xGlobalToolBox->get_menu_item_active("update"));
323 else if (rCommand == "insert")
324 m_xGlobalToolBox->set_menu_item_active("insert", !m_xGlobalToolBox->get_menu_item_active("insert"));
325
326 if (nFuncId)
327 lcl_UnSelectFrame(&rSh);
328 if (bFocusToDoc)
329 pView->GetEditWin().GrabFocus();
330}
331
332// Click handler of the toolboxes
333IMPL_LINK(SwNavigationPI, ToolBoxClickHdl, const OString&, rCommand, void)
334{
335 if (!m_xGlobalToolBox->get_menu_item_active(rCommand))
336 return;
337
338 if (rCommand == "update")
339 m_xGlobalTree->TbxMenuHdl(rCommand, *m_xUpdateMenu);
340 else if (rCommand == "insert")
341 m_xGlobalTree->TbxMenuHdl(rCommand, *m_xInsertMenu);
342}
343
344IMPL_LINK(SwNavigationPI, ToolBox6DropdownClickHdl, const OString&, rCommand, void)
345{
346 if (!m_xContent6ToolBox->get_menu_item_active(rCommand))
347 return;
348
349 if (rCommand != "dragmode")
350 return;
351
352 switch (m_nRegionMode)
353 {
354 case RegionMode::NONE:
355 m_xDragModeMenu->set_active("hyperlink", true);
356 break;
357 case RegionMode::LINK:
358 m_xDragModeMenu->set_active("link", true);
359 break;
360 case RegionMode::EMBEDDED:
361 m_xDragModeMenu->set_active("copy", true);
362 break;
363 }
364}
365
366IMPL_LINK(SwNavigationPI, DropModeMenuSelectHdl, const OString&, rIdent, void)
367{
368 if (rIdent == "hyperlink")
369 SetRegionDropMode(RegionMode::NONE);
370 else if (rIdent == "link")
371 SetRegionDropMode(RegionMode::LINK);
372 else if (rIdent == "copy")
373 SetRegionDropMode(RegionMode::EMBEDDED);
374}
375
376IMPL_LINK(SwNavigationPI, GlobalMenuSelectHdl, const OString&, rIdent, void)
377{
378 m_xGlobalTree->ExecuteContextMenuAction(rIdent);
379}
380
381IMPL_LINK(SwNavigationPI, ToolBox5DropdownClickHdl, const OString&, rCommand, void)
382{
383 if (!m_xContent5ToolBox->get_menu_item_active(rCommand))
384 return;
385
386 if (rCommand == "headings")
387 m_xHeadingsMenu->set_active(OString::number(m_xContentTree->GetOutlineLevel()), true);
388}
389
390// Action-Handler Edit:
391// Switches to the page if the structure view is not turned on.
393{
394 SwView *pView = GetCreateView();
395 if (!pView)
396 return false;
397
400
401 // if the user has clicked into the document, forget about changing the page
402 if (pView->GetEditWin().HasFocus())
403 return false;
404
406 sal_uInt16 nNewPage = m_xEdit->get_value();
407
408 rSh.GotoPage(nNewPage, true);
410
411 return true;
412}
413
415{
416 if (!IsZoomedIn())
417 return;
419 if (!pNav)
420 return;
421 m_bIsZoomedIn = false;
422 FillBox();
423 if (IsGlobalMode())
424 {
425 m_xGlobalBox->show();
426 m_xGlobalTree->ShowTree();
427 }
428 else
429 {
430 m_xContentBox->show();
431 m_xContentTree->ShowTree();
432 m_xDocListBox->show();
433 }
434
435 pNav->InvalidateChildSizeCache();
436 Size aOptimalSize(pNav->GetOptimalSize());
437 Size aNewSize(pNav->GetOutputSizePixel());
438 aNewSize.setHeight( m_aExpandedSize.Height() );
439 pNav->SetMinOutputSizePixel(aOptimalSize);
440 pNav->SetOutputSizePixel(aNewSize);
441
442 m_xContentTree->Select(); // Enable toolbox
443 m_pConfig->SetSmall(false);
444 m_xContent6ToolBox->set_item_active("listbox", true);
445}
446
448{
449 if (IsZoomedIn())
450 return;
452 if (!pNav)
453 return;
454
455 m_aExpandedSize = m_xNavigatorDlg->GetSizePixel();
456
457 m_xContentBox->hide();
458 m_xContentTree->HideTree();
459 m_xGlobalBox->hide();
460 m_xGlobalTree->HideTree();
461 m_xDocListBox->hide();
462 m_bIsZoomedIn = true;
463
464 pNav->InvalidateChildSizeCache();
465 Size aOptimalSize(pNav->GetOptimalSize());
466 Size aNewSize(pNav->GetOutputSizePixel());
467 aNewSize.setHeight( aOptimalSize.Height() );
468 pNav->SetMinOutputSizePixel(aOptimalSize);
469 pNav->SetOutputSizePixel(aNewSize);
470
471 m_xContentTree->Select(); // Enable toolbox
472
473 m_pConfig->SetSmall(true);
474 m_xContent6ToolBox->set_item_active("listbox", false);
475}
476
477namespace {
478
479enum StatusIndex
480{
481 IDX_STR_HIDDEN = 0,
482 IDX_STR_ACTIVE = 1,
483 IDX_STR_INACTIVE = 2
484};
485
486}
487
488std::unique_ptr<PanelLayout> SwNavigationPI::Create(weld::Widget* pParent,
489 const css::uno::Reference<css::frame::XFrame>& rxFrame,
490 SfxBindings* pBindings)
491{
492 if( pParent == nullptr )
493 throw css::lang::IllegalArgumentException("no parent window given to SwNavigationPI::Create", nullptr, 0);
494 if( !rxFrame.is() )
495 throw css::lang::IllegalArgumentException("no XFrame given to SwNavigationPI::Create", nullptr, 0);
496 if( pBindings == nullptr )
497 throw css::lang::IllegalArgumentException("no SfxBindings given to SwNavigationPI::Create", nullptr, 0);
498 return std::make_unique<SwNavigationPI>(pParent, rxFrame, pBindings, nullptr);
499}
500
502 const css::uno::Reference<css::frame::XFrame>& rxFrame,
503 SfxBindings* _pBindings, SfxNavigator* pNavigatorDlg)
504 : PanelLayout(pParent, "NavigatorPanel", "modules/swriter/ui/navigatorpanel.ui")
505 , m_aDocFullName(SID_DOCFULLNAME, *_pBindings, *this)
506 , m_aPageStats(FN_STAT_PAGE, *_pBindings, *this)
507 , m_xContent1ToolBox(m_xBuilder->weld_toolbar("content1"))
508 , m_xContent2ToolBox(m_xBuilder->weld_toolbar("content2"))
509 , m_xContent3ToolBox(m_xBuilder->weld_toolbar("content3"))
510 , m_xContent4ToolBox(m_xBuilder->weld_toolbar("content4"))
511 , m_xContent5ToolBox(m_xBuilder->weld_toolbar("content5"))
512 , m_xContent6ToolBox(m_xBuilder->weld_toolbar("content6"))
513 , m_xContent2Dispatch(new ToolbarUnoDispatcher(*m_xContent2ToolBox, *m_xBuilder, rxFrame))
514 , m_xContent3Dispatch(new ToolbarUnoDispatcher(*m_xContent3ToolBox, *m_xBuilder, rxFrame))
515 , m_xHeadingsMenu(m_xBuilder->weld_menu("headingsmenu"))
516 , m_xDragModeMenu(m_xBuilder->weld_menu("dragmodemenu"))
517 , m_xUpdateMenu(m_xBuilder->weld_menu("updatemenu"))
518 , m_xInsertMenu(m_xBuilder->weld_menu("insertmenu"))
519 , m_xGlobalToolBox(m_xBuilder->weld_toolbar("global"))
520 , m_xEdit(m_xBuilder->weld_spin_button("spinbutton"))
521 , m_xContentBox(m_xBuilder->weld_widget("contentbox"))
522 , m_xContentTree(new SwContentTree(m_xBuilder->weld_tree_view("contenttree"), this))
523 , m_xGlobalBox(m_xBuilder->weld_widget("globalbox"))
524 , m_xGlobalTree(new SwGlobalTree(m_xBuilder->weld_tree_view("globaltree"), this))
525 , m_xDocListBox(m_xBuilder->weld_combo_box("documents"))
526 , m_aPageChgIdle("SwNavigationPI m_aPageChgIdle")
527 , m_xNavigatorDlg(pNavigatorDlg)
528 , m_pContentView(nullptr)
529 , m_pContentWrtShell(nullptr)
530 , m_pActContView(nullptr)
531 , m_pCreateView(nullptr)
532 , m_pConfig(SW_MOD()->GetNavigationConfig())
533 , m_rBindings(*_pBindings)
534 , m_nRegionMode(RegionMode::NONE)
535 , m_bIsZoomedIn(false)
536 , m_bGlobalMode(false)
537{
538 m_xContainer->connect_container_focus_changed(LINK(this, SwNavigationPI, SetFocusChildHdl));
539
540 Reference<XToolbarController> xController =
541 m_xContent2Dispatch->GetControllerForCommand(".uno:NavElement");
542 NavElementToolBoxControl* pToolBoxControl =
543 dynamic_cast<NavElementToolBoxControl*>(xController.get());
544 assert(pToolBoxControl);
545 m_pNavigateByComboBox = pToolBoxControl->GetComboBox();
546
547 // Restore content tree settings before calling UpdateInitShow. UpdateInitShow calls Fillbox,
548 // which calls Display and UpdateTracking. Incorrect outline levels could be displayed and
549 // unexpected content tracking could occur if these content tree settings are not done before.
550 m_xContentTree->SetOutlineLevel(static_cast<sal_uInt8>(m_pConfig->GetOutlineLevel()));
551 m_xContentTree->SetOutlineTracking(static_cast<sal_uInt8>(m_pConfig->GetOutlineTracking()));
553 {
554 if (eCntTypeId != ContentTypeId::OUTLINE)
555 m_xContentTree->SetContentTypeTracking(
556 eCntTypeId, m_pConfig->IsContentTypeTrack(eCntTypeId));
557 }
558
559 if (const ContentTypeId nRootType = m_pConfig->GetRootType();
560 nRootType != ContentTypeId::UNKNOWN)
561 {
562 m_xContentTree->SetRootType(nRootType);
563 m_xContent5ToolBox->set_item_active("root", true);
564 if (nRootType == ContentTypeId::OUTLINE || nRootType == ContentTypeId::DRAWOBJECT)
565 m_xContentTree->set_selection_mode(SelectionMode::Multiple);
566 else
567 m_xContentTree->set_selection_mode(SelectionMode::Single);
568 }
569 else
570 m_xContentTree->set_selection_mode(SelectionMode::Single);
571
573
575
584 m_xDocListBox->set_size_request(42, -1); // set a nominal width so it takes width of surroundings
585
586 // Insert the numeric field in the toolbox.
587 m_xEdit->set_accessible_name(m_xEdit->get_tooltip_text());
588 m_xEdit->set_width_chars(3);
589 m_xEdit->connect_activate(LINK(this, SwNavigationPI, EditActionHdl));
590 m_xEdit->connect_value_changed(LINK(this, SwNavigationPI, PageEditModifyHdl));
591 m_xEdit->set_help_id("modules/swriter/ui/navigatorpanel/numericfield");
592
593 if (!IsGlobalDoc())
594 {
595 m_xContent1ToolBox->set_item_visible("contenttoggle", false);
596 }
597
598 const TranslateId REGIONNAME_ARY[] =
599 {
600 STR_HYPERLINK,
601 STR_LINK_REGION,
602 STR_COPY_REGION
603 };
604
605 const TranslateId REGIONMODE_ARY[] =
606 {
607 STR_HIDDEN,
608 STR_ACTIVE,
609 STR_INACTIVE
610 };
611
612 static_assert(SAL_N_ELEMENTS(REGIONNAME_ARY) == SAL_N_ELEMENTS(REGIONMODE_ARY), "### unexpected size!");
613 static_assert(SAL_N_ELEMENTS(REGIONNAME_ARY) == static_cast<sal_uInt16>(RegionMode::EMBEDDED) + 1, "### unexpected size!");
614
615 for (sal_uInt16 i = 0; i <= static_cast<sal_uInt16>(RegionMode::EMBEDDED); ++i)
616 {
617 m_aStatusArr[i] = SwResId(REGIONMODE_ARY[i]);
618 }
619
620 m_aStatusArr[3] = SwResId(STR_ACTIVE_VIEW);
621
622 bool bFloatingNavigator = ParentIsFloatingWindow(m_xNavigatorDlg);
623
625
626 m_xContentTree->ShowTree();
627 m_xContent6ToolBox->set_item_active("listbox", true);
628 m_xContent6ToolBox->set_item_sensitive("listbox", bFloatingNavigator);
629
630// TreeListBox for global document
631 m_xGlobalTree->set_selection_mode(SelectionMode::Multiple);
632
633// Handler
634 Link<const OString&, void> aLk = LINK(this, SwNavigationPI, ToolBoxSelectHdl);
635 m_xContent1ToolBox->connect_clicked(aLk);
636 m_xContent3ToolBox->connect_clicked(aLk);
637 m_xContent5ToolBox->connect_clicked(aLk);
638 m_xContent6ToolBox->connect_clicked(aLk);
639 m_xGlobalToolBox->connect_clicked(aLk);
640 m_xDocListBox->connect_changed(LINK(this, SwNavigationPI, DocListBoxSelectHdl));
641 m_xContent5ToolBox->set_item_menu("headings", m_xHeadingsMenu.get());
642 m_xHeadingsMenu->connect_activate(LINK(this, SwNavigationPI, HeadingsMenuSelectHdl));
643 m_xContent5ToolBox->connect_menu_toggled(LINK(this, SwNavigationPI, ToolBox5DropdownClickHdl));
644 m_xContent6ToolBox->set_item_menu("dragmode", m_xDragModeMenu.get());
645 m_xDragModeMenu->connect_activate(LINK(this, SwNavigationPI, DropModeMenuSelectHdl));
646 m_xContent6ToolBox->connect_menu_toggled(LINK(this, SwNavigationPI, ToolBox6DropdownClickHdl));
647 m_xGlobalToolBox->set_item_menu("update", m_xUpdateMenu.get());
648 m_xUpdateMenu->connect_activate(LINK(this, SwNavigationPI, GlobalMenuSelectHdl));
649 m_xGlobalToolBox->set_item_menu("insert", m_xInsertMenu.get());
650 m_xInsertMenu->connect_activate(LINK(this, SwNavigationPI, GlobalMenuSelectHdl));
651 m_xGlobalToolBox->connect_menu_toggled(LINK(this, SwNavigationPI, ToolBoxClickHdl));
652 m_xGlobalToolBox->set_item_active("globaltoggle", true);
653 m_pNavigateByComboBox->connect_changed(LINK(this, SwNavigationPI, NavigateByComboBoxSelectHdl));
654
655// set toolbar of both modes to widest of each
656 m_xGlobalToolBox->set_size_request(m_xContent1ToolBox->get_preferred_size().Width() +
657 m_xContent2ToolBox->get_preferred_size().Width() +
658 m_xContent3ToolBox->get_preferred_size().Width() +
659 m_xContent4ToolBox->get_preferred_size().Width(), -1);
660
662
663 if(IsGlobalDoc())
664 {
665 SwView *pActView = GetCreateView();
666 m_xGlobalToolBox->set_item_active("save",
667 pActView->GetWrtShellPtr()->IsGlblDocSaveLinks());
669 ToggleTree();
670 if (bFloatingNavigator)
671 m_xGlobalTree->grab_focus();
672 }
673 else if (bFloatingNavigator)
674 m_xContentTree->grab_focus();
675 UsePage();
676 m_aPageChgIdle.SetInvokeHandler(LINK(this, SwNavigationPI, ChangePageHdl));
677 m_aPageChgIdle.SetPriority(TaskPriority::LOWEST);
678
679 m_xContentTree->set_accessible_name(SwResId(STR_ACCESS_TL_CONTENT));
680 m_xGlobalTree->set_accessible_name(SwResId(STR_ACCESS_TL_GLOBAL));
681 m_xDocListBox->set_accessible_name(m_aStatusArr[3]);
682
683 m_aExpandedSize = m_xContainer->get_preferred_size();
684}
685
687{
688 if (m_xNavigatorDlg)
689 return m_xNavigatorDlg->GetFrameWeld();
691}
692
694{
695 if (IsGlobalDoc() && !IsGlobalMode())
696 {
697 SwView *pView = GetCreateView();
698 SwWrtShell &rSh = pView->GetWrtShell();
699 if (!rSh.IsAllProtect())
700 pView->GetDocShell()->SetReadOnlyUI(false);
701 }
702
704
705 if (m_pxObjectShell)
706 {
707 if (m_pxObjectShell->Is())
708 (*m_pxObjectShell)->DoClose();
709 m_pxObjectShell.reset();
710 }
711
712 m_xDocListBox.reset();
713 m_xGlobalTree.reset();
714 m_xGlobalBox.reset();
715 m_xContentTree.reset();
716 m_xContentBox.reset();
717 m_xGlobalToolBox.reset();
718 m_xEdit.reset();
719 m_xHeadingsMenu.reset();
720 m_xDragModeMenu.reset();
721 m_xUpdateMenu.reset();
722 m_xInsertMenu.reset();
723 m_xContent2Dispatch.reset();
724 m_xContent3Dispatch.reset();
725 m_xContent1ToolBox.reset();
726 m_xContent2ToolBox.reset();
727 m_xContent3ToolBox.reset();
728 m_xContent4ToolBox.reset();
729 m_xContent5ToolBox.reset();
730 m_xContent6ToolBox.reset();
731
733
736}
737
738void SwNavigationPI::NotifyItemUpdate(sal_uInt16 nSID, SfxItemState /*eState*/,
739 const SfxPoolItem* /*pState*/)
740{
741 if (nSID == SID_DOCFULLNAME)
742 {
743 SwView *pActView = GetCreateView();
744 if(pActView)
745 {
746 SwWrtShell* pWrtShell = pActView->GetWrtShellPtr();
747 m_xContentTree->SetActiveShell(pWrtShell);
748 bool bGlobal = IsGlobalDoc();
749 m_xContent1ToolBox->set_item_visible("contenttoggle", bGlobal);
750 if ((!bGlobal && IsGlobalMode()) || (!IsGlobalMode() && m_pConfig->IsGlobalActive()))
751 {
752 ToggleTree();
753 }
754 if (bGlobal)
755 {
756 m_xGlobalToolBox->set_item_active("save", pWrtShell->IsGlblDocSaveLinks());
757 }
758 }
759 else
760 {
761 m_xContentTree->SetActiveShell(nullptr);
762 }
764 }
765 else if (nSID == FN_STAT_PAGE)
766 {
767 SwView *pActView = GetCreateView();
768 if(pActView)
769 {
770 SwWrtShell &rSh = pActView->GetWrtShell();
771 m_xEdit->set_max(rSh.GetPageCnt());
772 m_xEdit->set_width_chars(3);
773 }
774 }
775}
776
778{
779 // if the parent isn't a float, then the navigator is displayed in
780 // the sidebar or is otherwise docked. While the navigator could change
781 // its size, the sidebar can not, and the navigator would just waste
782 // space. Therefore disable this button.
783 bool bParentIsFloatingWindow(ParentIsFloatingWindow(m_xNavigatorDlg));
784 m_xContent6ToolBox->set_item_sensitive("listbox", bParentIsFloatingWindow);
785 // show content if docked
786 if (!bParentIsFloatingWindow && IsZoomedIn())
787 ZoomOut();
788 if (!IsZoomedIn())
789 FillBox();
790}
791
793{
794 // update documents listbox
795 UpdateListBox();
796}
797
798// Notification on modified DocInfo
800{
801 if(&rBrdc == m_pCreateView)
802 {
803 if (rHint.GetId() == SfxHintId::Dying)
804 {
806 m_pCreateView = nullptr;
807 m_xContentTree->SetActiveShell(nullptr);
808 }
809 }
810 else
811 {
812 if (const SfxEventHint* pHint = dynamic_cast<const SfxEventHint*>(&rHint))
813 {
814 SfxEventHintId eEventId = pHint->GetEventId();
815 if (eEventId == SfxEventHintId::OpenDoc)
816 {
817 SwView *pActView = GetCreateView();
818 if(pActView)
819 {
820 SwWrtShell* pWrtShell = pActView->GetWrtShellPtr();
821 m_xContentTree->SetActiveShell(pWrtShell);
822 if (m_xGlobalTree->get_visible())
823 {
824 bool bUpdateAll = m_xGlobalTree->Update(false);
825 // If no update is needed, then update the font colors
826 // at the entries of broken links.
827 m_xGlobalTree->Display(!bUpdateAll);
828 }
829 }
830 }
831 }
832 }
833}
834
835IMPL_LINK( SwNavigationPI, HeadingsMenuSelectHdl, const OString&, rMenuId, void )
836{
837 if (!rMenuId.isEmpty())
838 m_xContentTree->SetOutlineLevel(rMenuId.toUInt32());
839}
840
842{
843 if (!m_xDocListBox) // disposed
844 return;
845
846 m_xDocListBox->freeze();
847 m_xDocListBox->clear();
848 SwView *pActView = GetCreateView();
849 bool bDisable = pActView == nullptr;
851 sal_Int32 nCount = 0;
852 sal_Int32 nAct = 0;
853 sal_Int32 nConstPos = 0;
854 const SwView* pConstView = m_xContentTree->IsConstantView() &&
855 m_xContentTree->GetActiveWrtShell() ?
856 &m_xContentTree->GetActiveWrtShell()->GetView():
857 nullptr;
858 while (pView)
859 {
860 SfxObjectShell* pDoc = pView->GetDocShell();
861 // #i53333# don't show help pages here
862 if ( !pDoc->IsHelpDocument() )
863 {
864 OUString sEntry = pDoc->GetTitle() + " (";
865 if (pView == pActView)
866 {
867 nAct = nCount;
868 sEntry += m_aStatusArr[IDX_STR_ACTIVE];
869 }
870 else
871 sEntry += m_aStatusArr[IDX_STR_INACTIVE];
872 sEntry += ")";
873 m_xDocListBox->append_text(sEntry);
874
875 if (pConstView && pView == pConstView)
876 nConstPos = nCount;
877
878 nCount++;
879 }
880 pView = SwModule::GetNextView(pView);
881 }
882 m_xDocListBox->append_text(m_aStatusArr[3]); // "Active Window"
883 nCount++;
884
885 if(m_xContentTree->GetHiddenWrtShell())
886 {
887 OUString sEntry = m_xContentTree->GetHiddenWrtShell()->GetView().
888 GetDocShell()->GetTitle() +
889 " (" +
890 m_aStatusArr[IDX_STR_HIDDEN] +
891 ")";
892 m_xDocListBox->append_text(sEntry);
893 bDisable = false;
894 }
895
896 m_xDocListBox->thaw();
897
898 if(m_xContentTree->IsActiveView())
899 {
900 //Either the name of the current Document or "Active Document".
901 m_xDocListBox->set_active(pActView ? nAct : --nCount);
902 }
903 else if(m_xContentTree->IsHiddenView())
904 {
905 m_xDocListBox->set_active(nCount);
906 }
907 else
908 m_xDocListBox->set_active(nConstPos);
909
910 m_xDocListBox->set_sensitive(!bDisable);
911}
912
913IMPL_LINK(SwNavigationPI, DoneLink, SfxPoolItem const *, pItem, void)
914{
915 const SfxViewFrameItem* pFrameItem = dynamic_cast<SfxViewFrameItem const *>( pItem );
916 if( !pFrameItem )
917 return;
918
919 SfxViewFrame* pFrame = pFrameItem->GetFrame();
920 if(pFrame)
921 {
922 m_xContentTree->clear();
923 m_pContentView = dynamic_cast<SwView*>( pFrame->GetViewShell() );
924 OSL_ENSURE(m_pContentView, "no SwView");
925 if(m_pContentView)
926 m_pContentWrtShell = m_pContentView->GetWrtShellPtr();
927 else
928 m_pContentWrtShell = nullptr;
929 m_pxObjectShell.reset( new SfxObjectShellLock(pFrame->GetObjectShell()) );
930 FillBox();
931 }
932}
933
935{
936 OUString sFileName;
937 SotClipboardFormatId nFormat;
938 if( rData.HasFormat( nFormat = SotClipboardFormatId::FILE_LIST ))
939 {
940 FileList aFileList;
941 rData.GetFileList( nFormat, aFileList );
942 sFileName = aFileList.GetFile( 0 );
943 }
944 else if( rData.HasFormat( nFormat = SotClipboardFormatId::STRING ) ||
945 rData.HasFormat( nFormat = SotClipboardFormatId::SIMPLE_FILE ) ||
946 rData.HasFormat( nFormat = SotClipboardFormatId::FILENAME ))
947 {
948 (void)rData.GetString(nFormat, sFileName);
949 }
950 else if( rData.HasFormat( nFormat = SotClipboardFormatId::SOLK ) ||
951 rData.HasFormat( nFormat = SotClipboardFormatId::NETSCAPE_BOOKMARK )||
952 rData.HasFormat( nFormat = SotClipboardFormatId::FILECONTENT ) ||
953 rData.HasFormat( nFormat = SotClipboardFormatId::FILEGRPDESCRIPTOR ) ||
954 rData.HasFormat( nFormat = SotClipboardFormatId::UNIFORMRESOURCELOCATOR ))
955 {
956 INetBookmark aBkmk { OUString(), OUString() };
957 if (rData.GetINetBookmark(nFormat, aBkmk))
958 sFileName = aBkmk.GetURL();
959 }
960 if( !sFileName.isEmpty() )
961 {
963 }
964 return sFileName;
965}
966
968{
969 return ( !m_xContentTree->IsInDrag() &&
970 ( m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::SIMPLE_FILE ) ||
971 m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::STRING ) ||
972 m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::SOLK ) ||
973 m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::NETSCAPE_BOOKMARK )||
974 m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::FILECONTENT ) ||
975 m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::FILEGRPDESCRIPTOR ) ||
976 m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::UNIFORMRESOURCELOCATOR ) ||
977 m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::FILENAME )))
980}
981
983{
984 TransferableDataHelper aData( rEvt.maDropEvent.Transferable );
986 if (m_xContentTree->IsInDrag())
987 return nRet;
988
989 OUString sFileName = SwNavigationPI::CreateDropFileName(aData);
990 if (sFileName.isEmpty())
991 return nRet;
992
993 INetURLObject aTemp(sFileName);
994 GraphicDescriptor aDesc(aTemp);
995 if (aDesc.Detect()) // accept no graphics
996 return nRet;
997
998 if (-1 != sFileName.indexOf('#'))
999 return nRet;
1000
1001 if (m_sContentFileName.isEmpty() || m_sContentFileName != sFileName)
1002 {
1003 nRet = rEvt.mnAction;
1004 sFileName = comphelper::string::stripEnd(sFileName, 0);
1005 m_sContentFileName = sFileName;
1006 if(m_pxObjectShell)
1007 {
1008 m_xContentTree->SetHiddenShell( nullptr );
1009 (*m_pxObjectShell)->DoClose();
1010 m_pxObjectShell.reset();
1011 }
1012 SfxStringItem aFileItem(SID_FILE_NAME, sFileName );
1013 SfxStringItem aOptionsItem( SID_OPTIONS, "HRC" );
1014 SfxLinkItem aLink( SID_DONELINK,
1015 LINK( this, SwNavigationPI, DoneLink ) );
1017 SID_OPENDOC, SfxCallMode::ASYNCHRON,
1018 { &aFileItem, &aOptionsItem, &aLink });
1019 }
1020 return nRet;
1021}
1022
1024{
1025 m_nRegionMode = nNewMode;
1027
1028 OUString sImageId;
1029 switch (nNewMode)
1030 {
1031 case RegionMode::NONE:
1032 sImageId = RID_BMP_DROP_REGION;
1033 break;
1034 case RegionMode::LINK:
1035 sImageId = RID_BMP_DROP_LINK;
1036 break;
1037 case RegionMode::EMBEDDED:
1038 sImageId = RID_BMP_DROP_COPY;
1039 break;
1040 }
1041 m_xContent6ToolBox->set_item_icon_name("dragmode", sImageId);
1042}
1043
1045{
1046 bool bGlobalDoc = IsGlobalDoc();
1047 if (!IsGlobalMode() && bGlobalDoc)
1048 {
1049 if (IsZoomedIn())
1050 ZoomOut();
1051 m_xGlobalBox->show();
1052 m_xGlobalTree->ShowTree();
1053 m_xGlobalToolBox->show();
1054 m_xContentBox->hide();
1055 m_xContentTree->HideTree();
1056 m_xContent1ToolBox->hide();
1057 m_xContent2ToolBox->hide();
1058 m_xContent3ToolBox->hide();
1059 m_xContent4ToolBox->hide();
1060 m_xContent5ToolBox->hide();
1061 m_xContent6ToolBox->hide();
1062 m_xDocListBox->hide();
1063 SetGlobalMode(true);
1064 }
1065 else
1066 {
1067 m_xGlobalBox->hide();
1068 m_xGlobalTree->HideTree();
1069 m_xGlobalToolBox->hide();
1070 if (!IsZoomedIn())
1071 {
1072 m_xContentBox->show();
1073 m_xContentTree->ShowTree();
1074 m_xContent1ToolBox->show();
1075 m_xContent2ToolBox->show();
1076 m_xContent3ToolBox->show();
1077 m_xContent4ToolBox->show();
1078 m_xContent5ToolBox->show();
1079 m_xContent6ToolBox->show();
1080 m_xDocListBox->show();
1081 }
1082 SetGlobalMode(false);
1083 }
1084}
1085
1087{
1088 bool bRet = false;
1089 SwView *pView = GetCreateView();
1090 if (pView)
1091 {
1092 SwWrtShell &rSh = pView->GetWrtShell();
1093 bRet = rSh.IsGlobalDoc();
1094 }
1095 return bRet;
1096}
1097
1098IMPL_LINK_NOARG(SwNavigationPI, ChangePageHdl, Timer *, void)
1099{
1100 if (!m_xDocListBox) // disposed
1101 return;
1102 // tdf#134959 if the SpinButton changed value this Timer was launched, now
1103 // change to the desired page, but we leave focus where it currently is,
1104 // i.e. typically remaining in the spinbutton, or whatever other widget the
1105 // user moved to in the meantime
1106 EditAction();
1107}
1108
1109void SwNavigationPI::SelectNavigateByContentType(const OUString& rContentTypeName)
1110{
1111 if (auto nPos = m_pNavigateByComboBox->find_text(rContentTypeName); nPos != -1)
1112 {
1115 }
1116}
1117
1119{
1120 // tdf#134959 if the user presses enter to activate the Entry
1121 // go to the page, and on success we move focus to the document
1122 if (EditAction())
1123 m_pCreateView->GetEditWin().GrabFocus();
1124 return true;
1125}
1126
1128{
1129 if (m_aPageChgIdle.IsActive())
1130 m_aPageChgIdle.Stop();
1131 m_aPageChgIdle.Start();
1132}
1133
1135{
1136 if (!m_pCreateView)
1137 {
1138 SwView* pView = SwModule::GetFirstView();
1139 while (pView)
1140 {
1141 if(&pView->GetViewFrame()->GetBindings() == &m_rBindings)
1142 {
1143 const_cast<SwNavigationPI*>(this)->m_pCreateView = pView;
1144 const_cast<SwNavigationPI*>(this)->StartListening(*m_pCreateView);
1145 break;
1146 }
1147 pView = SwModule::GetNextView(pView);
1148 }
1149 }
1150 return m_pCreateView;
1151}
1152
1154{
1155private:
1156 std::unique_ptr<SwNavigationPI> m_xNavi;
1157public:
1158 SwNavigatorWin(SfxBindings* _pBindings, SfxChildWindow* _pMgr,
1159 vcl::Window* pParent, SfxChildWinInfo* pInfo);
1160 virtual void StateChanged(StateChangedType nStateChange) override;
1161 virtual void dispose() override
1162 {
1163 m_xNavi.reset();
1165 }
1166 virtual ~SwNavigatorWin() override
1167 {
1168 disposeOnce();
1169 }
1170};
1171
1173 vcl::Window* pParent, SfxChildWinInfo* pInfo)
1174 : SfxNavigator(_pBindings, _pMgr, pParent, pInfo)
1175 , m_xNavi(std::make_unique<SwNavigationPI>(m_xContainer.get(), _pBindings->GetActiveFrame(), _pBindings, this))
1176{
1177 _pBindings->Invalidate(SID_NAVIGATOR);
1178
1179 SwNavigationConfig* pNaviConfig = SW_MOD()->GetNavigationConfig();
1180
1181 SetMinOutputSizePixel(GetOptimalSize());
1182 if (pNaviConfig->IsSmall())
1183 m_xNavi->ZoomIn();
1184}
1185
1187{
1188 SfxNavigator::StateChanged(nStateChange);
1189 if (nStateChange == StateChangedType::InitShow)
1190 m_xNavi->UpdateInitShow();
1191}
1192
1194
1196 SfxBindings* pBindings, SfxChildWinInfo* pInfo)
1197 : SfxNavigatorWrapper(_pParent, nId)
1198{
1199 SetWindow(VclPtr<SwNavigatorWin>::Create(pBindings, this, _pParent, pInfo));
1200 Initialize();
1201}
1202
1203/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxApplication * SfxGetpApp()
SFX2_DLLPUBLIC bool ParentIsFloatingWindow(const vcl::Window *pParent)
OUString GetFile(size_t nIndex) const
bool Detect(bool bExtendedInfo=false)
const OUString & GetURL() const
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
weld::ComboBox * GetComboBox()
Definition: workctrl.hxx:186
virtual weld::Window * GetFrameWeld() const
std::unique_ptr< weld::Container > m_xContainer
void Invalidate(sal_uInt16 nId)
void SetWindow(const VclPtr< vcl::Window > &p)
virtual void dispose()
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
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 * >())
virtual void StateChanged(StateChangedType nStateChange) override
virtual void dispose() override
void SetMinOutputSizePixel(const Size &rSize)
SfxHintId GetId() const
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
void SetReadOnlyUI(bool bReadOnly=true)
OUString GetTitle(sal_uInt16 nMaxLen=0) const
bool IsHelpDocument() const
SfxViewFrame * GetFrame() const
SfxViewShell * GetViewShell() const
SfxViewFrame * GetFrame() const
SfxBindings & GetBindings()
SfxDispatcher * GetDispatcher()
virtual SfxObjectShell * GetObjectShell() override
SfxViewFrame * GetViewFrame() const
constexpr tools::Long Height() const
void setHeight(tools::Long nHeight)
TreeListBox for content indicator.
Definition: conttree.hxx:88
bool GotoNextFootnoteAnchor()
Definition: trvlfnfl.cxx:339
bool GotoHeaderText()
jump from the content to the header
Definition: crstrvl.cxx:132
void SwapPam()
Definition: crsrsh.cxx:976
void MakeOutlineSel(SwOutlineNodes::size_type nSttPos, SwOutlineNodes::size_type nEndPos, bool bWithChildren, bool bKillPams=true)
Definition: crstrvl.cxx:1214
void GetPageNum(sal_uInt16 &rnPhyNum, sal_uInt16 &rnVirtNum, bool bAtCursorPos=true, const bool bCalcFrame=true)
Definition: crsrsh.cxx:1209
bool GotoFootnoteText()
jump from content to footnote
Definition: trvlfnfl.cxx:89
void ClearMark()
Definition: crsrsh.cxx:939
bool GotoPrevFootnoteAnchor()
Definition: trvlfnfl.cxx:344
SwOutlineNodes::size_type GetOutlinePos(sal_uInt8 nLevel=UCHAR_MAX, SwPaM *pPaM=nullptr)
search "outline position" before previous outline node at given level
Definition: crstrvl.cxx:1185
bool IsCursorPtAtEnd() const
Definition: crsrsh.hxx:914
bool GotoFooterText()
jump from the content to the footer
Definition: crstrvl.cxx:160
sal_uInt16 GetPageCnt()
Definition: crsrsh.cxx:1291
bool IsAllProtect() const
Definition: crsrsh.hxx:779
void SetGlblDocSaveLinks(bool bFlag)
Definition: edglbldc.cxx:38
bool IsGlblDocSaveLinks() const
Definition: edglbldc.cxx:48
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:622
bool MoveOutlinePara(SwOutlineNodes::difference_type nOffset)
Definition: ednumber.cxx:543
bool IsGlobalDoc() const
Interfaces for GlobalDocument.
Definition: edglbldc.cxx:33
FrameTypeFlags GetFrameType(const Point *pPt, bool bStopAtFly) const
For return values see above FrameType.
Definition: fews.cxx:237
bool IsFrameSelected() const
Definition: feshview.cxx:1253
static SwView * GetNextView(SwView const *)
Definition: swmodul1.cxx:129
static SwView * GetFirstView()
Definition: swmodul1.cxx:122
sal_Int32 GetOutlineLevel() const
Definition: navicfg.hxx:60
sal_Int32 GetOutlineTracking() const
Definition: navicfg.hxx:105
void SetSmall(bool bSet)
Definition: navicfg.hxx:88
bool IsGlobalActive() const
Definition: navicfg.hxx:96
bool IsSmall() const
Definition: navicfg.hxx:87
RegionMode GetRegionMode() const
Definition: navicfg.hxx:69
bool IsContentTypeTrack(ContentTypeId eCntTypeId)
Definition: navicfg.hxx:114
void SetRegionMode(RegionMode nSet)
Definition: navicfg.hxx:70
ContentTypeId GetRootType() const
Definition: navicfg.hxx:51
SfxBindings & m_rBindings
Definition: navipi.hxx:85
SwNavigationPI(weld::Widget *pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > &rxFrame, SfxBindings *_pBindings, SfxNavigator *pNavigatorDlg)
Definition: navipi.cxx:501
void ZoomIn()
Definition: navipi.cxx:447
std::unique_ptr< weld::Widget > m_xGlobalBox
Definition: navipi.hxx:69
virtual void NotifyItemUpdate(const sal_uInt16 nSId, const SfxItemState eState, const SfxPoolItem *pState) override
Definition: navipi.cxx:738
bool IsZoomedIn() const
Definition: navipi.hxx:95
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: navipi.cxx:799
std::unique_ptr< SfxObjectShellLock > m_pxObjectShell
Definition: navipi.hxx:78
bool IsGlobalDoc() const
Definition: navipi.cxx:1086
void SetGlobalMode(bool bSet)
Definition: navipi.hxx:125
RegionMode m_nRegionMode
Definition: navipi.hxx:87
weld::ComboBox * m_pNavigateByComboBox
Definition: navipi.hxx:93
std::unique_ptr< weld::Toolbar > m_xContent4ToolBox
Definition: navipi.hxx:56
void ZoomOut()
Definition: navipi.cxx:414
SwView * GetCreateView() const
Definition: navipi.cxx:1134
sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt)
Definition: navipi.cxx:982
bool IsGlobalMode() const
Definition: navipi.hxx:159
Size m_aExpandedSize
Definition: navipi.hxx:88
Idle m_aPageChgIdle
Definition: navipi.hxx:72
static OUString CreateDropFileName(const TransferableDataHelper &rData)
Definition: navipi.cxx:934
static std::unique_ptr< PanelLayout > Create(weld::Widget *pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > &rxFrame, SfxBindings *pBindings)
Definition: navipi.cxx:488
virtual ~SwNavigationPI() override
Definition: navipi.cxx:693
std::unique_ptr< weld::Toolbar > m_xContent1ToolBox
Definition: navipi.hxx:53
std::unique_ptr< weld::Toolbar > m_xGlobalToolBox
Definition: navipi.hxx:65
std::unique_ptr< weld::Toolbar > m_xContent2ToolBox
Definition: navipi.hxx:54
std::unique_ptr< ToolbarUnoDispatcher > m_xContent3Dispatch
Definition: navipi.hxx:60
std::unique_ptr< weld::SpinButton > m_xEdit
Definition: navipi.hxx:66
bool m_bIsZoomedIn
Definition: navipi.hxx:90
std::unique_ptr< SwContentTree > m_xContentTree
Definition: navipi.hxx:68
SwView * m_pActContView
Definition: navipi.hxx:81
void MoveOutline(SwOutlineNodes::size_type nSource, SwOutlineNodes::size_type nTarget)
Definition: navipi.cxx:71
std::unique_ptr< weld::Menu > m_xDragModeMenu
Definition: navipi.hxx:62
std::unique_ptr< weld::Menu > m_xUpdateMenu
Definition: navipi.hxx:63
std::unique_ptr< weld::Toolbar > m_xContent3ToolBox
Definition: navipi.hxx:55
sal_Int8 AcceptDrop()
Definition: navipi.cxx:967
bool EditAction()
Definition: navipi.cxx:392
SwNavigationConfig * m_pConfig
Definition: navipi.hxx:84
void FillBox()
Definition: navipi.cxx:149
virtual weld::Window * GetFrameWeld() const override
Definition: navipi.cxx:686
void UpdateInitShow()
Definition: navipi.cxx:777
void UpdateListBox()
Definition: navipi.cxx:841
std::unique_ptr< weld::Toolbar > m_xContent5ToolBox
Definition: navipi.hxx:57
::sfx2::sidebar::ControllerItem m_aDocFullName
Definition: navipi.hxx:50
void UsePage()
Definition: navipi.cxx:176
void ToggleTree()
Definition: navipi.cxx:1044
VclPtr< SfxNavigator > m_xNavigatorDlg
Definition: navipi.hxx:76
static OUString CleanEntry(const OUString &rEntry)
Definition: navipi.cxx:56
void SelectNavigateByContentType(const OUString &rContentTypeName)
Definition: navipi.cxx:1109
void SetRegionDropMode(RegionMode nNewMode)
Definition: navipi.cxx:1023
SwWrtShell * m_pContentWrtShell
Definition: navipi.hxx:80
OUString m_aStatusArr[4]
Definition: navipi.hxx:74
std::unique_ptr< weld::Menu > m_xInsertMenu
Definition: navipi.hxx:64
std::unique_ptr< weld::Menu > m_xHeadingsMenu
Definition: navipi.hxx:61
std::unique_ptr< SwGlobalTree > m_xGlobalTree
Definition: navipi.hxx:70
OUString m_sContentFileName
Definition: navipi.hxx:73
std::unique_ptr< ToolbarUnoDispatcher > m_xContent2Dispatch
Definition: navipi.hxx:59
std::unique_ptr< weld::Widget > m_xContentBox
Definition: navipi.hxx:67
SwView * m_pCreateView
Definition: navipi.hxx:82
::sfx2::sidebar::ControllerItem m_aPageStats
Definition: navipi.hxx:51
void UpdateNavigateBy()
Definition: navipi.cxx:131
std::unique_ptr< weld::ComboBox > m_xDocListBox
Definition: navipi.hxx:71
std::unique_ptr< weld::Toolbar > m_xContent6ToolBox
Definition: navipi.hxx:58
virtual void dispose() override
Definition: navipi.cxx:1161
SwNavigatorWin(SfxBindings *_pBindings, SfxChildWindow *_pMgr, vcl::Window *pParent, SfxChildWinInfo *pInfo)
Definition: navipi.cxx:1172
virtual ~SwNavigatorWin() override
Definition: navipi.cxx:1166
virtual void StateChanged(StateChangedType nStateChange) override
Definition: navipi.cxx:1186
std::unique_ptr< SwNavigationPI > m_xNavi
Definition: navipi.cxx:1156
SwNavigatorWrapper(vcl::Window *pParent, sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo *pInfo)
Definition: navipi.cxx:1195
static constexpr auto npos
Definition: ndarr.hxx:81
Definition: view.hxx:146
SwWrtShell & GetWrtShell() const
Definition: view.hxx:416
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:417
SwEditWin & GetEditWin()
Definition: view.hxx:419
SwDocShell * GetDocShell()
Definition: view.cxx:1160
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
bool EndPg(bool bSelect=false)
Definition: move.cxx:350
void LeaveSelFrameMode()
Definition: select.cxx:720
bool GotoPage(sal_uInt16 nPage, bool bRecord)
Definition: move.cxx:573
bool SttPg(bool bSelect=false)
Definition: move.cxx:344
void GotoFootnoteAnchor(const SwTextFootnote &rTextFootnote)
Definition: move.cxx:709
void GotoOutline(SwOutlineNodes::size_type nIdx)
Definition: move.cxx:617
void UnSelectFrame()
Definition: select.cxx:323
void MoveCursor(bool bWithSelect=false)
Definition: move.cxx:74
const SwView & GetView() const
Definition: wrtsh.hxx:443
bool IsActive() const
void SetPriority(TaskPriority ePriority)
void Stop()
void SetInvokeHandler(const Link< Timer *, void > &rLink)
bool GetString(SotClipboardFormatId nFormat, OUString &rStr) const
bool GetFileList(SotClipboardFormatId nFormat, FileList &rFileList) const
bool HasFormat(SotClipboardFormatId nFormat) const
bool GetINetBookmark(SotClipboardFormatId nFormat, INetBookmark &rBmk) const
reference_type * get() const
std::vector< Value >::difference_type difference_type
void GrabFocus()
bool HasFocus() const
virtual int find_text(const OUString &rStr) const=0
virtual OUString get_active_id() const=0
virtual void set_active(int pos)=0
void connect_changed(const Link< ComboBox &, void > &rLink)
#define FN_PREV_FOOTNOTE
Definition: cmdid.h:714
#define FN_FOOTNOTE_TO_ANCHOR
Definition: cmdid.h:712
#define FN_TO_FOOTER
Definition: cmdid.h:720
#define FN_NAV_ELEMENT
Definition: cmdid.h:183
#define FN_TO_HEADER
Definition: cmdid.h:719
#define FN_STAT_PAGE
Definition: cmdid.h:847
#define FN_START_OF_PAGE
Definition: cmdid.h:670
#define FN_SET_REMINDER
Definition: cmdid.h:279
#define FN_NEXT_FOOTNOTE
Definition: cmdid.h:713
#define FN_END_OF_PAGE
Definition: cmdid.h:671
int nCount
SfxEventHintId
FrameTypeFlags
values can be combined via logical or
Definition: fesh.hxx:63
DocumentType eType
SotClipboardFormatId
constexpr OStringLiteral HID_NAVIGATOR_LISTBOX
Definition: helpids.h:34
constexpr OStringLiteral HID_NAVIGATOR_GLOBAL_TOOLBOX
Definition: helpids.h:35
constexpr OStringLiteral HID_NAVIGATOR_TOOLBOX
Definition: helpids.h:33
constexpr sal_uInt16 KEY_MOD1
sal_uInt16 nPos
#define SAL_N_ELEMENTS(arr)
constexpr OUStringLiteral aData
Definition: ww8scan.hxx:48
OString stripEnd(const OString &rIn, char c)
RegionMode
int i
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
IMPL_LINK(SwNavigationPI, DocListBoxSelectHdl, weld::ComboBox &, rBox, void)
Definition: navipi.cxx:109
static void lcl_UnSelectFrame(SwWrtShell *pSh)
Definition: navipi.cxx:99
SFX_IMPL_DOCKINGWINDOW(SwNavigatorWrapper, SID_NAVIGATOR)
IMPL_LINK_NOARG(SwNavigationPI, SetFocusChildHdl, weld::Container &, void)
Definition: navipi.cxx:792
Reference< XNameAccess > m_xContainer
sal_Int16 nId
SfxItemState
const css::datatransfer::dnd::DropTargetDropEvent maDropEvent
Reference< XController > xController
ContentTypeId
Definition: swcont.hxx:30
SwView * GetActiveView()
Definition: swmodul1.cxx:116
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:165
#define SW_MOD()
Definition: swmodule.hxx:256
constexpr sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:92
#define DND_ACTION_COPY
#define DND_ACTION_NONE
unsigned char sal_uInt8
signed char sal_Int8
StateChangedType