ndgrf.hxx (f7809f79) ndgrf.hxx (57326f99)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 11 unchanged lines hidden (view full) ---

20 *************************************************************/
21
22
23#ifndef _NDGRF_HXX
24#define _NDGRF_HXX
25#include <sfx2/lnkbase.hxx>
26#include <svtools/grfmgr.hxx>
27#include <ndnotxt.hxx>
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 11 unchanged lines hidden (view full) ---

20 *************************************************************/
21
22
23#ifndef _NDGRF_HXX
24#define _NDGRF_HXX
25#include <sfx2/lnkbase.hxx>
26#include <svtools/grfmgr.hxx>
27#include <ndnotxt.hxx>
28// --> OD, MAV 2005-08-17 #i53025#
29#include <com/sun/star/embed/XStorage.hpp>
28#include <com/sun/star/embed/XStorage.hpp>
30// <--
31// --> OD 2007-03-28 #i73788#
32#include <boost/shared_ptr.hpp>
33#include <boost/weak_ptr.hpp>
34class SwAsyncRetrieveInputStreamThreadConsumer;
29#include <boost/shared_ptr.hpp>
30#include <boost/weak_ptr.hpp>
31class SwAsyncRetrieveInputStreamThreadConsumer;
35// <--
36
37class SwGrfFmtColl;
38class SwDoc;
39class GraphicAttr;
40class SvStorage;
32
33class SwGrfFmtColl;
34class SwDoc;
35class GraphicAttr;
36class SvStorage;
41// --------------------
42// SwGrfNode
43// --------------------
37
38
44class SW_DLLPUBLIC SwGrfNode: public SwNoTxtNode
45{
39class SW_DLLPUBLIC SwGrfNode: public SwNoTxtNode
40{
46 friend class SwNodes;
41 friend class SwNodes;
47
42
48 GraphicObject maGrfObj;
49 GraphicObject* mpReplacementGraphic;
43 GraphicObject maGrfObj;
44 GraphicObject* mpReplacementGraphic;
50 ::sfx2::SvBaseLinkRef refLink; // falls Grafik nur als Link, dann Pointer gesetzt
45 ::sfx2::SvBaseLinkRef refLink; // falls Grafik nur als Link, dann Pointer gesetzt
51 Size nGrfSize;
52// String aStrmName; // SW3: Name des Storage-Streams fuer Embedded
53 String aNewStrmName; // SW3/XML: new stream name (either SW3 stream
54 // name or package url)
55 String aLowResGrf; // HTML: LowRes Grafik (Ersatzdarstellung bis
56 // die normale (HighRes) geladen ist.
57 sal_Bool bTransparentFlagValid :1;
58 sal_Bool bInSwapIn :1;
46 Size nGrfSize;
47 sal_Bool bInSwapIn :1;
59
48
60 sal_Bool bGrafikArrived :1;
61 sal_Bool bChgTwipSize :1;
62 sal_Bool bChgTwipSizeFromPixel :1;
63 sal_Bool bLoadLowResGrf :1;
64 sal_Bool bFrameInPaint :1; //Um Start-/EndActions im Paint (ueber
65 //SwapIn zu verhindern.
66 sal_Bool bScaleImageMap :1; //Image-Map in SetTwipSize skalieren
49 sal_Bool bGrafikArrived :1;
50 sal_Bool bChgTwipSize :1;
51 sal_Bool bChgTwipSizeFromPixel :1;
52 sal_Bool bLoadLowResGrf :1;
53 sal_Bool bFrameInPaint :1; // Um Start-/EndActions im Paint (ueber SwapIn zu verhindern.
54 sal_Bool bScaleImageMap :1; // Image-Map in SetTwipSize skalieren
67
55
68 // --> OD 2007-01-19 #i73788#
69 boost::shared_ptr< SwAsyncRetrieveInputStreamThreadConsumer > mpThreadConsumer;
70 bool mbLinkedInputStreamReady;
71 com::sun::star::uno::Reference<com::sun::star::io::XInputStream> mxInputStream;
72 sal_Bool mbIsStreamReadOnly;
56 boost::shared_ptr< SwAsyncRetrieveInputStreamThreadConsumer > mpThreadConsumer;
57 bool mbLinkedInputStreamReady;
58 com::sun::star::uno::Reference<com::sun::star::io::XInputStream> mxInputStream;
59 sal_Bool mbIsStreamReadOnly;
73 // <--
74
75 SwGrfNode( const SwNodeIndex& rWhere,
76 const String& rGrfName, const String& rFltName,
77 const Graphic* pGraphic,
78 SwGrfFmtColl* pGrfColl,
79 SwAttrSet* pAutoAttr = 0 );
80 // Ctor fuer Einlesen (SW/G) ohne Grafik
81 SwGrfNode( const SwNodeIndex& rWhere,
82 const String& rGrfName, const String& rFltName,
83 SwGrfFmtColl* pGrfColl,
84 SwAttrSet* pAutoAttr = 0 );
85 SwGrfNode( const SwNodeIndex& rWhere,
86 const GraphicObject& rGrfObj,
87 SwGrfFmtColl* pGrfColl,
88 SwAttrSet* pAutoAttr = 0 );
89
90 void InsertLink( const String& rGrfName, const String& rFltName );
91 sal_Bool ImportGraphic( SvStream& rStrm );
92 sal_Bool HasStreamName() const { return maGrfObj.HasUserData(); }
60
61 SwGrfNode( const SwNodeIndex& rWhere,
62 const String& rGrfName, const String& rFltName,
63 const Graphic* pGraphic,
64 SwGrfFmtColl* pGrfColl,
65 SwAttrSet* pAutoAttr = 0 );
66 // Ctor fuer Einlesen (SW/G) ohne Grafik
67 SwGrfNode( const SwNodeIndex& rWhere,
68 const String& rGrfName, const String& rFltName,
69 SwGrfFmtColl* pGrfColl,
70 SwAttrSet* pAutoAttr = 0 );
71 SwGrfNode( const SwNodeIndex& rWhere,
72 const GraphicObject& rGrfObj,
73 SwGrfFmtColl* pGrfColl,
74 SwAttrSet* pAutoAttr = 0 );
75
76 void InsertLink( const String& rGrfName, const String& rFltName );
77 sal_Bool ImportGraphic( SvStream& rStrm );
78 sal_Bool HasStreamName() const { return maGrfObj.HasUserData(); }
93 // --> OD 2005-05-04 #i48434# - adjust return type and rename method to
94 // indicate that its an private one.
95 // --> OD 2005-08-17 #i53025#
96 // embedded graphic stream couldn't be inside a 3.1 - 5.2 storage any more.
97 // Thus, return value isn't needed any more.
98 void _GetStreamStorageNames( String& rStrmName, String& rStgName ) const;
79 void _GetStreamStorageNames( String& rStrmName, String& rStgName ) const;
99 // <--
100 void DelStreamName();
101 DECL_LINK( SwapGraphic, GraphicObject* );
102
103 /** helper method to determine stream for the embedded graphic.
104
105 OD 2005-05-04 #i48434#
106 Important note: caller of this method has to handle the thrown exceptions
107 OD, MAV 2005-08-17 #i53025#

--- 80 unchanged lines hidden (view full) ---

188
189 // erneutes Einlesen, falls Graphic nicht Ok ist. Die
190 // aktuelle wird durch die neue ersetzt.
191 sal_Bool ReRead( const String& rGrfName, const String& rFltName,
192 const Graphic* pGraphic = 0,
193 const GraphicObject* pGrfObj = 0,
194 sal_Bool bModify = sal_True );
195 // Laden der Grafik unmittelbar vor der Anzeige
80 void DelStreamName();
81 DECL_LINK( SwapGraphic, GraphicObject* );
82
83 /** helper method to determine stream for the embedded graphic.
84
85 OD 2005-05-04 #i48434#
86 Important note: caller of this method has to handle the thrown exceptions
87 OD, MAV 2005-08-17 #i53025#

--- 80 unchanged lines hidden (view full) ---

168
169 // erneutes Einlesen, falls Graphic nicht Ok ist. Die
170 // aktuelle wird durch die neue ersetzt.
171 sal_Bool ReRead( const String& rGrfName, const String& rFltName,
172 const Graphic* pGraphic = 0,
173 const GraphicObject* pGrfObj = 0,
174 sal_Bool bModify = sal_True );
175 // Laden der Grafik unmittelbar vor der Anzeige
196 short SwapIn( sal_Bool bWaitForData = sal_False );
197 // Entfernen der Grafik, um Speicher freizugeben
198 short SwapOut();
199 // Zugriff auf den Storage-Streamnamen
200 void SetStreamName( const String& r ) { maGrfObj.SetUserData( r ); }
201 void SetNewStreamName( const String& r ) { aNewStrmName = r; }
202 // is this node selected by any shell?
203 sal_Bool IsSelected() const;
176 short SwapIn( sal_Bool bWaitForData = sal_False );
177 // Entfernen der Grafik, um Speicher freizugeben
178 short SwapOut();
179
180 // applying new stream name for embedded graphic - needed as saving the document might change this stream name
181 void ApplyNewEmbeddedStreamName( const String& r )
182 {
183 maGrfObj.SetUserData( r );
184 }
185
186 // is this node selected by any shell?
187 sal_Bool IsSelected() const;
204#endif
205
206 // Der Grafik sagen, dass sich der Node im Undobereich befindet
207 virtual sal_Bool SavePersistentData();
208 virtual sal_Bool RestorePersistentData();
209
210#ifndef _FESHVIEW_ONLY_INLINE_NEEDED
211 // Abfrage der Link-Daten

--- 7 unchanged lines hidden (view full) ---

219 // Skalieren einer Image-Map: Die Image-Map wird um den Faktor
220 // zwischen Grafik-Groesse und Rahmen-Groesse vergroessert/verkleinert
221 void ScaleImageMap();
222
223 // returns the with our graphic attributes filled Graphic-Attr-Structure
224 GraphicAttr& GetGraphicAttr( GraphicAttr&, const SwFrm* pFrm ) const;
225
226#endif
188#endif
189
190 // Der Grafik sagen, dass sich der Node im Undobereich befindet
191 virtual sal_Bool SavePersistentData();
192 virtual sal_Bool RestorePersistentData();
193
194#ifndef _FESHVIEW_ONLY_INLINE_NEEDED
195 // Abfrage der Link-Daten

--- 7 unchanged lines hidden (view full) ---

203 // Skalieren einer Image-Map: Die Image-Map wird um den Faktor
204 // zwischen Grafik-Groesse und Rahmen-Groesse vergroessert/verkleinert
205 void ScaleImageMap();
206
207 // returns the with our graphic attributes filled Graphic-Attr-Structure
208 GraphicAttr& GetGraphicAttr( GraphicAttr&, const SwFrm* pFrm ) const;
209
210#endif
227 // --> OD 2007-01-18 #i73788#
228 boost::weak_ptr< SwAsyncRetrieveInputStreamThreadConsumer > GetThreadConsumer();
229 bool IsLinkedInputStreamReady() const;
230 void TriggerAsyncRetrieveInputStream();
231 void ApplyInputStream(
232 com::sun::star::uno::Reference<com::sun::star::io::XInputStream> xInputStream,
233 const sal_Bool bIsStreamReadOnly );
234 void UpdateLinkWithInputStream();
211 boost::weak_ptr< SwAsyncRetrieveInputStreamThreadConsumer > GetThreadConsumer();
212 bool IsLinkedInputStreamReady() const;
213 void TriggerAsyncRetrieveInputStream();
214 void ApplyInputStream(
215 com::sun::star::uno::Reference<com::sun::star::io::XInputStream> xInputStream,
216 const sal_Bool bIsStreamReadOnly );
217 void UpdateLinkWithInputStream();
235 // <--
236 // --> OD 2008-07-21 #i90395#
237 bool IsAsyncRetrieveInputStreamPossible() const;
218 bool IsAsyncRetrieveInputStreamPossible() const;
238 // <--
239};
240
241
242// ----------------------------------------------------------------------
243// Inline Metoden aus Node.hxx - erst hier ist der TxtNode bekannt !!
244inline SwGrfNode *SwNode::GetGrfNode()
245{
246 return ND_GRFNODE == nNodeType ? (SwGrfNode*)this : 0;

--- 19 unchanged lines hidden ---
219};
220
221
222// ----------------------------------------------------------------------
223// Inline Metoden aus Node.hxx - erst hier ist der TxtNode bekannt !!
224inline SwGrfNode *SwNode::GetGrfNode()
225{
226 return ND_GRFNODE == nNodeType ? (SwGrfNode*)this : 0;

--- 19 unchanged lines hidden ---