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#pragma once
21
22#include <vector>
23#include <vcl/idle.hxx>
24#include <svl/lstner.hxx>
25#include <sfx2/childwin.hxx>
26#include <sfx2/navigat.hxx>
28#include "content.hxx"
29
30class SfxPoolItem;
31class ScTabViewShell;
32class ScViewData;
33class ScArea;
36class ScNavigatorDlg;
38
39#define SC_DROPMODE_URL 0
40#define SC_DROPMODE_LINK 1
41#define SC_DROPMODE_COPY 2
42
46
48{
49public:
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
58private:
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
87{
88friend class ScNavigatorWin;
90friend class ScContentTree;
91
92private:
93 static constexpr int CTRL_ITEMS = 4;
94
95 SfxBindings& rBindings; // must be first member
96
97 std::unique_ptr<weld::SpinButton> m_xEdCol;
98 std::unique_ptr<weld::SpinButton> m_xEdRow;
99 std::unique_ptr<weld::Toolbar> m_xTbxCmd1;
100 std::unique_ptr<weld::Toolbar> m_xTbxCmd2;
101 std::unique_ptr<ScContentTree> m_xLbEntries;
102 std::unique_ptr<weld::Widget> m_xScenarioBox;
103 std::unique_ptr<ScScenarioWindow> m_xWndScenarios;
104 std::unique_ptr<weld::ComboBox> m_xLbDocuments;
105 std::unique_ptr<weld::Menu> m_xDragModeMenu;
106
108
111
112 OUString aStrActive;
114 OUString aStrHidden;
116
117 std::unique_ptr<ScArea> pMarkArea;
119
121 sal_uInt16 nDropMode;
125
126 std::array<std::unique_ptr<ScNavigatorControllerItem>,CTRL_ITEMS> mvBoundItems;
127
128 DECL_LINK(TimeHdl, Timer*, void);
129 DECL_LINK(DocumentSelectHdl, weld::ComboBox&, void);
130 DECL_LINK(ExecuteRowHdl, weld::Entry&, bool);
131 DECL_LINK(ExecuteColHdl, weld::Entry&, bool);
132 DECL_LINK(ToolBoxSelectHdl, const OString&, void);
133 DECL_LINK(ToolBoxDropdownClickHdl, const OString&, void);
134 DECL_LINK(MenuSelectHdl, const OString&, void);
135 DECL_LINK(FormatRowOutputHdl, weld::SpinButton&, void);
136 DECL_LINK(ParseRowInputHdl, int*, bool);
137
138 void UpdateButtons();
139 void SetCurrentCell( SCCOL nCol, SCROW Row );
140 void SetCurrentCellStr( const OUString& rName );
141 void SetCurrentTable( SCTAB nTab );
142 void SetCurrentTableStr( std::u16string_view rName );
143 void SetCurrentObject( const OUString& rName );
144 void SetCurrentDoc( const OUString& rDocName );
145 void UpdateSelection();
146 void ContentUpdated(); // stop aContentIdle because content is up to date
147
151
152 void UpdateSheetLimits();
153
154 void UpdateColumn ( const SCCOL* pCol = nullptr );
155 void UpdateRow ( const SCROW* pRow = nullptr );
156 void UpdateTable ( const SCTAB* pTab );
157 void UpdateAll ();
158
159 void GetDocNames(const OUString* pSelEntry);
160
161 void SetListMode(NavListMode eMode);
162 void ShowList(bool bShow);
163 void ShowScenarios();
164
165 void SetDropMode(sal_uInt16 nNew);
166 sal_uInt16 GetDropMode() const { return nDropMode; }
167
168 void MarkDataArea ();
169 void UnmarkDataArea ();
170 void StartOfDataArea ();
171 void EndOfDataArea ();
172
173 void UpdateInitShow();
174
175 static void ReleaseFocus();
176
177public:
178 ScNavigatorDlg(SfxBindings* pB, weld::Widget* pParent, SfxNavigator* pNavigatorDlg);
179 virtual weld::Window* GetFrameWeld() const override;
180 virtual ~ScNavigatorDlg() override;
181
182 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
183
184};
185
187{
188public:
190 SfxBindings* pBindings, SfxChildWinInfo* pInfo);
192};
193
194/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::SpinButton > m_xEdRow
Definition: navipi.hxx:98
SCTAB nCurTab
Definition: navipi.hxx:124
void SetCurrentCell(SCCOL nCol, SCROW Row)
Definition: navipi.cxx:574
std::unique_ptr< weld::Widget > m_xScenarioBox
Definition: navipi.hxx:102
void StartOfDataArea()
Definition: navipi.cxx:920
DECL_LINK(ExecuteColHdl, weld::Entry &, bool)
void EndOfDataArea()
Definition: navipi.cxx:937
void SetListMode(NavListMode eMode)
Definition: navipi.cxx:769
void UpdateColumn(const SCCOL *pCol=nullptr)
Definition: navipi.cxx:720
void UpdateSheetLimits()
Definition: navipi.cxx:435
DECL_LINK(ParseRowInputHdl, int *, bool)
ScViewData * GetViewData()
Definition: navipi.cxx:713
VclPtr< SfxNavigator > m_xNavigatorDlg
Definition: navipi.hxx:107
sal_uInt16 GetDropMode() const
Definition: navipi.hxx:166
virtual weld::Window * GetFrameWeld() const override
Definition: navipi.cxx:428
void ContentUpdated()
Definition: navipi.cxx:764
std::unique_ptr< ScContentTree > m_xLbEntries
Definition: navipi.hxx:101
void SetDropMode(sal_uInt16 nNew)
Definition: navipi.cxx:566
static ScNavigatorSettings * GetNavigatorSettings()
Definition: navipi.cxx:702
OUString aStrActiveWin
Definition: navipi.hxx:115
void UnmarkDataArea()
Definition: navipi.cxx:909
OUString aStrNotActive
Definition: navipi.hxx:113
void UpdateAll()
Definition: navipi.cxx:748
void MarkDataArea()
Definition: navipi.cxx:890
ScNavigatorDlg(SfxBindings *pB, weld::Widget *pParent, SfxNavigator *pNavigatorDlg)
Definition: navipi.cxx:337
SfxBindings & rBindings
Definition: navipi.hxx:95
std::unique_ptr< weld::ComboBox > m_xLbDocuments
Definition: navipi.hxx:104
static ScTabViewShell * GetTabViewShell()
Definition: navipi.cxx:697
std::unique_ptr< weld::SpinButton > m_xEdCol
Definition: navipi.hxx:97
DECL_LINK(DocumentSelectHdl, weld::ComboBox &, void)
std::unique_ptr< weld::Toolbar > m_xTbxCmd1
Definition: navipi.hxx:99
void SetCurrentTable(SCTAB nTab)
Definition: navipi.cxx:608
void SetCurrentTableStr(std::u16string_view rName)
Definition: navipi.cxx:620
void SetCurrentCellStr(const OUString &rName)
Definition: navipi.cxx:598
void GetDocNames(const OUString *pSelEntry)
Definition: navipi.cxx:844
void SetCurrentObject(const OUString &rName)
Definition: navipi.cxx:655
static constexpr int CTRL_ITEMS
Definition: navipi.hxx:93
Size aExpandedSize
Definition: navipi.hxx:109
void UpdateTable(const SCTAB *pTab)
Definition: navipi.cxx:740
void UpdateSelection()
Definition: navipi.cxx:671
void ShowList(bool bShow)
Definition: navipi.cxx:818
void ShowScenarios()
Definition: navipi.cxx:833
SCROW nCurRow
Definition: navipi.hxx:123
virtual ~ScNavigatorDlg() override
Definition: navipi.cxx:461
DECL_LINK(TimeHdl, Timer *, void)
Idle aContentIdle
Definition: navipi.hxx:110
DECL_LINK(ExecuteRowHdl, weld::Entry &, bool)
std::unique_ptr< ScArea > pMarkArea
Definition: navipi.hxx:117
OUString aStrHidden
Definition: navipi.hxx:114
OUString aStrActive
Definition: navipi.hxx:112
static void ReleaseFocus()
Definition: navipi.cxx:64
SCCOL nCurCol
Definition: navipi.hxx:122
std::array< std::unique_ptr< ScNavigatorControllerItem >, CTRL_ITEMS > mvBoundItems
Definition: navipi.hxx:126
void UpdateButtons()
Definition: navipi.cxx:268
sal_uInt16 nDropMode
Definition: navipi.hxx:121
DECL_LINK(MenuSelectHdl, const OString &, void)
ScViewData * pViewData
Definition: navipi.hxx:118
NavListMode eListMode
Definition: navipi.hxx:120
DECL_LINK(ToolBoxSelectHdl, const OString &, void)
void SetCurrentDoc(const OUString &rDocName)
Definition: navipi.cxx:663
DECL_LINK(ToolBoxDropdownClickHdl, const OString &, void)
DECL_LINK(FormatRowOutputHdl, weld::SpinButton &, void)
std::unique_ptr< weld::Menu > m_xDragModeMenu
Definition: navipi.hxx:105
void UpdateInitShow()
Definition: navipi.cxx:446
void UpdateRow(const SCROW *pRow=nullptr)
Definition: navipi.cxx:730
std::unique_ptr< weld::Toolbar > m_xTbxCmd2
Definition: navipi.hxx:100
std::unique_ptr< ScScenarioWindow > m_xWndScenarios
Definition: navipi.hxx:103
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: navipi.cxx:483
Contains settings of the navigator listbox.
Definition: navsett.hxx:30
SFX_DECL_CHILDWINDOW(ScNavigatorWrapper)
ScNavigatorWrapper(vcl::Window *pParent, sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo *pInfo)
Definition: navipi.cxx:956
std::unique_ptr< weld::TreeView > m_xLbScenario
Definition: navipi.hxx:59
void EditScenario()
Definition: scenwnd.cxx:165
void ExecuteScenarioSlot(sal_uInt16 nSlotId)
Definition: scenwnd.cxx:149
DECL_LINK(SelectHdl, weld::TreeView &, void)
void NotifyState(const SfxPoolItem *pState)
Definition: scenwnd.cxx:215
const ScenarioEntry * GetSelectedScenarioEntry() const
Definition: scenwnd.cxx:143
void SetComment(const OUString &rComment)
Definition: navipi.hxx:53
std::unique_ptr< weld::TextView > m_xEdComment
Definition: navipi.hxx:60
DECL_LINK(ContextMenuHdl, const CommandEvent &, bool)
ScScenarioWindow(weld::Builder &rBuilder, const OUString &rQH_List, const OUString &rQH_Comment)
Definition: scenwnd.cxx:186
std::vector< ScenarioEntry > m_aEntries
Definition: navipi.hxx:71
DECL_LINK(DoubleClickHdl, weld::TreeView &, bool)
void SelectScenario()
Definition: scenwnd.cxx:159
DECL_LINK(KeyInputHdl, const KeyEvent &, bool)
void UpdateEntries(const std::vector< OUString > &rNewEntryList)
Definition: scenwnd.cxx:37
void DeleteScenario()
Definition: scenwnd.cxx:171
VclPtr< vcl::Window > pParent
NavListMode
Definition: navipi.hxx:43
@ NAV_LMODE_NONE
Definition: navipi.hxx:43
@ NAV_LMODE_AREAS
Definition: navipi.hxx:44
@ NAV_LMODE_SCENARIOS
Definition: navipi.hxx:45
sal_Int16 nId
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17