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/layout.hxx>
23 #include <vcl/lstbox.hxx>
24 #include <vcl/toolbox.hxx>
25 #include <vcl/idle.hxx>
26 #include <svl/lstner.hxx>
27 #include <vcl/transfer.hxx>
28 #include <sfx2/childwin.hxx>
29 #include <sfx2/ctrlitem.hxx>
30 #include <sfx2/tbxctrl.hxx>
32 #include "conttree.hxx"
33 #include <ndarr.hxx>
34 #include <memory>
35 
36 class SwWrtShell;
37 class SwNavigationPI;
38 class SwNavigationChild;
39 class SfxBindings;
40 class NumEditAction;
41 class SwView;
42 class SwNavigationConfig;
43 class SfxObjectShellLock;
45 enum class RegionMode;
46 class SpinField;
47 
48 class SwNavHelpToolBox : public ToolBox
49 {
51  virtual void MouseButtonDown(const MouseEvent &rEvt) override;
52  virtual void RequestHelp( const HelpEvent& rHEvt ) override;
53  virtual void dispose() override;
54 public:
55  SwNavHelpToolBox(Window* pParent);
56  void SetDialog(SwNavigationPI* pDialog)
57  {
58  m_xDialog = pDialog;
59  }
60  ~SwNavHelpToolBox() override;
61 };
62 
63 class SwNavigationPI : public PanelLayout,
64  public SfxControllerItem, public SfxListener
65 {
66  friend class SwNavigationChild;
67  friend class SwContentTree;
68  friend class SwGlobalTree;
69  friend class SwNavigationPIUIObject;
70 
81  OUString m_aContextArr[3];
82  OUString m_aStatusArr[4];
83 
84  std::unique_ptr<SfxObjectShellLock> m_pxObjectShell;
91 
94 
95  sal_uInt16 m_nAutoMarkIdx;
96  RegionMode m_nRegionMode; // 0 - URL, 1 - region with link 2 - region without link
98 
99  bool m_bIsZoomedIn : 1;
100  bool m_bGlobalMode : 1;
101 
102  bool IsZoomedIn() const {return m_bIsZoomedIn;}
103  void ZoomOut();
104  void ZoomIn();
105 
106  void FillBox();
107  void MakeMark();
108 
109  DECL_LINK( DocListBoxSelectHdl, ListBox&, void );
110  DECL_LINK( ToolBoxSelectHdl, ToolBox *, void );
111  DECL_LINK( ToolBoxClickHdl, ToolBox *, void );
112  DECL_LINK( ToolBoxDropdownClickHdl, ToolBox*, void );
113  DECL_LINK( EditAction, NumEditAction&, void );
114  DECL_LINK( EditGetFocus, Control&, void );
115  DECL_LINK( DoneLink, SfxPoolItem const *, void );
116  DECL_LINK( MenuSelectHdl, Menu *, bool );
117  DECL_LINK( ChangePageHdl, Timer*, void );
118  DECL_LINK( PageEditModifyHdl, SpinField&, void );
119  DECL_LINK( PopupModeEndHdl, FloatingWindow*, void );
120  DECL_LINK( ClosePopupWindow, SfxPopupWindow *, void );
121  void UsePage();
122 
124 
125 protected:
126 
127  // release ObjectShellLock early enough for app end
128  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
129 
131  void ToggleTree();
132  void SetGlobalMode(bool bSet) {m_bGlobalMode = bSet;}
133 
134 public:
135 
137  virtual ~SwNavigationPI() override;
138  virtual void dispose() override;
139 
140  void UpdateListBox();
141  void MoveOutline(SwOutlineNodes::size_type nSource, SwOutlineNodes::size_type nTarget, bool bWithCilds);
142 
143  virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
144  const SfxPoolItem* pState ) 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  void CreateNavigationTool(const tools::Rectangle& rRect, bool bSetFocus, vcl::Window *pParent);
162 
163  FactoryFunction GetUITestFactory() const override;
164 };
165 
167 {
168 public:
170  sal_uInt16 nId,
171  SfxBindings* );
172 
174  static std::unique_ptr<SfxChildWindowContext> CreateImpl(vcl::Window *pParent,
175  SfxBindings *pBindings, SfxChildWinInfo* pInfo );
176  static void RegisterChildWindowContext(SfxModule *pMod);
177 };
178 
179 #endif
180 
181 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwNavigationChild(vcl::Window *, sal_uInt16 nId, SfxBindings *)
Definition: navipi.cxx:1229
SwNavigationConfig * m_pConfig
Definition: navipi.hxx:92
bool IsZoomedIn() const
Definition: navipi.hxx:102
void ZoomIn()
Definition: navipi.cxx:559
void MoveOutline(SwOutlineNodes::size_type nSource, SwOutlineNodes::size_type nTarget, bool bWithCilds)
Definition: navipi.cxx:100
virtual ~SwNavigationPI() override
Definition: navipi.cxx:757
void SetRegionDropMode(RegionMode nNewMode)
Definition: navipi.cxx:1127
signed char sal_Int8
void SetGlobalMode(bool bSet)
Definition: navipi.hxx:132
static std::unique_ptr< SfxChildWindowContext > CreateImpl(vcl::Window *pParent, SfxBindings *pBindings, SfxChildWinInfo *pInfo)
soon obsolete !
Definition: navipi.cxx:67
void UsePage()
Definition: navipi.cxx:194
Window(vcl::Window *pParent, WinBits nStyle=0)
void MakeMark()
Definition: navipi.cxx:496
std::function< std::unique_ptr< UIObject >vcl::Window *)> FactoryFunction
OUString m_aStatusArr[4]
Definition: navipi.hxx:82
sal_Int16 nId
sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt)
Definition: navipi.cxx:1086
SwView * m_pActContView
Definition: navipi.hxx:87
~SwNavHelpToolBox() override
Definition: navipi.cxx:459
virtual void RequestHelp(const HelpEvent &rHEvt) override
Definition: navipi.cxx:442
void UpdateListBox()
Definition: navipi.cxx:945
Used by the UI to modify the document model.
Definition: wrtsh.hxx:88
StateChangedType
virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem *pState) override
Definition: navipi.cxx:838
TreeListBox for content indicator.
Definition: conttree.hxx:71
VclPtr< ListBox > m_aDocListBox
Definition: navipi.hxx:78
static OUString CreateDropFileName(TransferableDataHelper &rData)
Definition: navipi.cxx:1038
void ToggleTree()
Definition: navipi.cxx:1148
VclPtr< VclContainer > m_aGlobalBox
Definition: navipi.hxx:76
SwWrtShell * m_pContentWrtShell
Definition: navipi.hxx:86
VclPtr< SwNavigationPI > m_xDialog
Definition: navipi.hxx:50
sal_Int8 AcceptDrop()
Definition: navipi.cxx:1071
virtual void dispose() override
Definition: navipi.cxx:762
RegionMode GetRegionDropMode() const
Definition: navipi.hxx:151
SwNavHelpToolBox(Window *pParent)
Definition: navipi.cxx:401
bool m_bGlobalMode
Definition: navipi.hxx:100
VclPtr< ToolBox > m_aGlobalToolBox
Definition: navipi.hxx:72
static OUString CleanEntry(const OUString &rEntry)
Definition: navipi.cxx:85
RegionMode
Definition: swcont.hxx:51
VclPtr< SfxPopupWindow > m_pFloatingWindow
Definition: navipi.hxx:90
bool IsGlobalMode() const
Definition: navipi.hxx:158
void CreateNavigationTool(const tools::Rectangle &rRect, bool bSetFocus, vcl::Window *pParent)
Definition: navipi.cxx:419
SwNavigationPI(SfxBindings *, vcl::Window *)
Definition: navipi.cxx:596
OUString m_sContentFileName
Definition: navipi.hxx:80
VclPtr< SwGlobalTree > m_aGlobalTree
Definition: navipi.hxx:77
VclPtr< SwContentTree > m_aContentTree
Definition: navipi.hxx:75
VclPtr< SwNavHelpToolBox > m_aContentToolBox
Definition: navipi.hxx:71
void SetDialog(SwNavigationPI *pDialog)
Definition: navipi.hxx:56
Idle m_aPageChgIdle
Definition: navipi.hxx:79
VclPtr< SfxPopupWindow > m_pPopupWindow
Definition: navipi.hxx:89
VclPtr< VclContainer > m_aContentBox
Definition: navipi.hxx:74
SwView * GetCreateView() const
Definition: navipi.cxx:1210
SwView * m_pCreateView
Definition: navipi.hxx:88
virtual void MouseButtonDown(const MouseEvent &rEvt) override
Definition: navipi.cxx:408
void ZoomOut()
Definition: navipi.cxx:525
SwView * m_pContentView
Definition: navipi.hxx:85
bool IsGlobalDoc() const
Definition: navipi.cxx:1182
static void RegisterChildWindowContext(SfxModule *pMod)
Definition: navipi.cxx:74
SfxItemState
Size m_aExpandedSize
Definition: navipi.hxx:97
VclPtr< NumEditAction > m_xEdit
Definition: navipi.hxx:73
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: navipi.cxx:896
virtual void dispose() override
Definition: navipi.cxx:453
NumEditAction & GetPageEdit()
Definition: navipi.cxx:890
void FillBox()
Definition: navipi.cxx:169
SfxBindings & m_rBindings
Definition: navipi.hxx:93
bool m_bIsZoomedIn
Definition: navipi.hxx:99
FactoryFunction GetUITestFactory() const override
Definition: navipi.cxx:437
sal_uInt16 m_nAutoMarkIdx
Definition: navipi.hxx:95
std::vector< SwNode * >::size_type size_type
OUString m_aContextArr[3]
Definition: navipi.hxx:81
std::unique_ptr< SfxObjectShellLock > m_pxObjectShell
Definition: navipi.hxx:84
Definition: view.hxx:146
void SetPopupWindow(SfxPopupWindow *)
Definition: navipi.cxx:804
DECL_LINK(DocListBoxSelectHdl, ListBox &, void)
RegionMode m_nRegionMode
Definition: navipi.hxx:96