LibreOffice Module sc (master) 1
content.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 <vcl/weld.hxx>
23#include <address.hxx>
24#include <tools/solar.h>
25#include <o3tl/enumarray.hxx>
26
27class ScAreaLink;
29class ScDocument;
30class ScDocShell;
31class ScNavigatorDlg;
32struct ImplSVEvent;
33enum class SdrObjKind : sal_uInt16;
34
35enum class ScContentId {
39};
40
42
44{
45 std::unique_ptr<weld::TreeView> m_xTreeView;
46 std::unique_ptr<weld::TreeIter> m_xScratchIter;
50 ScContentId nRootType; // set as Root
51 OUString aManualDoc; // Switched in Navigator (Title)
52 bool bHiddenDoc; // Hidden active?
53 OUString aHiddenName; // URL to load
54 OUString aHiddenTitle; // for display
59
61
63
66 void ClearAll();
67 void InsertContent( ScContentId nType, const OUString& rValue );
69
70 void GetTableNames();
71 void GetAreaNames();
72 void GetDbNames();
73 void GetLinkNames();
74 void GetGraphicNames();
75 void GetOleNames();
76 void GetDrawingNames();
77 void GetNoteStrings();
78
79 static bool IsPartOfType( ScContentId nContentType, SdrObjKind nObjIdentifier );
80
82 bool NoteStringsChanged();
83
85 const ScAreaLink* GetLink( sal_uLong nIndex );
86
91 void GetEntryIndexes(ScContentId& rnRootIndex, sal_uLong& rnChildIndex, const weld::TreeIter* pEntry) const;
92
96 sal_uLong GetChildIndex(const weld::TreeIter* pEntry) const;
97
99
100 void freeze()
101 {
102 m_xTreeView->freeze();
103 m_bFreeze = true;
104 }
105
106 void thaw()
107 {
108 m_xTreeView->thaw();
109 m_bFreeze = false;
110 }
111
113
114 DECL_LINK(ContentDoubleClickHdl, weld::TreeView&, bool);
115 DECL_LINK(MouseReleaseHdl, const MouseEvent&, bool);
116 DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
117 DECL_LINK(AsyncStoreNavigatorSettings, void*, void);
118 DECL_LINK(CommandHdl, const CommandEvent&, bool);
119 DECL_LINK(QueryTooltipHdl, const weld::TreeIter&, OUString);
120 DECL_LINK(DragBeginHdl, bool&, bool);
121
122public:
123 ScContentTree(std::unique_ptr<weld::TreeView> xTreeView, ScNavigatorDlg* pNavigatorDlg);
125
126 void SetNavigatorDlgFlag(bool isInNavigateDlg){ bIsInNavigatorDlg=isInNavigateDlg;};
127
128 void hide()
129 {
130 m_xTreeView->hide();
131 }
132
133 void show()
134 {
135 m_xTreeView->show();
136 }
137
139
140 void ToggleRoot();
141 void SetRootType( ScContentId nNew );
143
144 // return true if Refresh was called to allow detecting that the navigator
145 // tree is now up to date
146 bool ActiveDocChanged();
147 void ResetManualDoc();
148 void SetManualDoc(const OUString& rName);
149 void LoadFile(const OUString& rUrl);
150 void SelectDoc(const OUString& rName);
151 void SelectEntryByName(const ScContentId nRoot, std::u16string_view rName);
152
153 const OUString& GetHiddenTitle() const { return aHiddenTitle; }
154
159};
160
161/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SelectEntryByName(const ScContentId nRoot, std::u16string_view rName)
Definition: content.cxx:1519
void SetNavigatorDlgFlag(bool isInNavigateDlg)
Definition: content.hxx:126
ScDocument * pHiddenDocument
Definition: content.hxx:55
void hide()
Definition: content.hxx:128
const ScAreaLink * GetLink(sal_uLong nIndex)
Definition: content.cxx:915
ScContentTree(std::unique_ptr< weld::TreeView > xTreeView, ScNavigatorDlg *pNavigatorDlg)
Definition: content.cxx:121
void GetLinkNames()
Definition: content.cxx:892
std::unique_ptr< weld::TreeIter > m_xScratchIter
Definition: content.hxx:46
void ToggleRoot()
Definition: content.cxx:1388
void GetNoteStrings()
Definition: content.cxx:946
void freeze()
Definition: content.hxx:100
void ClearType(ScContentId nType)
Definition: content.cxx:216
void thaw()
Definition: content.hxx:106
std::unique_ptr< weld::TreeView > m_xTreeView
Definition: content.hxx:45
void GetOleNames()
Definition: content.cxx:882
bool bHiddenDoc
Definition: content.hxx:52
void LaunchAsyncStoreNavigatorSettings()
Definition: content.cxx:400
ImplSVEvent * m_nAsyncMouseReleaseId
Definition: content.hxx:58
DECL_LINK(ContentDoubleClickHdl, weld::TreeView &, bool)
void StoreNavigatorSettings()
Stores the current listbox state in the navigator settings.
Definition: content.cxx:1602
DECL_LINK(QueryTooltipHdl, const weld::TreeIter &, OUString)
void GetDrawNames(ScContentId nType)
Definition: content.cxx:818
DECL_LINK(MouseReleaseHdl, const MouseEvent &, bool)
void ApplyNavigatorSettings()
Applies the navigator settings to the listbox.
Definition: content.cxx:1547
bool NoteStringsChanged()
Definition: content.cxx:976
void GetTableNames()
Definition: content.cxx:714
bool ActiveDocChanged()
Definition: content.cxx:1424
void InsertContent(ScContentId nType, const OUString &rValue)
Definition: content.cxx:232
DECL_LINK(AsyncStoreNavigatorSettings, void *, void)
void Refresh(ScContentId nType=ScContentId::ROOT)
Definition: content.cxx:668
void GetDrawingNames()
Definition: content.cxx:887
void show()
Definition: content.hxx:133
OUString aHiddenName
Definition: content.hxx:53
const OUString & GetHiddenTitle() const
Definition: content.hxx:153
o3tl::enumarray< ScContentId, sal_uInt16 > pPosList
Definition: content.hxx:60
OUString aManualDoc
Definition: content.hxx:51
bool bIsInNavigatorDlg
Definition: content.hxx:56
void SelectDoc(const OUString &rName)
Definition: content.cxx:1471
sal_uLong GetChildIndex(const weld::TreeIter *pEntry) const
Returns the child index of the specified listbox entry.
Definition: content.cxx:293
o3tl::enumarray< ScContentId, std::unique_ptr< weld::TreeIter > > m_aRootNodes
Definition: content.hxx:49
DECL_LINK(DragBeginHdl, bool &, bool)
ScDocShell * GetManualOrCurrent()
Definition: content.cxx:90
void ClearAll()
Definition: content.cxx:199
void SetRootType(ScContentId nNew)
Definition: content.cxx:1376
static bool IsPartOfType(ScContentId nContentType, SdrObjKind nObjIdentifier)
Definition: content.cxx:796
ScContentId GetRootType() const
Definition: content.hxx:142
rtl::Reference< ScLinkTransferObj > m_xTransferObj
Definition: content.hxx:47
ScContentId nRootType
Definition: content.hxx:50
void GetAreaNames()
Definition: content.cxx:740
void SetManualDoc(const OUString &rName)
Definition: content.cxx:1461
void GetDbNames()
Definition: content.cxx:778
ScNavigatorDlg * pParentWindow
Definition: content.hxx:48
void InitRoot(ScContentId nType)
Definition: content.cxx:179
void GetGraphicNames()
Definition: content.cxx:877
void GetEntryIndexes(ScContentId &rnRootIndex, sal_uLong &rnChildIndex, const weld::TreeIter *pEntry) const
Returns the indexes of the specified listbox entry.
Definition: content.cxx:246
ScDocument * GetSourceDocument()
Definition: content.cxx:654
void LoadFile(const OUString &rUrl)
Definition: content.cxx:1349
OUString aHiddenTitle
Definition: content.hxx:54
ScAddress GetNotePos(sal_uLong nIndex)
Definition: content.cxx:967
DECL_LINK(CommandHdl, const CommandEvent &, bool)
bool DrawNamesChanged(ScContentId nType)
Definition: content.cxx:1006
DECL_LINK(KeyInputHdl, const KeyEvent &, bool)
bool m_bFreeze
Definition: content.hxx:57
void ResetManualDoc()
Definition: content.cxx:1416
ScContentId
Definition: content.hxx:35
const sal_uLong SC_CONTENT_NOCHILD
Definition: content.hxx:41
TABLE
QPRO_FUNC_TYPE nType
Definition: qproform.cxx:398
sal_uIntPtr sal_uLong
SdrObjKind