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/ctrlitem.hxx>
27 #include <sfx2/tbxctrl.hxx>
29 #include <sfx2/weldutils.hxx>
31 #include "conttree.hxx"
32 #include <ndarr.hxx>
33 #include <memory>
34 
35 class SwWrtShell;
36 class SwNavigationPI;
37 class SwNavigationChild;
38 class SfxBindings;
39 class SwNavigationConfig;
40 class SwView;
41 class SfxObjectShellLock;
43 enum class RegionMode;
44 class SpinField;
45 
48  , public SfxListener
49 {
50  friend class SwNavigationChild;
51  friend class SwContentTree;
52  friend class SwGlobalTree;
53  friend class SwNavigationPIUIObject;
54 
57 
58  std::unique_ptr<weld::Toolbar> m_xContent1ToolBox;
59  std::unique_ptr<weld::Toolbar> m_xContent2ToolBox;
60  std::unique_ptr<weld::Toolbar> m_xContent3ToolBox;
61  std::unique_ptr<weld::Toolbar> m_xContent4ToolBox;
62  std::unique_ptr<weld::Toolbar> m_xContent5ToolBox;
63  std::unique_ptr<weld::Toolbar> m_xContent6ToolBox;
64  std::unique_ptr<ToolbarUnoDispatcher> m_xContent2Dispatch;
65  std::unique_ptr<ToolbarUnoDispatcher> m_xContent3Dispatch;
66  std::unique_ptr<weld::Menu> m_xHeadingsMenu;
67  std::unique_ptr<weld::Menu> m_xDragModeMenu;
68  std::unique_ptr<weld::Menu> m_xUpdateMenu;
69  std::unique_ptr<weld::Menu> m_xInsertMenu;
70  std::unique_ptr<weld::Toolbar> m_xGlobalToolBox;
71  std::unique_ptr<weld::SpinButton> m_xEdit;
72  std::unique_ptr<weld::Widget> m_xContentBox;
73  std::unique_ptr<SwContentTree> m_xContentTree;
74  std::unique_ptr<weld::Widget> m_xGlobalBox;
75  std::unique_ptr<SwGlobalTree> m_xGlobalTree;
76  std::unique_ptr<weld::ComboBox> m_xDocListBox;
79  OUString m_aStatusArr[4];
80 
81  std::unique_ptr<SfxObjectShellLock> m_pxObjectShell;
86 
89 
90  RegionMode m_nRegionMode; // 0 - URL, 1 - region with link 2 - region without link
92 
93  bool m_bIsZoomedIn : 1;
94  bool m_bGlobalMode : 1;
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 OString&, void );
104  DECL_LINK( ToolBoxClickHdl, const OString&, void );
105  DECL_LINK( ToolBox5DropdownClickHdl, const OString&, void );
106  DECL_LINK( ToolBox6DropdownClickHdl, const OString&, void );
107  DECL_LINK( DoneLink, SfxPoolItem const *, void );
108  DECL_LINK( DropModeMenuSelectHdl, const OString&, void );
109  DECL_LINK( HeadingsMenuSelectHdl, const OString&, void );
110  DECL_LINK( GlobalMenuSelectHdl, const OString&, void );
111  DECL_LINK( ChangePageHdl, Timer*, void );
112  DECL_LINK( PageEditModifyHdl, weld::SpinButton&, void );
113  DECL_LINK( EditActionHdl, weld::Entry&, bool );
114  bool EditAction();
115  void UsePage();
116 
117 protected:
118 
119  // release ObjectShellLock early enough for app end
120  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
121 
122  void ToggleTree();
123  void SetGlobalMode(bool bSet) {m_bGlobalMode = bSet;}
124 
125 public:
126 
127  static VclPtr<vcl::Window> Create(vcl::Window* pParent,
128  const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
129  SfxBindings* pBindings);
130  SwNavigationPI(vcl::Window* pParent,
131  const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
132  SfxBindings* _pBindings);
133  virtual ~SwNavigationPI() override;
134  virtual void dispose() override;
135 
136  void UpdateListBox();
138 
139  virtual void NotifyItemUpdate(const sal_uInt16 nSId,
140  const SfxItemState eState,
141  const SfxPoolItem* pState) override;
142 
143  virtual void GetControlState(const sal_uInt16 /*nSId*/,
144  boost::property_tree::ptree& /*rState*/) override {};
145 
146  virtual void StateChanged(StateChangedType nStateChange) override;
147 
148  static OUString CreateDropFileName( TransferableDataHelper& rData );
149  static OUString CleanEntry(const OUString& rEntry);
150 
152  void SetRegionDropMode(RegionMode nNewMode);
153 
155  sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
156 
157  bool IsGlobalDoc() const;
158  bool IsGlobalMode() const {return m_bGlobalMode;}
159 
160  SwView* GetCreateView() const;
161 
162  FactoryFunction GetUITestFactory() const override;
163 };
164 
166 {
167 public:
169  sal_uInt16 nId,
170  SfxBindings* );
171 
173  static std::unique_ptr<SfxChildWindowContext> CreateImpl(vcl::Window *pParent,
174  SfxBindings *pBindings, SfxChildWinInfo* pInfo );
175  static void RegisterChildWindowContext(SfxModule *pMod);
176 };
177 
178 #endif
179 
180 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Widget > m_xContentBox
Definition: navipi.hxx:72
SwNavigationChild(vcl::Window *, sal_uInt16 nId, SfxBindings *)
Definition: navipi.cxx:1115
::sfx2::sidebar::ControllerItem m_aPageStats
Definition: navipi.hxx:56
SwNavigationConfig * m_pConfig
Definition: navipi.hxx:87
std::unique_ptr< weld::Menu > m_xUpdateMenu
Definition: navipi.hxx:68
bool IsZoomedIn() const
Definition: navipi.hxx:96
void ZoomIn()
Definition: navipi.cxx:453
virtual ~SwNavigationPI() override
Definition: navipi.cxx:653
void SetRegionDropMode(RegionMode nNewMode)
Definition: navipi.cxx:992
SwNavigationPI(vcl::Window *pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > &rxFrame, SfxBindings *_pBindings)
Definition: navipi.cxx:506
std::unique_ptr< weld::Widget > m_xGlobalBox
Definition: navipi.hxx:74
signed char sal_Int8
void SetGlobalMode(bool bSet)
Definition: navipi.hxx:123
static std::unique_ptr< SfxChildWindowContext > CreateImpl(vcl::Window *pParent, SfxBindings *pBindings, SfxChildWinInfo *pInfo)
soon obsolete !
Definition: navipi.cxx:55
void UsePage()
Definition: navipi.cxx:175
std::unique_ptr< weld::Menu > m_xHeadingsMenu
Definition: navipi.hxx:66
std::unique_ptr< weld::Toolbar > m_xContent1ToolBox
Definition: navipi.hxx:58
std::function< std::unique_ptr< UIObject >vcl::Window *)> FactoryFunction
std::unique_ptr< weld::Toolbar > m_xGlobalToolBox
Definition: navipi.hxx:70
OUString m_aStatusArr[4]
Definition: navipi.hxx:79
sal_Int16 nId
std::unique_ptr< weld::Toolbar > m_xContent6ToolBox
Definition: navipi.hxx:63
sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt)
Definition: navipi.cxx:951
SwView * m_pActContView
Definition: navipi.hxx:84
void UpdateListBox()
Definition: navipi.cxx:810
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
std::unique_ptr< weld::Toolbar > m_xContent4ToolBox
Definition: navipi.hxx:61
StateChangedType
std::unique_ptr< weld::ComboBox > m_xDocListBox
Definition: navipi.hxx:76
::sfx2::sidebar::ControllerItem m_aDocFullName
Definition: navipi.hxx:55
TreeListBox for content indicator.
Definition: conttree.hxx:84
static OUString CreateDropFileName(TransferableDataHelper &rData)
Definition: navipi.cxx:903
bool EditAction()
Definition: navipi.cxx:399
void ToggleTree()
Definition: navipi.cxx:1013
std::unique_ptr< SwContentTree > m_xContentTree
Definition: navipi.hxx:73
SwWrtShell * m_pContentWrtShell
Definition: navipi.hxx:83
sal_Int8 AcceptDrop()
Definition: navipi.cxx:936
virtual void dispose() override
Definition: navipi.cxx:658
std::unique_ptr< SwGlobalTree > m_xGlobalTree
Definition: navipi.hxx:75
RegionMode GetRegionDropMode() const
Definition: navipi.hxx:151
bool m_bGlobalMode
Definition: navipi.hxx:94
static OUString CleanEntry(const OUString &rEntry)
Definition: navipi.cxx:73
std::unique_ptr< weld::Menu > m_xDragModeMenu
Definition: navipi.hxx:67
RegionMode
Definition: swcont.hxx:51
virtual void NotifyItemUpdate(const sal_uInt16 nSId, const SfxItemState eState, const SfxPoolItem *pState) override
Definition: navipi.cxx:705
bool IsGlobalMode() const
Definition: navipi.hxx:158
std::unique_ptr< weld::Toolbar > m_xContent5ToolBox
Definition: navipi.hxx:62
OUString m_sContentFileName
Definition: navipi.hxx:78
std::unique_ptr< weld::Toolbar > m_xContent3ToolBox
Definition: navipi.hxx:60
Idle m_aPageChgIdle
Definition: navipi.hxx:77
DECL_LINK(DocListBoxSelectHdl, weld::ComboBox &, void)
std::unique_ptr< ToolbarUnoDispatcher > m_xContent2Dispatch
Definition: navipi.hxx:64
virtual void StateChanged(StateChangedType nStateChange) override
Definition: navipi.cxx:744
SwView * GetCreateView() const
Definition: navipi.cxx:1096
SwView * m_pCreateView
Definition: navipi.hxx:85
void ZoomOut()
Definition: navipi.cxx:421
SwView * m_pContentView
Definition: navipi.hxx:82
bool IsGlobalDoc() const
Definition: navipi.cxx:1057
static void RegisterChildWindowContext(SfxModule *pMod)
Definition: navipi.cxx:62
SfxItemState
Size m_aExpandedSize
Definition: navipi.hxx:91
virtual void GetControlState(const sal_uInt16, boost::property_tree::ptree &) override
Definition: navipi.hxx:143
std::unique_ptr< weld::Toolbar > m_xContent2ToolBox
Definition: navipi.hxx:59
static VclPtr< vcl::Window > Create(vcl::Window *pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > &rxFrame, SfxBindings *pBindings)
Definition: navipi.cxx:493
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: navipi.cxx:769
void FillBox()
Definition: navipi.cxx:150
SfxBindings & m_rBindings
Definition: navipi.hxx:88
bool m_bIsZoomedIn
Definition: navipi.hxx:93
void MoveOutline(SwOutlineNodes::size_type nSource, SwOutlineNodes::size_type nTarget)
Definition: navipi.cxx:88
FactoryFunction GetUITestFactory() const override
Definition: navipi.cxx:392
std::unique_ptr< weld::SpinButton > m_xEdit
Definition: navipi.hxx:71
std::vector< SwNode * >::size_type size_type
std::unique_ptr< weld::Menu > m_xInsertMenu
Definition: navipi.hxx:69
std::unique_ptr< ToolbarUnoDispatcher > m_xContent3Dispatch
Definition: navipi.hxx:65
std::unique_ptr< SfxObjectShellLock > m_pxObjectShell
Definition: navipi.hxx:81
Definition: view.hxx:144
RegionMode m_nRegionMode
Definition: navipi.hxx:90