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>
27#include <sfx2/navigat.hxx>
28#include <sfx2/weldutils.hxx>
30#include "conttree.hxx"
31#include <ndarr.hxx>
32#include <memory>
33
34class SwWrtShell;
35class SfxBindings;
37class SwView;
39enum class RegionMode;
40class SpinField;
41
42class SwNavigationPI final : public PanelLayout
44 , public SfxListener
45{
46 friend class SwNavigatorWin;
47 friend class SwContentTree;
48 friend class SwGlobalTree;
49
52
53 std::unique_ptr<weld::Toolbar> m_xContent1ToolBox;
54 std::unique_ptr<weld::Toolbar> m_xContent2ToolBox;
55 std::unique_ptr<weld::Toolbar> m_xContent3ToolBox;
56 std::unique_ptr<weld::Toolbar> m_xContent4ToolBox;
57 std::unique_ptr<weld::Toolbar> m_xContent5ToolBox;
58 std::unique_ptr<weld::Toolbar> m_xContent6ToolBox;
59 std::unique_ptr<ToolbarUnoDispatcher> m_xContent2Dispatch;
60 std::unique_ptr<ToolbarUnoDispatcher> m_xContent3Dispatch;
61 std::unique_ptr<weld::Menu> m_xHeadingsMenu;
62 std::unique_ptr<weld::Menu> m_xDragModeMenu;
63 std::unique_ptr<weld::Menu> m_xUpdateMenu;
64 std::unique_ptr<weld::Menu> m_xInsertMenu;
65 std::unique_ptr<weld::Toolbar> m_xGlobalToolBox;
66 std::unique_ptr<weld::SpinButton> m_xEdit;
67 std::unique_ptr<weld::Widget> m_xContentBox;
68 std::unique_ptr<SwContentTree> m_xContentTree;
69 std::unique_ptr<weld::Widget> m_xGlobalBox;
70 std::unique_ptr<SwGlobalTree> m_xGlobalTree;
71 std::unique_ptr<weld::ComboBox> m_xDocListBox;
74 OUString m_aStatusArr[4];
75
77
78 std::unique_ptr<SfxObjectShellLock> m_pxObjectShell;
83
86
87 RegionMode m_nRegionMode; // 0 - URL, 1 - region with link 2 - region without link
89
90 bool m_bIsZoomedIn : 1;
91 bool m_bGlobalMode : 1;
92
94
95 bool IsZoomedIn() const {return m_bIsZoomedIn;}
96 void ZoomOut();
97 void ZoomIn();
98
99 void FillBox();
100
101 DECL_LINK( DocListBoxSelectHdl, weld::ComboBox&, void );
102 DECL_LINK( ToolBoxSelectHdl, const OString&, void );
103 DECL_LINK( ToolBoxClickHdl, const OString&, void );
104 DECL_LINK( ToolBox5DropdownClickHdl, const OString&, void );
105 DECL_LINK( ToolBox6DropdownClickHdl, const OString&, void );
106 DECL_LINK( DoneLink, SfxPoolItem const *, void );
107 DECL_LINK( DropModeMenuSelectHdl, const OString&, void );
108 DECL_LINK( HeadingsMenuSelectHdl, const OString&, void );
109 DECL_LINK( GlobalMenuSelectHdl, const OString&, void );
110 DECL_LINK( ChangePageHdl, Timer*, void );
111 DECL_LINK( PageEditModifyHdl, weld::SpinButton&, void );
112 DECL_LINK( EditActionHdl, weld::Entry&, bool );
113 DECL_LINK( SetFocusChildHdl, weld::Container&, void );
114 DECL_LINK( NavigateByComboBoxSelectHdl, weld::ComboBox&, void );
115
116 bool EditAction();
117 void UsePage();
118
119 void UpdateInitShow();
120
121 // release ObjectShellLock early enough for app end
122 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
123
124 void ToggleTree();
125 void SetGlobalMode(bool bSet) {m_bGlobalMode = bSet;}
126
127 void UpdateNavigateBy();
128
129public:
130
131 static std::unique_ptr<PanelLayout> Create(weld::Widget* pParent,
132 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
133 SfxBindings* pBindings);
135 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
136 SfxBindings* _pBindings, SfxNavigator* pNavigatorDlg);
137 virtual ~SwNavigationPI() override;
138
139 void UpdateListBox();
141
142 virtual void NotifyItemUpdate(const sal_uInt16 nSId,
143 const SfxItemState eState,
144 const SfxPoolItem* pState) override;
145
146 virtual void GetControlState(const sal_uInt16 /*nSId*/,
147 boost::property_tree::ptree& /*rState*/) override {};
148
149 static OUString CreateDropFileName( const TransferableDataHelper& rData );
150 static OUString CleanEntry(const OUString& rEntry);
151
153 void SetRegionDropMode(RegionMode nNewMode);
154
157
158 bool IsGlobalDoc() const;
159 bool IsGlobalMode() const {return m_bGlobalMode;}
160
161 SwView* GetCreateView() const;
162
163 virtual weld::Window* GetFrameWeld() const override;
164
165 void SelectNavigateByContentType(const OUString& rContentTypeName);
166};
167
169{
170public:
172 SfxBindings* pBindings, SfxChildWinInfo* pInfo);
174};
175
176#endif
177
178/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
VclPtr< vcl::Window > pParent
TreeListBox for content indicator.
Definition: conttree.hxx:88
DECL_LINK(ToolBox5DropdownClickHdl, const OString &, void)
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
DECL_LINK(ToolBox6DropdownClickHdl, const OString &, void)
DECL_LINK(DoneLink, SfxPoolItem const *, void)
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
DECL_LINK(EditActionHdl, weld::Entry &, bool)
DECL_LINK(HeadingsMenuSelectHdl, const OString &, void)
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
DECL_LINK(ToolBoxClickHdl, const OString &, void)
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
RegionMode GetRegionDropMode() const
Definition: navipi.hxx:152
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
DECL_LINK(GlobalMenuSelectHdl, const OString &, void)
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
bool m_bGlobalMode
Definition: navipi.hxx:91
DECL_LINK(NavigateByComboBoxSelectHdl, weld::ComboBox &, void)
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
SwView * m_pContentView
Definition: navipi.hxx:79
DECL_LINK(ChangePageHdl, Timer *, void)
void FillBox()
Definition: navipi.cxx:149
virtual weld::Window * GetFrameWeld() const override
Definition: navipi.cxx:686
DECL_LINK(DocListBoxSelectHdl, weld::ComboBox &, void)
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
DECL_LINK(DropModeMenuSelectHdl, const OString &, void)
void SetRegionDropMode(RegionMode nNewMode)
Definition: navipi.cxx:1023
DECL_LINK(ToolBoxSelectHdl, const OString &, void)
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
DECL_LINK(PageEditModifyHdl, weld::SpinButton &, void)
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
DECL_LINK(SetFocusChildHdl, weld::Container &, void)
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
virtual void GetControlState(const sal_uInt16, boost::property_tree::ptree &) override
Definition: navipi.hxx:146
std::unique_ptr< weld::Toolbar > m_xContent6ToolBox
Definition: navipi.hxx:58
SwNavigatorWrapper(vcl::Window *pParent, sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo *pInfo)
Definition: navipi.cxx:1195
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