LibreOffice Module sw (master) 1
ndole.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_INC_NDOLE_HXX
20#define INCLUDED_SW_INC_NDOLE_HXX
21
22#include "ndnotxt.hxx"
23#include <svtools/embedhlp.hxx>
25#include <rtl/ref.hxx>
26
27class SwGrfFormatColl;
28class SwDoc;
29class SwOLENode;
32class DeflateData;
33
35{
36 friend class SwOLENode;
37
40
44 OUString m_aName;
45
46 // eventually buffered data if it is a chart OLE
49 std::unique_ptr<DeflateData> m_pDeflateData;
50
51 SwOLEObj( const SwOLEObj& rObj ) = delete;
52
53 void SetNode( SwOLENode* pNode );
54
55 DECL_LINK(IsProtectedHdl, LinkParamNone*, bool);
56
57public:
58 SwOLEObj( const svt::EmbeddedObjectRef& pObj );
59 SwOLEObj( OUString aName, sal_Int64 nAspect );
60 ~SwOLEObj() COVERITY_NOEXCEPT_FALSE;
61
62 bool UnloadObject();
63 static bool UnloadObject( css::uno::Reference< css::embed::XEmbeddedObject > const & xObj,
64 const SwDoc* pDoc,
65 sal_Int64 nAspect );
66
67 OUString GetDescription();
68
69 css::uno::Reference < css::embed::XEmbeddedObject > const & GetOleRef();
70 svt::EmbeddedObjectRef& GetObject();
71 const OUString& GetCurrentPersistName() const { return m_aName; }
72 OUString GetStyleString();
73 bool IsOleRef() const;
74 bool IsProtected() const;
75
76 // try to get OLE visualization in form of a Primitive2DSequence
77 // and the corresponding B2DRange. This data may be locally buffered
78 drawinglayer::primitive2d::Primitive2DContainer const & tryToGetChartContentAsPrimitive2DSequence(
79 basegfx::B2DRange& rRange,
80 bool bSynchron);
81 void resetBufferedData();
82
83 void dumpAsXml(xmlTextWriterPtr pWriter) const;
84};
85
86// SwOLENode
87
89{
90 friend class SwNodes;
97 OUString maLinkURL;
98
99 SwOLENode( SwNode& rWhere,
101 SwGrfFormatColl *pGrfColl,
102 SwAttrSet const * pAutoAttr );
103
104 SwOLENode( SwNode& rWhere,
105 const OUString &rName,
106 sal_Int64 nAspect,
107 SwGrfFormatColl *pGrfColl,
108 SwAttrSet const * pAutoAttr );
109
110 SwOLENode( const SwOLENode & ) = delete;
111
113
114public:
115 const SwOLEObj& GetOLEObj() const { return maOLEObj; }
116 SwOLEObj& GetOLEObj() { return maOLEObj; }
117 virtual ~SwOLENode() override;
118
120 virtual SwContentNode* MakeCopy(SwDoc&, SwNode& rWhere, bool bNewFrames) const override;
121
122 virtual Size GetTwipSize() const override;
123
124 const Graphic* GetGraphic();
125
126 void GetNewReplacement();
127
128 virtual bool SavePersistentData() override;
129 virtual bool RestorePersistentData() override;
130
131 virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override;
132
133 bool IsInGlobalDocSection() const;
134 bool IsOLEObjectDeleted() const;
135
136 bool IsOLESizeInvalid() const { return mbOLESizeInvalid; }
137 void SetOLESizeInvalid( bool b ){ mbOLESizeInvalid = b; }
138
139 sal_Int64 GetAspect() const { return maOLEObj.GetObject().GetViewAspect(); }
140 void SetAspect( sal_Int64 nAspect) { maOLEObj.GetObject().SetViewAspect( nAspect ); }
141
144 OUString GetDescription() const { return maOLEObj.GetDescription(); }
145
146 bool UpdateLinkURL_Impl();
147 void BreakFileLink_Impl();
148 void DisconnectFileLink_Impl();
149
150 void CheckFileLink_Impl();
151
152 // #i99665#
153 bool IsChart() const;
154
155 const OUString& GetChartTableName() const { return msChartTableName; }
156 void SetChartTableName( const OUString& rNm ) { msChartTableName = rNm; }
157
158
159 // react on visual change (invalidate)
160 void SetChanged();
161};
162
165{
166 return SwNodeType::Ole == m_nNodeType ? static_cast<SwOLENode*>(this) : nullptr;
167}
168
169inline const SwOLENode *SwNode::GetOLENode() const
170{
171 return SwNodeType::Ole == m_nNodeType ? static_cast<const SwOLENode*>(this) : nullptr;
172}
173
174namespace sw
175{
176 class DocumentSettingManager;
177}
178
180{
181private:
184public:
185 PurgeGuard(const SwDoc& rDoc);
186 ~PurgeGuard() COVERITY_NOEXCEPT_FALSE;
187};
188
189#endif // _ INCLUDED_SW_INC_NDOLE_HXX
190
191/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _xmlTextWriter * xmlTextWriterPtr
Holder for local data for a parallel-executed task to load a chart model.
Definition: ndole.cxx:682
PurgeGuard(const SwDoc &rDoc)
Definition: ndole.cxx:1009
~PurgeGuard() COVERITY_NOEXCEPT_FALSE
Definition: ndole.cxx:1016
bool m_bOrigPurgeOle
Definition: ndole.hxx:183
::sw::DocumentSettingManager & m_rManager
Definition: ndole.hxx:182
Definition: doc.hxx:192
Layout frame for SwNoTextNode, i.e. graphics and OLE nodes (including charts).
Definition: ndnotxt.hxx:30
Graphic GetGraphic() const
Definition: ndnotxt.cxx:229
Base class of the Writer document model elements.
Definition: node.hxx:84
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
Definition: ndole.hxx:164
SwNodeType m_nNodeType
Definition: node.hxx:87
void dumpAsXml(xmlTextWriterPtr pWriter) const
Dumps the entire nodes structure to the given destination (file nodes.xml in the current directory by...
Definition: nodes.cxx:2536
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override
Dumps the node structure to the given destination (file nodes.xml in the current directory by default...
Definition: ndole.cxx:295
SwOLENode(const SwOLENode &)=delete
SwOLEObj & GetOLEObj()
Definition: ndole.hxx:116
bool IsOLESizeInvalid() const
Definition: ndole.hxx:136
OUString GetDescription() const
Remove OLE-object from "memory".
Definition: ndole.hxx:144
sal_Int64 GetAspect() const
Definition: ndole.hxx:139
const SwOLEObj & GetOLEObj() const
Definition: ndole.hxx:115
SwOLEObj maOLEObj
Definition: ndole.hxx:91
void SetChartTableName(const OUString &rNm)
Definition: ndole.hxx:156
bool mbOLESizeInvalid
Should be considered at SwDoc::PrtOLENotify (e.g.
Definition: ndole.hxx:93
void SetOLESizeInvalid(bool b)
Definition: ndole.hxx:137
const OUString & GetChartTableName() const
Definition: ndole.hxx:155
OUString msChartTableName
with chart objects: name of referenced table.
Definition: ndole.hxx:92
OUString maLinkURL
Definition: ndole.hxx:97
void SetAspect(sal_Int64 nAspect)
Definition: ndole.hxx:140
SwEmbedObjectLink * mpObjectLink
Definition: ndole.hxx:96
svt::EmbeddedObjectRef m_xOLERef
Either ref or name are known.
Definition: ndole.hxx:43
svt::EmbeddedObjectRef & GetObject()
Definition: ndole.cxx:991
std::unique_ptr< DeflateData > m_pDeflateData
Definition: ndole.hxx:49
OUString GetDescription()
Definition: ndole.cxx:1068
drawinglayer::primitive2d::Primitive2DContainer m_aPrimitive2DSequence
Definition: ndole.hxx:47
OUString m_aName
Definition: ndole.hxx:44
DECL_LINK(IsProtectedHdl, LinkParamNone *, bool)
SwOLEObj(const SwOLEObj &rObj)=delete
const SwOLENode * m_pOLENode
Definition: ndole.hxx:38
rtl::Reference< SwOLEListener_Impl > m_xListener
Definition: ndole.hxx:39
basegfx::B2DRange m_aRange
Definition: ndole.hxx:48
void SetViewAspect(sal_Int64 nAspect)
sal_Int64 GetViewAspect() const
Dialog to specify the properties of date form field.
OUString m_aName
#define SW_DLLPUBLIC
Definition: swdllapi.h:28