LibreOffice Module sc (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 
20 #ifndef INCLUDED_SC_SOURCE_UI_INC_NAVIPI_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_NAVIPI_HXX
22 
23 #include <vector>
24 #include <vcl/idle.hxx>
25 #include <svl/lstner.hxx>
26 #include <sfx2/childwin.hxx>
28 #include "content.hxx"
29 
30 class SfxPoolItem;
31 class ScTabViewShell;
32 class ScViewData;
33 class ScArea;
34 class ScScenarioWindow;
36 class ScNavigatorDlg;
38 
39 #define SC_DROPMODE_URL 0
40 #define SC_DROPMODE_LINK 1
41 #define SC_DROPMODE_COPY 2
42 
43 enum NavListMode { NAV_LMODE_NONE = 0x4000,
44  NAV_LMODE_AREAS = 0x2000,
46 
48 {
49 public:
50  ScScenarioWindow(weld::Builder& rBuilder, const OUString& rQH_List, const OUString& rQH_Comment);
52  void NotifyState(const SfxPoolItem* pState);
53  void SetComment(const OUString& rComment)
54  {
55  m_xEdComment->set_text(rComment);
56  }
57 
58 private:
59  std::unique_ptr<weld::TreeView> m_xLbScenario;
60  std::unique_ptr<weld::TextView> m_xEdComment;
61 
63  {
64  OUString maName;
65  OUString maComment;
67 
68  explicit ScenarioEntry() : mbProtected( false ) {}
69  };
70 
71  std::vector< ScenarioEntry > m_aEntries;
72 
73  void UpdateEntries(const std::vector<OUString> &rNewEntryList);
74  void SelectScenario();
75  void ExecuteScenarioSlot(sal_uInt16 nSlotId);
76  void EditScenario();
77  void DeleteScenario();
79 
80  DECL_LINK(SelectHdl, weld::TreeView&, void);
81  DECL_LINK(DoubleClickHdl, weld::TreeView&, bool);
82  DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
83  DECL_LINK(ContextMenuHdl, const CommandEvent&, bool);
84 };
85 
86 class ScNavigatorDlg : public PanelLayout, public SfxListener
87 {
90 friend class ScContentTree;
92 
93 private:
94  static constexpr int CTRL_ITEMS = 4;
95 
96  SfxBindings& rBindings; // must be first member
97 
98  std::unique_ptr<weld::SpinButton> m_xEdCol;
99  std::unique_ptr<weld::SpinButton> m_xEdRow;
100  std::unique_ptr<weld::Toolbar> m_xTbxCmd1;
101  std::unique_ptr<weld::Toolbar> m_xTbxCmd2;
102  std::unique_ptr<ScContentTree> m_xLbEntries;
103  std::unique_ptr<weld::Widget> m_xScenarioBox;
104  std::unique_ptr<ScScenarioWindow> m_xWndScenarios;
105  std::unique_ptr<weld::ComboBox> m_xLbDocuments;
106  std::unique_ptr<weld::Menu> m_xDragModeMenu;
107 
110 
111  OUString aStrActive;
112  OUString aStrNotActive;
113  OUString aStrHidden;
114  OUString aStrActiveWin;
115 
116  std::unique_ptr<ScArea> pMarkArea;
118 
120  sal_uInt16 nDropMode;
124 
125  std::array<std::unique_ptr<ScNavigatorControllerItem>,CTRL_ITEMS> mvBoundItems;
126 
127  DECL_LINK(TimeHdl, Timer*, void);
128  DECL_LINK(DocumentSelectHdl, weld::ComboBox&, void);
129  DECL_LINK(ExecuteRowHdl, weld::Entry&, bool);
130  DECL_LINK(ExecuteColHdl, weld::Entry&, bool);
131  DECL_LINK(ToolBoxSelectHdl, const OString&, void);
132  DECL_LINK(ToolBoxDropdownClickHdl, const OString&, void);
133  DECL_LINK(MenuSelectHdl, const OString&, void);
134  DECL_LINK(FormatRowOutputHdl, weld::SpinButton&, void);
135  DECL_LINK(ParseRowInputHdl, int*, bool);
136 
137  void UpdateButtons();
138  void SetCurrentCell( SCCOL nCol, SCROW Row );
139  void SetCurrentCellStr( const OUString& rName );
140  void SetCurrentTable( SCTAB nTab );
141  void SetCurrentTableStr( const OUString& rName );
142  void SetCurrentObject( const OUString& rName );
143  void SetCurrentDoc( const OUString& rDocName );
144  void UpdateSelection();
145 
149 
150  void UpdateSheetLimits();
151 
152  void UpdateColumn ( const SCCOL* pCol = nullptr );
153  void UpdateRow ( const SCROW* pRow = nullptr );
154  void UpdateTable ( const SCTAB* pTab );
155  void UpdateAll ();
156 
157  void GetDocNames(const OUString* pSelEntry);
158 
159  void SetListMode(NavListMode eMode);
160  void ShowList(bool bShow);
161  void ShowScenarios();
162 
163  void SetDropMode(sal_uInt16 nNew);
164  sal_uInt16 GetDropMode() const { return nDropMode; }
165 
166  void MarkDataArea ();
167  void UnmarkDataArea ();
168  void StartOfDataArea ();
169  void EndOfDataArea ();
170 
171  static void ReleaseFocus();
172 
173 public:
174  ScNavigatorDlg(SfxBindings* pB, vcl::Window* pParent);
175  virtual ~ScNavigatorDlg() override;
176  virtual void dispose() override;
177 
178  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
179 
180  virtual void StateChanged(StateChangedType nStateChange) override;
181 
182  FactoryFunction GetUITestFactory() const override;
183 };
184 
186 {
187 public:
189  sal_uInt16 nId,
190  SfxBindings* pBindings,
191  SfxChildWinInfo* pInfo );
192 
194 
195 private:
197 };
198 
199 #endif // INCLUDED_SC_SOURCE_UI_INC_NAVIPI_HXX
200 
201 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::ComboBox > m_xLbDocuments
Definition: navipi.hxx:105
VclPtr< ScNavigatorDlg > pNavigator
Definition: navipi.hxx:196
FactoryFunction GetUITestFactory() const override
Definition: navipi.cxx:445
void SetCurrentTable(SCTAB nTab)
Definition: navipi.cxx:602
ScViewData * pViewData
Definition: navipi.hxx:117
ScNavigatorDialogWrapper(vcl::Window *pParent, sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo *pInfo)
Definition: navipi.cxx:314
void UpdateSheetLimits()
Definition: navipi.cxx:422
SCROW nCurRow
Definition: navipi.hxx:122
void EndOfDataArea()
Definition: navipi.cxx:928
void UpdateTable(const SCTAB *pTab)
Definition: navipi.cxx:734
std::function< std::unique_ptr< UIObject >vcl::Window *)> FactoryFunction
sal_Int16 nId
OUString aStrNotActive
Definition: navipi.hxx:112
Contains settings of the navigator listbox.
Definition: navsett.hxx:30
std::unique_ptr< weld::SpinButton > m_xEdCol
Definition: navipi.hxx:98
void ExecuteScenarioSlot(sal_uInt16 nSlotId)
Definition: scenwnd.cxx:151
void GetDocNames(const OUString *pSelEntry)
Definition: navipi.cxx:833
void EditScenario()
Definition: scenwnd.cxx:167
void UpdateAll()
Definition: navipi.cxx:742
StateChangedType
void StartOfDataArea()
Definition: navipi.cxx:910
sal_uInt16 GetDropMode() const
Definition: navipi.hxx:164
void SetComment(const OUString &rComment)
Definition: navipi.hxx:53
SCCOL nCurCol
Definition: navipi.hxx:121
const ScenarioEntry * GetSelectedScenarioEntry() const
Definition: scenwnd.cxx:145
DECL_LINK(SelectHdl, weld::TreeView &, void)
void SetCurrentObject(const OUString &rName)
Definition: navipi.cxx:649
void ShowScenarios()
Definition: navipi.cxx:822
std::unique_ptr< ScScenarioWindow > m_xWndScenarios
Definition: navipi.hxx:104
virtual void StateChanged(StateChangedType nStateChange) override
Definition: navipi.cxx:433
std::unique_ptr< ScArea > pMarkArea
Definition: navipi.hxx:116
OUString aStrActiveWin
Definition: navipi.hxx:114
std::unique_ptr< weld::Toolbar > m_xTbxCmd2
Definition: navipi.hxx:101
std::unique_ptr< weld::TextView > m_xEdComment
Definition: navipi.hxx:60
NavListMode eListMode
Definition: navipi.hxx:119
sal_Int16 SCCOL
Definition: types.hxx:22
void UpdateEntries(const std::vector< OUString > &rNewEntryList)
Definition: scenwnd.cxx:39
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: navipi.cxx:478
Idle aContentIdle
Definition: navipi.hxx:109
void UpdateButtons()
Definition: navipi.cxx:270
static ScTabViewShell * GetTabViewShell()
Definition: navipi.cxx:691
void ShowList(bool bShow)
Definition: navipi.cxx:807
void SetCurrentDoc(const OUString &rDocName)
Definition: navipi.cxx:657
void UpdateRow(const SCROW *pRow=nullptr)
Definition: navipi.cxx:724
void DeleteScenario()
Definition: scenwnd.cxx:173
std::array< std::unique_ptr< ScNavigatorControllerItem >, CTRL_ITEMS > mvBoundItems
Definition: navipi.hxx:125
ScNavigatorDlg(SfxBindings *pB, vcl::Window *pParent)
Definition: navipi.cxx:326
void SetCurrentCellStr(const OUString &rName)
Definition: navipi.cxx:592
DECL_LINK(TimeHdl, Timer *, void)
void UnmarkDataArea()
Definition: navipi.cxx:899
virtual void dispose() override
Definition: navipi.cxx:455
sal_Int32 SCROW
Definition: types.hxx:18
std::unique_ptr< weld::Widget > m_xScenarioBox
Definition: navipi.hxx:103
static ScNavigatorSettings * GetNavigatorSettings()
Definition: navipi.cxx:696
void UpdateSelection()
Definition: navipi.cxx:665
OUString aStrHidden
Definition: navipi.hxx:113
std::unique_ptr< weld::Menu > m_xDragModeMenu
Definition: navipi.hxx:106
#define SFX_DECL_CHILDWINDOWCONTEXT(Class)
std::unique_ptr< ScContentTree > m_xLbEntries
Definition: navipi.hxx:102
SfxBindings & rBindings
Definition: navipi.hxx:96
void SetCurrentCell(SCCOL nCol, SCROW Row)
Definition: navipi.cxx:568
static constexpr int CTRL_ITEMS
Definition: navipi.hxx:94
void SetDropMode(sal_uInt16 nNew)
Definition: navipi.cxx:560
std::unique_ptr< weld::TreeView > m_xLbScenario
Definition: navipi.hxx:59
std::vector< ScenarioEntry > m_aEntries
Definition: navipi.hxx:71
static void ReleaseFocus()
Definition: navipi.cxx:65
std::unique_ptr< weld::SpinButton > m_xEdRow
Definition: navipi.hxx:99
void SetListMode(NavListMode eMode)
Definition: navipi.cxx:759
ScViewData * GetViewData()
Definition: navipi.cxx:707
void UpdateColumn(const SCCOL *pCol=nullptr)
Definition: navipi.cxx:714
virtual ~ScNavigatorDlg() override
Definition: navipi.cxx:450
ScScenarioWindow(weld::Builder &rBuilder, const OUString &rQH_List, const OUString &rQH_Comment)
Definition: scenwnd.cxx:188
void SelectScenario()
Definition: scenwnd.cxx:161
OUString aStrActive
Definition: navipi.hxx:111
Size aExpandedSize
Definition: navipi.hxx:108
void MarkDataArea()
Definition: navipi.cxx:879
void NotifyState(const SfxPoolItem *pState)
Definition: scenwnd.cxx:217
sal_uInt16 nDropMode
Definition: navipi.hxx:120
SCTAB nCurTab
Definition: navipi.hxx:123
sal_Int16 SCTAB
Definition: types.hxx:23
std::unique_ptr< weld::Toolbar > m_xTbxCmd1
Definition: navipi.hxx:100
void SetCurrentTableStr(const OUString &rName)
Definition: navipi.cxx:614