LibreOffice Module sw (master) 1
navipi.hxx
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#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_NAVIPI_HXX
20#define INCLUDED_SW_SOURCE_UIBASE_INC_NAVIPI_HXX
21
22#include <vcl/idle.hxx>
23#include <svl/lstner.hxx>
24#include <vcl/transfer.hxx>
25#include <sfx2/childwin.hxx>
26#include <sfx2/objsh.hxx>
28#include <sfx2/navigat.hxx>
29#include <sfx2/weldutils.hxx>
31#include "conttree.hxx"
32#include <ndarr.hxx>
33#include <memory>
34#include <optional>
35
36class SwWrtShell;
37class SfxBindings;
39class SwView;
40enum class RegionMode;
41class SpinField;
42
43class SwNavigationPI final : public PanelLayout
45 , public SfxListener
46{
47 friend class SwNavigatorWin;
48 friend class SwContentTree;
49 friend class SwGlobalTree;
50
53
54 std::unique_ptr<weld::Toolbar> m_xContent1ToolBox;
55 std::unique_ptr<weld::Toolbar> m_xContent2ToolBox;
56 std::unique_ptr<weld::Toolbar> m_xContent3ToolBox;
57 std::unique_ptr<weld::Toolbar> m_xContent4ToolBox;
58 std::unique_ptr<weld::Toolbar> m_xContent5ToolBox;
59 std::unique_ptr<weld::Toolbar> m_xContent6ToolBox;
60 std::unique_ptr<ToolbarUnoDispatcher> m_xContent2Dispatch;
61 std::unique_ptr<ToolbarUnoDispatcher> m_xContent3Dispatch;
62 std::unique_ptr<weld::Menu> m_xHeadingsMenu;
63 std::unique_ptr<weld::Menu> m_xDragModeMenu;
64 std::unique_ptr<weld::Menu> m_xUpdateMenu;
65 std::unique_ptr<weld::Menu> m_xInsertMenu;
66 std::unique_ptr<weld::Toolbar> m_xGlobalToolBox;
67 std::unique_ptr<weld::SpinButton> m_xEdit;
68 std::unique_ptr<weld::Widget> m_xContentBox;
69 std::unique_ptr<SwContentTree> m_xContentTree;
70 std::unique_ptr<weld::Widget> m_xGlobalBox;
71 std::unique_ptr<SwGlobalTree> m_xGlobalTree;
72 std::unique_ptr<weld::ComboBox> m_xDocListBox;
75 OUString m_aStatusArr[4];
76
78
79 std::optional<SfxObjectShellLock> m_oObjectShell;
84
87
88 RegionMode m_nRegionMode; // 0 - URL, 1 - region with link 2 - region without link
90
91 bool m_bIsZoomedIn : 1;
92 bool m_bGlobalMode : 1;
93
95
96 bool IsZoomedIn() const {return m_bIsZoomedIn;}
97 void ZoomOut();
98 void ZoomIn();
99
100 void FillBox();
101
102 DECL_LINK( DocListBoxSelectHdl, weld::ComboBox&, void );
103 DECL_LINK( ToolBoxSelectHdl, const OUString&, void );
104 DECL_LINK( ToolBoxClickHdl, const OUString&, void );
105 DECL_LINK( ToolBox5DropdownClickHdl, const OUString&, void );
106 DECL_LINK( ToolBox6DropdownClickHdl, const OUString&, void );
107 DECL_LINK( DoneLink, SfxPoolItem const *, void );
108 DECL_LINK( DropModeMenuSelectHdl, const OUString&, void );
109 DECL_LINK( HeadingsMenuSelectHdl, const OUString&, void );
110 DECL_LINK( GlobalMenuSelectHdl, const OUString&, void );
111 DECL_LINK( ChangePageHdl, Timer*, void );
112 DECL_LINK( PageEditModifyHdl, weld::SpinButton&, void );
113 DECL_LINK( EditActionHdl, weld::Entry&, bool );
114 DECL_LINK( SetFocusChildHdl, weld::Container&, void );
115 DECL_LINK( NavigateByComboBoxSelectHdl, weld::ComboBox&, void );
116 DECL_LINK( PageModifiedHdl, weld::Entry&, void );
117
118 bool EditAction();
119 void UsePage();
120
121 void UpdateInitShow();
122
123 // release ObjectShellLock early enough for app end
124 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
125
126 void ToggleTree();
127 void SetGlobalMode(bool bSet) {m_bGlobalMode = bSet;}
128
129 void UpdateNavigateBy();
130
131public:
132
133 static std::unique_ptr<PanelLayout> Create(weld::Widget* pParent,
134 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
135 SfxBindings* pBindings);
137 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
138 SfxBindings* _pBindings, SfxNavigator* pNavigatorDlg);
139 virtual ~SwNavigationPI() override;
140
141 void UpdateListBox();
143
144 virtual void NotifyItemUpdate(const sal_uInt16 nSId,
145 const SfxItemState eState,
146 const SfxPoolItem* pState) override;
147
148 virtual void GetControlState(const sal_uInt16 /*nSId*/,
149 boost::property_tree::ptree& /*rState*/) override {};
150
151 static OUString CreateDropFileName( const TransferableDataHelper& rData );
152 static OUString CleanEntry(const OUString& rEntry);
153
155 void SetRegionDropMode(RegionMode nNewMode);
156
159
160 bool IsGlobalDoc() const;
161 bool IsGlobalMode() const {return m_bGlobalMode;}
162
163 SwView* GetCreateView() const;
164
165 virtual weld::Window* GetFrameWeld() const override;
166
167 void SelectNavigateByContentType(const OUString& rContentTypeName);
168};
169
171{
172public:
174 SfxBindings* pBindings, SfxChildWinInfo* pInfo);
176};
177
178#endif
179
180/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
VclPtr< vcl::Window > pParent
TreeListBox for content indicator.
Definition: conttree.hxx:91
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:531
DECL_LINK(ToolBoxClickHdl, const OUString &, void)
void ZoomIn()
Definition: navipi.cxx:458
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:779
DECL_LINK(DoneLink, SfxPoolItem const *, void)
bool IsZoomedIn() const
Definition: navipi.hxx:96
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: navipi.cxx:843
bool IsGlobalDoc() const
Definition: navipi.cxx:1137
void SetGlobalMode(bool bSet)
Definition: navipi.hxx:127
DECL_LINK(ToolBoxSelectHdl, const OUString &, void)
RegionMode m_nRegionMode
Definition: navipi.hxx:88
weld::ComboBox * m_pNavigateByComboBox
Definition: navipi.hxx:94
DECL_LINK(EditActionHdl, weld::Entry &, bool)
std::unique_ptr< weld::Toolbar > m_xContent4ToolBox
Definition: navipi.hxx:57
void ZoomOut()
Definition: navipi.cxx:425
SwView * GetCreateView() const
Definition: navipi.cxx:1185
sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt)
Definition: navipi.cxx:1026
bool IsGlobalMode() const
Definition: navipi.hxx:161
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:978
DECL_LINK(DropModeMenuSelectHdl, const OUString &, void)
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:499
DECL_LINK(ToolBox5DropdownClickHdl, const OUString &, void)
virtual ~SwNavigationPI() override
Definition: navipi.cxx:734
RegionMode GetRegionDropMode() const
Definition: navipi.hxx:154
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:73
std::unique_ptr< weld::Menu > m_xDragModeMenu
Definition: navipi.hxx:63
bool m_bGlobalMode
Definition: navipi.hxx:92
DECL_LINK(NavigateByComboBoxSelectHdl, weld::ComboBox &, void)
std::unique_ptr< weld::Menu > m_xUpdateMenu
Definition: navipi.hxx:64
DECL_LINK(GlobalMenuSelectHdl, const OUString &, void)
std::unique_ptr< weld::Toolbar > m_xContent3ToolBox
Definition: navipi.hxx:56
sal_Int8 AcceptDrop()
Definition: navipi.cxx:1011
bool EditAction()
Definition: navipi.cxx:394
SwNavigationConfig * m_pConfig
Definition: navipi.hxx:85
SwView * m_pContentView
Definition: navipi.hxx:80
DECL_LINK(ChangePageHdl, Timer *, void)
void FillBox()
Definition: navipi.cxx:151
DECL_LINK(HeadingsMenuSelectHdl, const OUString &, void)
virtual weld::Window * GetFrameWeld() const override
Definition: navipi.cxx:727
DECL_LINK(DocListBoxSelectHdl, weld::ComboBox &, void)
void UpdateInitShow()
Definition: navipi.cxx:821
void UpdateListBox()
Definition: navipi.cxx:885
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:178
void ToggleTree()
Definition: navipi.cxx:1089
VclPtr< SfxNavigator > m_xNavigatorDlg
Definition: navipi.hxx:77
static OUString CleanEntry(const OUString &rEntry)
Definition: navipi.cxx:58
void SelectNavigateByContentType(const OUString &rContentTypeName)
Definition: navipi.cxx:1160
void SetRegionDropMode(RegionMode nNewMode)
Definition: navipi.cxx:1068
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
DECL_LINK(PageEditModifyHdl, weld::SpinButton &, void)
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
DECL_LINK(SetFocusChildHdl, weld::Container &, void)
DECL_LINK(ToolBox6DropdownClickHdl, const OUString &, void)
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:133
std::unique_ptr< weld::ComboBox > m_xDocListBox
Definition: navipi.hxx:72
virtual void GetControlState(const sal_uInt16, boost::property_tree::ptree &) override
Definition: navipi.hxx:148
std::unique_ptr< weld::Toolbar > m_xContent6ToolBox
Definition: navipi.hxx:59
DECL_LINK(PageModifiedHdl, weld::Entry &, void)
SwNavigatorWrapper(vcl::Window *pParent, sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo *pInfo)
Definition: navipi.cxx:1246
SFX_DECL_CHILDWINDOW(SwNavigatorWrapper)
Definition: view.hxx:146
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
RegionMode
sal_Int16 nId
SfxItemState
RegionMode
Definition: swcont.hxx:56
signed char sal_Int8