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 if (pActView && pActView->GetWrtShellPtr())
667 m_xGlobalToolBox->set_item_active("save",
668 pActView->GetWrtShellPtr()->IsGlblDocSaveLinks());
670 ToggleTree();
671 if (bFloatingNavigator)
672 m_xGlobalTree->grab_focus();
673 }
674 else if (bFloatingNavigator)
675 m_xContentTree->grab_focus();
676 UsePage();
677 m_aPageChgIdle.SetInvokeHandler(LINK(this, SwNavigationPI, ChangePageHdl));
678 m_aPageChgIdle.SetPriority(TaskPriority::LOWEST);
679
680 m_xContentTree->set_accessible_name(SwResId(STR_ACCESS_TL_CONTENT));
681 m_xGlobalTree->set_accessible_name(SwResId(STR_ACCESS_TL_GLOBAL));
682 m_xDocListBox->set_accessible_name(m_aStatusArr[3]);
683
684 m_aExpandedSize = m_xContainer->get_preferred_size();
685}
686
688{
689 if (m_xNavigatorDlg)
690 return m_xNavigatorDlg->GetFrameWeld();
692}
693
695{
696 if (IsGlobalDoc() && !IsGlobalMode())
697 {
698 SwView *pView = GetCreateView();
699 SwWrtShell &rSh = pView->GetWrtShell();
700 if (!rSh.IsAllProtect())
701 pView->GetDocShell()->SetReadOnlyUI(false);
702 }
703
705
706 if (m_oObjectShell)
707 {
708 if (m_oObjectShell->Is())
709 (*m_oObjectShell)->DoClose();
710 m_oObjectShell.reset();
711 }
712
713 m_xDocListBox.reset();
714 m_xGlobalTree.reset();
715 m_xGlobalBox.reset();
716 m_xContentTree.reset();
717 m_xContentBox.reset();
718 m_xGlobalToolBox.reset();
719 m_xEdit.reset();
720 m_xHeadingsMenu.reset();
721 m_xDragModeMenu.reset();
722 m_xUpdateMenu.reset();
723 m_xInsertMenu.reset();
724 m_xContent2Dispatch.reset();
725 m_xContent3Dispatch.reset();
726 m_xContent1ToolBox.reset();
727 m_xContent2ToolBox.reset();
728 m_xContent3ToolBox.reset();
729 m_xContent4ToolBox.reset();
730 m_xContent5ToolBox.reset();
731 m_xContent6ToolBox.reset();
732
734
737}
738
739void SwNavigationPI::NotifyItemUpdate(sal_uInt16 nSID, SfxItemState /*eState*/,
740 const SfxPoolItem* /*pState*/)
741{
742 if (nSID == SID_DOCFULLNAME)
743 {
744 SwView *pActView = GetCreateView();
745 if(pActView)
746 {
747 SwWrtShell* pWrtShell = pActView->GetWrtShellPtr();
748 m_xContentTree->SetActiveShell(pWrtShell);
749 bool bGlobal = IsGlobalDoc();
750 m_xContent1ToolBox->set_item_visible("contenttoggle", bGlobal);
751 if ((!bGlobal && IsGlobalMode()) || (!IsGlobalMode() && m_pConfig->IsGlobalActive()))
752 {
753 ToggleTree();
754 }
755 if (bGlobal)
756 {
757 m_xGlobalToolBox->set_item_active("save", pWrtShell->IsGlblDocSaveLinks());
758 }
759 }
760 else
761 {
762 m_xContentTree->SetActiveShell(nullptr);
763 }
765 }
766 else if (nSID == FN_STAT_PAGE)
767 {
768 SwView *pActView = GetCreateView();
769 if(pActView)
770 {
771 SwWrtShell &rSh = pActView->GetWrtShell();
772 m_xEdit->set_max(rSh.GetPageCnt());
773 m_xEdit->set_width_chars(3);
774 }
775 }
776}
777
779{
780 // if the parent isn't a float, then the navigator is displayed in
781 // the sidebar or is otherwise docked. While the navigator could change
782 // its size, the sidebar can not, and the navigator would just waste
783 // space. Therefore disable this button.
784 bool bParentIsFloatingWindow(ParentIsFloatingWindow(m_xNavigatorDlg));
785 m_xContent6ToolBox->set_item_sensitive("listbox", bParentIsFloatingWindow);
786 // show content if docked
787 if (!bParentIsFloatingWindow && IsZoomedIn())
788 ZoomOut();
789 if (!IsZoomedIn())
790 FillBox();
791}
792
794{
795 // update documents listbox
796 UpdateListBox();
797}
798
799// Notification on modified DocInfo
801{
802 if(&rBrdc == m_pCreateView)
803 {
804 if (rHint.GetId() == SfxHintId::Dying)
805 {
807 m_pCreateView = nullptr;
808 m_xContentTree->SetActiveShell(nullptr);
809 }
810 }
811 else
812 {
813 if (const SfxEventHint* pHint = dynamic_cast<const SfxEventHint*>(&rHint))
814 {
815 SfxEventHintId eEventId = pHint->GetEventId();
816 if (eEventId == SfxEventHintId::OpenDoc)
817 {
818 SwView *pActView = GetCreateView();
819 if(pActView)
820 {
821 SwWrtShell* pWrtShell = pActView->GetWrtShellPtr();
822 m_xContentTree->SetActiveShell(pWrtShell);
823 if (m_xGlobalTree->get_visible())
824 {
825 bool bUpdateAll = m_xGlobalTree->Update(false);
826 // If no update is needed, then update the font colors
827 // at the entries of broken links.
828 m_xGlobalTree->Display(!bUpdateAll);
829 }
830 }
831 }
832 }
833 }
834}
835
836IMPL_LINK( SwNavigationPI, HeadingsMenuSelectHdl, const OString&, rMenuId, void )
837{
838 if (!rMenuId.isEmpty())
839 m_xContentTree->SetOutlineLevel(rMenuId.toUInt32());
840}
841
843{
844 if (!m_xDocListBox) // disposed
845 return;
846
847 m_xDocListBox->freeze();
848 m_xDocListBox->clear();
849 SwView *pActView = GetCreateView();
850 bool bDisable = pActView == nullptr;
852 sal_Int32 nCount = 0;
853 sal_Int32 nAct = 0;
854 sal_Int32 nConstPos = 0;
855 const SwView* pConstView = m_xContentTree->IsConstantView() &&
856 m_xContentTree->GetActiveWrtShell() ?
857 &m_xContentTree->GetActiveWrtShell()->GetView():
858 nullptr;
859 while (pView)
860 {
861 SfxObjectShell* pDoc = pView->GetDocShell();
862 // #i53333# don't show help pages here
863 if ( !pDoc->IsHelpDocument() )
864 {
865 OUString sEntry = pDoc->GetTitle() + " (";
866 if (pView == pActView)
867 {
868 nAct = nCount;
869 sEntry += m_aStatusArr[IDX_STR_ACTIVE];
870 }
871 else
872 sEntry += m_aStatusArr[IDX_STR_INACTIVE];
873 sEntry += ")";
874 m_xDocListBox->append_text(sEntry);
875
876 if (pConstView && pView == pConstView)
877 nConstPos = nCount;
878
879 nCount++;
880 }
881 pView = SwModule::GetNextView(pView);
882 }
883 m_xDocListBox->append_text(m_aStatusArr[3]); // "Active Window"
884 nCount++;
885
886 if(m_xContentTree->GetHiddenWrtShell())
887 {
888 OUString sEntry = m_xContentTree->GetHiddenWrtShell()->GetView().
889 GetDocShell()->GetTitle() +
890 " (" +
891 m_aStatusArr[IDX_STR_HIDDEN] +
892 ")";
893 m_xDocListBox->append_text(sEntry);
894 bDisable = false;
895 }
896
897 m_xDocListBox->thaw();
898
899 if(m_xContentTree->IsActiveView())
900 {
901 //Either the name of the current Document or "Active Document".
902 m_xDocListBox->set_active(pActView ? nAct : --nCount);
903 }
904 else if(m_xContentTree->IsHiddenView())
905 {
906 m_xDocListBox->set_active(nCount);
907 }
908 else
909 m_xDocListBox->set_active(nConstPos);
910
911 m_xDocListBox->set_sensitive(!bDisable);
912}
913
914IMPL_LINK(SwNavigationPI, DoneLink, SfxPoolItem const *, pItem, void)
915{
916 const SfxViewFrameItem* pFrameItem = dynamic_cast<SfxViewFrameItem const *>( pItem );
917 if( !pFrameItem )
918 return;
919
920 SfxViewFrame* pFrame = pFrameItem->GetFrame();
921 if(pFrame)
922 {
923 m_xContentTree->clear();
924 m_pContentView = dynamic_cast<SwView*>( pFrame->GetViewShell() );
925 OSL_ENSURE(m_pContentView, "no SwView");
926 if(m_pContentView)
927 m_pContentWrtShell = m_pContentView->GetWrtShellPtr();
928 else
929 m_pContentWrtShell = nullptr;
930 m_oObjectShell.emplace( pFrame->GetObjectShell() );
931 FillBox();
932 }
933}
934
936{
937 OUString sFileName;
938 SotClipboardFormatId nFormat;
939 if( rData.HasFormat( nFormat = SotClipboardFormatId::FILE_LIST ))
940 {
941 FileList aFileList;
942 rData.GetFileList( nFormat, aFileList );
943 sFileName = aFileList.GetFile( 0 );
944 }
945 else if( rData.HasFormat( nFormat = SotClipboardFormatId::STRING ) ||
946 rData.HasFormat( nFormat = SotClipboardFormatId::SIMPLE_FILE ) ||
947 rData.HasFormat( nFormat = SotClipboardFormatId::FILENAME ))
948 {
949 (void)rData.GetString(nFormat, sFileName);
950 }
951 else if( rData.HasFormat( nFormat = SotClipboardFormatId::SOLK ) ||
952 rData.HasFormat( nFormat = SotClipboardFormatId::NETSCAPE_BOOKMARK )||
953 rData.HasFormat( nFormat = SotClipboardFormatId::FILECONTENT ) ||
954 rData.HasFormat( nFormat = SotClipboardFormatId::FILEGRPDESCRIPTOR ) ||
955 rData.HasFormat( nFormat = SotClipboardFormatId::UNIFORMRESOURCELOCATOR ))
956 {
957 INetBookmark aBkmk { OUString(), OUString() };
958 if (rData.GetINetBookmark(nFormat, aBkmk))
959 sFileName = aBkmk.GetURL();
960 }
961 if( !sFileName.isEmpty() )
962 {
964 }
965 return sFileName;
966}
967
969{
970 return ( !m_xContentTree->IsInDrag() &&
971 ( m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::SIMPLE_FILE ) ||
972 m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::STRING ) ||
973 m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::SOLK ) ||
974 m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::NETSCAPE_BOOKMARK )||
975 m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::FILECONTENT ) ||
976 m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::FILEGRPDESCRIPTOR ) ||
977 m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::UNIFORMRESOURCELOCATOR ) ||
978 m_xContentTree->IsDropFormatSupported( SotClipboardFormatId::FILENAME )))
981}
982
984{
985 TransferableDataHelper aData( rEvt.maDropEvent.Transferable );
987 if (m_xContentTree->IsInDrag())
988 return nRet;
989
990 OUString sFileName = SwNavigationPI::CreateDropFileName(aData);
991 if (sFileName.isEmpty())
992 return nRet;
993
994 INetURLObject aTemp(sFileName);
995 GraphicDescriptor aDesc(aTemp);
996 if (aDesc.Detect()) // accept no graphics
997 return nRet;
998
999 if (-1 != sFileName.indexOf('#'))
1000 return nRet;
1001
1002 if (m_sContentFileName.isEmpty() || m_sContentFileName != sFileName)
1003 {
1004 nRet = rEvt.mnAction;
1005 sFileName = comphelper::string::stripEnd(sFileName, 0);
1006 m_sContentFileName = sFileName;
1007 if(m_oObjectShell)
1008 {
1009 m_xContentTree->SetHiddenShell( nullptr );
1010 (*m_oObjectShell)->DoClose();
1011 m_oObjectShell.reset();
1012 }
1013 SfxStringItem aFileItem(SID_FILE_NAME, sFileName );
1014 SfxStringItem aOptionsItem( SID_OPTIONS, "HRC" );
1015 SfxLinkItem aLink( SID_DONELINK,
1016 LINK( this, SwNavigationPI, DoneLink ) );
1017 if (SwView* pView = GetActiveView())
1018 pView->GetViewFrame().GetDispatcher()->ExecuteList(
1019 SID_OPENDOC, SfxCallMode::ASYNCHRON,
1020 { &aFileItem, &aOptionsItem, &aLink });
1021 }
1022 return nRet;
1023}
1024
1026{
1027 m_nRegionMode = nNewMode;
1029
1030 OUString sImageId;
1031 switch (nNewMode)
1032 {
1033 case RegionMode::NONE:
1034 sImageId = RID_BMP_DROP_REGION;
1035 break;
1036 case RegionMode::LINK:
1037 sImageId = RID_BMP_DROP_LINK;
1038 break;
1039 case RegionMode::EMBEDDED:
1040 sImageId = RID_BMP_DROP_COPY;
1041 break;
1042 }
1043 m_xContent6ToolBox->set_item_icon_name("dragmode", sImageId);
1044}
1045
1047{
1048 bool bGlobalDoc = IsGlobalDoc();
1049 if (!IsGlobalMode() && bGlobalDoc)
1050 {
1051 if (IsZoomedIn())
1052 ZoomOut();
1053 m_xGlobalBox->show();
1054 m_xGlobalTree->ShowTree();
1055 m_xGlobalToolBox->show();
1056 m_xContentBox->hide();
1057 m_xContentTree->HideTree();
1058 m_xContent1ToolBox->hide();
1059 m_xContent2ToolBox->hide();
1060 m_xContent3ToolBox->hide();
1061 m_xContent4ToolBox->hide();
1062 m_xContent5ToolBox->hide();
1063 m_xContent6ToolBox->hide();
1064 m_xDocListBox->hide();
1065 SetGlobalMode(true);
1066 }
1067 else
1068 {
1069 m_xGlobalBox->hide();
1070 m_xGlobalTree->HideTree();
1071 m_xGlobalToolBox->hide();
1072 if (!IsZoomedIn())
1073 {
1074 m_xContentBox->show();
1075 m_xContentTree->ShowTree();
1076 m_xContent1ToolBox->show();
1077 m_xContent2ToolBox->show();
1078 m_xContent3ToolBox->show();
1079 m_xContent4ToolBox->show();
1080 m_xContent5ToolBox->show();
1081 m_xContent6ToolBox->show();
1082 m_xDocListBox->show();
1083 }
1084 SetGlobalMode(false);
1085 }
1086}
1087
1089{
1090 bool bRet = false;
1091 SwView *pView = GetCreateView();
1092 if (pView)
1093 {
1094 SwWrtShell &rSh = pView->GetWrtShell();
1095 bRet = rSh.IsGlobalDoc();
1096 }
1097 return bRet;
1098}
1099
1100IMPL_LINK_NOARG(SwNavigationPI, ChangePageHdl, Timer *, void)
1101{
1102 if (!m_xDocListBox) // disposed
1103 return;
1104 // tdf#134959 if the SpinButton changed value this Timer was launched, now
1105 // change to the desired page, but we leave focus where it currently is,
1106 // i.e. typically remaining in the spinbutton, or whatever other widget the
1107 // user moved to in the meantime
1108 EditAction();
1109}
1110
1111void SwNavigationPI::SelectNavigateByContentType(const OUString& rContentTypeName)
1112{
1113 if (auto nPos = m_pNavigateByComboBox->find_text(rContentTypeName); nPos != -1)
1114 {
1117 }
1118}
1119
1121{
1122 // tdf#134959 if the user presses enter to activate the Entry
1123 // go to the page, and on success we move focus to the document
1124 if (EditAction())
1125 m_pCreateView->GetEditWin().GrabFocus();
1126 return true;
1127}
1128
1130{
1131 if (m_aPageChgIdle.IsActive())
1132 m_aPageChgIdle.Stop();
1133 m_aPageChgIdle.Start();
1134}
1135
1137{
1138 if (!m_pCreateView)
1139 {
1140 SwView* pView = SwModule::GetFirstView();
1141 while (pView)
1142 {
1143 if(&pView->GetViewFrame().GetBindings() == &m_rBindings)
1144 {
1145 const_cast<SwNavigationPI*>(this)->m_pCreateView = pView;
1146 const_cast<SwNavigationPI*>(this)->StartListening(*m_pCreateView);
1147 break;
1148 }
1149 pView = SwModule::GetNextView(pView);
1150 }
1151 }
1152 return m_pCreateView;
1153}
1154
1156{
1157private:
1158 std::unique_ptr<SwNavigationPI> m_xNavi;
1159public:
1160 SwNavigatorWin(SfxBindings* _pBindings, SfxChildWindow* _pMgr,
1161 vcl::Window* pParent, SfxChildWinInfo* pInfo);
1162 virtual void StateChanged(StateChangedType nStateChange) override;
1163 virtual void dispose() override
1164 {
1165 m_xNavi.reset();
1167 }
1168 virtual ~SwNavigatorWin() override
1169 {
1170 disposeOnce();
1171 }
1172};
1173
1175 vcl::Window* pParent, SfxChildWinInfo* pInfo)
1176 : SfxNavigator(_pBindings, _pMgr, pParent, pInfo)
1177 , m_xNavi(std::make_unique<SwNavigationPI>(m_xContainer.get(), _pBindings->GetActiveFrame(), _pBindings, this))
1178{
1179 _pBindings->Invalidate(SID_NAVIGATOR);
1180
1181 SwNavigationConfig* pNaviConfig = SW_MOD()->GetNavigationConfig();
1182
1183 SetMinOutputSizePixel(GetOptimalSize());
1184 if (pNaviConfig->IsSmall())
1185 m_xNavi->ZoomIn();
1186}
1187
1189{
1190 SfxNavigator::StateChanged(nStateChange);
1191 if (nStateChange == StateChangedType::InitShow)
1192 m_xNavi->UpdateInitShow();
1193}
1194
1196
1198 SfxBindings* pBindings, SfxChildWinInfo* pInfo)
1199 : SfxNavigatorWrapper(_pParent, nId)
1200{
1201 SetWindow(VclPtr<SwNavigatorWin>::Create(pBindings, this, _pParent, pInfo));
1202 Initialize();
1203}
1204
1205/* 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:181
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)
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:91
bool GotoNextFootnoteAnchor()
Definition: trvlfnfl.cxx:339
bool GotoHeaderText()
jump from the content to the header
Definition: crstrvl.cxx:132
void SwapPam()
Definition: crsrsh.cxx:990
void MakeOutlineSel(SwOutlineNodes::size_type nSttPos, SwOutlineNodes::size_type nEndPos, bool bWithChildren, bool bKillPams=true)
Definition: crstrvl.cxx:1343
void GetPageNum(sal_uInt16 &rnPhyNum, sal_uInt16 &rnVirtNum, bool bAtCursorPos=true, const bool bCalcFrame=true)
Definition: crsrsh.cxx:1237
bool GotoFootnoteText()
jump from content to footnote
Definition: trvlfnfl.cxx:89
void ClearMark()
Definition: crsrsh.cxx:953
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:1314
bool IsCursorPtAtEnd() const
Definition: crsrsh.hxx:919
bool GotoFooterText()
jump from the content to the footer
Definition: crstrvl.cxx:160
sal_uInt16 GetPageCnt()
Definition: crsrsh.cxx:1319
bool IsAllProtect() const
Definition: crsrsh.hxx:784
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:128
static SwView * GetFirstView()
Definition: swmodul1.cxx:121
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:86
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:70
virtual void NotifyItemUpdate(const sal_uInt16 nSId, const SfxItemState eState, const SfxPoolItem *pState) override
Definition: navipi.cxx:739
bool IsZoomedIn() const
Definition: navipi.hxx:96
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: navipi.cxx:800
bool IsGlobalDoc() const
Definition: navipi.cxx:1088
void SetGlobalMode(bool bSet)
Definition: navipi.hxx:126
RegionMode m_nRegionMode
Definition: navipi.hxx:88
weld::ComboBox * m_pNavigateByComboBox
Definition: navipi.hxx:94
std::unique_ptr< weld::Toolbar > m_xContent4ToolBox
Definition: navipi.hxx:57
void ZoomOut()
Definition: navipi.cxx:414
SwView * GetCreateView() const
Definition: navipi.cxx:1136
sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt)
Definition: navipi.cxx:983
bool IsGlobalMode() const
Definition: navipi.hxx:160
Size m_aExpandedSize
Definition: navipi.hxx:89
Idle m_aPageChgIdle
Definition: navipi.hxx:73
std::optional< SfxObjectShellLock > m_oObjectShell
Definition: navipi.hxx:79
static OUString CreateDropFileName(const TransferableDataHelper &rData)
Definition: navipi.cxx:935
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:694
std::unique_ptr< weld::Toolbar > m_xContent1ToolBox
Definition: navipi.hxx:54
std::unique_ptr< weld::Toolbar > m_xGlobalToolBox
Definition: navipi.hxx:66
std::unique_ptr< weld::Toolbar > m_xContent2ToolBox
Definition: navipi.hxx:55
std::unique_ptr< ToolbarUnoDispatcher > m_xContent3Dispatch
Definition: navipi.hxx:61
std::unique_ptr< weld::SpinButton > m_xEdit
Definition: navipi.hxx:67
bool m_bIsZoomedIn
Definition: navipi.hxx:91
std::unique_ptr< SwContentTree > m_xContentTree
Definition: navipi.hxx:69
SwView * m_pActContView
Definition: navipi.hxx:82
void MoveOutline(SwOutlineNodes::size_type nSource, SwOutlineNodes::size_type nTarget)
Definition: navipi.cxx:71
std::unique_ptr< weld::Menu > m_xDragModeMenu
Definition: navipi.hxx:63
std::unique_ptr< weld::Menu > m_xUpdateMenu
Definition: navipi.hxx:64
std::unique_ptr< weld::Toolbar > m_xContent3ToolBox
Definition: navipi.hxx:56
sal_Int8 AcceptDrop()
Definition: navipi.cxx:968
bool EditAction()
Definition: navipi.cxx:392
SwNavigationConfig * m_pConfig
Definition: navipi.hxx:85
void FillBox()
Definition: navipi.cxx:149
virtual weld::Window * GetFrameWeld() const override
Definition: navipi.cxx:687
void UpdateInitShow()
Definition: navipi.cxx:778
void UpdateListBox()
Definition: navipi.cxx:842
std::unique_ptr< weld::Toolbar > m_xContent5ToolBox
Definition: navipi.hxx:58
::sfx2::sidebar::ControllerItem m_aDocFullName
Definition: navipi.hxx:51
void UsePage()
Definition: navipi.cxx:176
void ToggleTree()
Definition: navipi.cxx:1046
VclPtr< SfxNavigator > m_xNavigatorDlg
Definition: navipi.hxx:77
static OUString CleanEntry(const OUString &rEntry)
Definition: navipi.cxx:56
void SelectNavigateByContentType(const OUString &rContentTypeName)
Definition: navipi.cxx:1111
void SetRegionDropMode(RegionMode nNewMode)
Definition: navipi.cxx:1025
SwWrtShell * m_pContentWrtShell
Definition: navipi.hxx:81
OUString m_aStatusArr[4]
Definition: navipi.hxx:75
std::unique_ptr< weld::Menu > m_xInsertMenu
Definition: navipi.hxx:65
std::unique_ptr< weld::Menu > m_xHeadingsMenu
Definition: navipi.hxx:62
std::unique_ptr< SwGlobalTree > m_xGlobalTree
Definition: navipi.hxx:71
OUString m_sContentFileName
Definition: navipi.hxx:74
std::unique_ptr< ToolbarUnoDispatcher > m_xContent2Dispatch
Definition: navipi.hxx:60
std::unique_ptr< weld::Widget > m_xContentBox
Definition: navipi.hxx:68
SwView * m_pCreateView
Definition: navipi.hxx:83
::sfx2::sidebar::ControllerItem m_aPageStats
Definition: navipi.hxx:52
void UpdateNavigateBy()
Definition: navipi.cxx:131
std::unique_ptr< weld::ComboBox > m_xDocListBox
Definition: navipi.hxx:72
std::unique_ptr< weld::Toolbar > m_xContent6ToolBox
Definition: navipi.hxx:59
virtual void dispose() override
Definition: navipi.cxx:1163
SwNavigatorWin(SfxBindings *_pBindings, SfxChildWindow *_pMgr, vcl::Window *pParent, SfxChildWinInfo *pInfo)
Definition: navipi.cxx:1174
virtual ~SwNavigatorWin() override
Definition: navipi.cxx:1168
virtual void StateChanged(StateChangedType nStateChange) override
Definition: navipi.cxx:1188
std::unique_ptr< SwNavigationPI > m_xNavi
Definition: navipi.cxx:1158
SwNavigatorWrapper(vcl::Window *pParent, sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo *pInfo)
Definition: navipi.cxx:1197
static constexpr auto npos
Definition: ndarr.hxx:81
Definition: view.hxx:146
SwWrtShell & GetWrtShell() const
Definition: view.hxx:421
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:422
SwEditWin & GetEditWin()
Definition: view.hxx:424
SwDocShell * GetDocShell()
Definition: view.cxx:1163
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:721
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:324
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:728
#define FN_FOOTNOTE_TO_ANCHOR
Definition: cmdid.h:726
#define FN_TO_FOOTER
Definition: cmdid.h:734
#define FN_NAV_ELEMENT
Definition: cmdid.h:185
#define FN_TO_HEADER
Definition: cmdid.h:733
#define FN_STAT_PAGE
Definition: cmdid.h:861
#define FN_START_OF_PAGE
Definition: cmdid.h:684
#define FN_SET_REMINDER
Definition: cmdid.h:283
#define FN_NEXT_FOOTNOTE
Definition: cmdid.h:727
#define FN_END_OF_PAGE
Definition: cmdid.h:685
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:793
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:115
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:168
#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