2010-10-14 01:30:41 -05:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2000-09-18 11:15:01 -05:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 05:26:06 -05:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 11:15:01 -05:00
|
|
|
*
|
2010-02-12 08:01:35 -06:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2000-09-18 11:15:01 -05:00
|
|
|
*
|
2008-04-10 05:26:06 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 11:15:01 -05:00
|
|
|
*
|
2008-04-10 05:26:06 -05:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 11:15:01 -05:00
|
|
|
*
|
2008-04-10 05:26:06 -05:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-09-18 11:15:01 -05:00
|
|
|
*
|
2008-04-10 05:26:06 -05:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-09-18 11:15:01 -05:00
|
|
|
*
|
2008-04-10 05:26:06 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-09-18 11:15:01 -05:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
#ifndef _NDOLE_HXX
|
|
|
|
#define _NDOLE_HXX
|
|
|
|
|
|
|
|
#include <ndnotxt.hxx>
|
|
|
|
|
2004-10-04 12:59:21 -05:00
|
|
|
#include <svtools/embedhlp.hxx>
|
|
|
|
|
2000-09-18 11:15:01 -05:00
|
|
|
class SwGrfFmtColl;
|
|
|
|
class SwDoc;
|
|
|
|
class SwOLENode;
|
|
|
|
|
2004-10-04 12:59:21 -05:00
|
|
|
class SwOLEListener_Impl;
|
2005-01-18 07:57:51 -06:00
|
|
|
class SwEmbedObjectLink;
|
2009-01-05 08:06:42 -06:00
|
|
|
class SW_DLLPUBLIC SwOLEObj
|
2000-09-18 11:15:01 -05:00
|
|
|
{
|
|
|
|
friend class SwOLENode;
|
|
|
|
|
|
|
|
const SwOLENode* pOLENd;
|
2004-10-04 12:59:21 -05:00
|
|
|
SwOLEListener_Impl* pListener;
|
2000-09-18 11:15:01 -05:00
|
|
|
|
|
|
|
//Entweder Ref oder Name sind bekannt, wenn nur der Name bekannt ist, wird
|
|
|
|
//dir Ref bei Anforderung durch GetOleRef() vom Sfx besorgt.
|
2004-10-04 12:59:21 -05:00
|
|
|
svt::EmbeddedObjectRef xOLERef;
|
2000-09-18 11:15:01 -05:00
|
|
|
String aName;
|
|
|
|
|
|
|
|
SwOLEObj( const SwOLEObj& rObj ); //nicht erlaubt.
|
|
|
|
SwOLEObj();
|
|
|
|
|
|
|
|
void SetNode( SwOLENode* pNode );
|
|
|
|
|
|
|
|
public:
|
2004-10-04 12:59:21 -05:00
|
|
|
SwOLEObj( const svt::EmbeddedObjectRef& pObj );
|
2006-10-13 05:08:14 -05:00
|
|
|
SwOLEObj( const String &rName, sal_Int64 nAspect );
|
2000-09-18 11:15:01 -05:00
|
|
|
~SwOLEObj();
|
|
|
|
|
2004-11-26 09:25:39 -06:00
|
|
|
BOOL UnloadObject();
|
2006-02-01 11:49:32 -06:00
|
|
|
static BOOL UnloadObject( ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedObject > xObj,
|
|
|
|
const SwDoc* pDoc,
|
|
|
|
sal_Int64 nAspect );
|
|
|
|
|
2004-09-08 09:16:26 -05:00
|
|
|
String GetDescription();
|
|
|
|
|
2000-09-18 11:15:01 -05:00
|
|
|
#ifndef _FESHVIEW_ONLY_INLINE_NEEDED
|
2004-10-04 12:59:21 -05:00
|
|
|
com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > GetOleRef();
|
|
|
|
svt::EmbeddedObjectRef& GetObject();
|
|
|
|
const String& GetCurrentPersistName() const { return aName; }
|
2000-09-18 11:15:01 -05:00
|
|
|
BOOL IsOleRef() const; //Damit das Objekt nicht unnoetig geladen werden muss.
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// --------------------
|
|
|
|
// SwOLENode
|
|
|
|
// --------------------
|
|
|
|
|
2009-01-05 08:06:42 -06:00
|
|
|
class SW_DLLPUBLIC SwOLENode: public SwNoTxtNode
|
2000-09-18 11:15:01 -05:00
|
|
|
{
|
|
|
|
friend class SwNodes;
|
2004-09-08 09:16:26 -05:00
|
|
|
mutable SwOLEObj aOLEObj;
|
2004-10-04 12:59:21 -05:00
|
|
|
Graphic* pGraphic;
|
2000-09-18 11:15:01 -05:00
|
|
|
String sChartTblName; // bei Chart Objecten: Name der ref. Tabelle
|
|
|
|
BOOL bOLESizeInvalid; //Soll beim SwDoc::PrtOLENotify beruecksichtig
|
|
|
|
//werden (zum Beispiel kopiert). Ist nicht
|
|
|
|
//Persistent.
|
|
|
|
|
2005-01-18 07:57:51 -06:00
|
|
|
SwEmbedObjectLink* mpObjectLink;
|
|
|
|
String maLinkURL;
|
|
|
|
|
2000-09-18 11:15:01 -05:00
|
|
|
SwOLENode( const SwNodeIndex &rWhere,
|
2004-10-04 12:59:21 -05:00
|
|
|
const svt::EmbeddedObjectRef&,
|
2000-09-18 11:15:01 -05:00
|
|
|
SwGrfFmtColl *pGrfColl,
|
|
|
|
SwAttrSet* pAutoAttr = 0 );
|
|
|
|
|
|
|
|
SwOLENode( const SwNodeIndex &rWhere,
|
|
|
|
const String &rName,
|
2006-10-13 05:08:14 -05:00
|
|
|
sal_Int64 nAspect,
|
2000-09-18 11:15:01 -05:00
|
|
|
SwGrfFmtColl *pGrfColl,
|
|
|
|
SwAttrSet* pAutoAttr = 0 );
|
|
|
|
|
|
|
|
// aOLEObj besitzt einen privaten Copy-CTOR, wir brauchen auch einen:
|
|
|
|
SwOLENode( const SwOLENode & );
|
|
|
|
|
2007-10-22 09:06:01 -05:00
|
|
|
using SwNoTxtNode::GetGraphic;
|
|
|
|
|
2000-09-18 11:15:01 -05:00
|
|
|
public:
|
|
|
|
const SwOLEObj& GetOLEObj() const { return aOLEObj; }
|
|
|
|
SwOLEObj& GetOLEObj() { return aOLEObj; }
|
2004-10-04 12:59:21 -05:00
|
|
|
~SwOLENode();
|
2000-09-18 11:15:01 -05:00
|
|
|
|
2008-02-26 03:30:36 -06:00
|
|
|
virtual SwCntntNode *SplitCntntNode( const SwPosition & );
|
2000-09-18 11:15:01 -05:00
|
|
|
// steht in ndcopy.cxx
|
|
|
|
virtual SwCntntNode* MakeCopy( SwDoc*, const SwNodeIndex& ) const;
|
|
|
|
|
|
|
|
virtual Size GetTwipSize() const;
|
2007-09-27 02:06:45 -05:00
|
|
|
|
2004-10-04 12:59:21 -05:00
|
|
|
Graphic* GetGraphic();
|
2007-09-27 02:06:45 -05:00
|
|
|
|
2006-03-24 05:54:02 -06:00
|
|
|
Graphic* GetHCGraphic(); // tries to retrieve HighContrast representation if possible
|
2004-10-04 12:59:21 -05:00
|
|
|
void GetNewReplacement();
|
2000-09-18 11:15:01 -05:00
|
|
|
|
|
|
|
virtual BOOL SavePersistentData();
|
|
|
|
virtual BOOL RestorePersistentData();
|
|
|
|
|
|
|
|
BOOL IsInGlobalDocSection() const;
|
|
|
|
BOOL IsOLEObjectDeleted() const;
|
|
|
|
|
|
|
|
BOOL IsOLESizeInvalid() const { return bOLESizeInvalid; }
|
|
|
|
void SetOLESizeInvalid( BOOL b ){ bOLESizeInvalid = b; }
|
|
|
|
|
2006-10-13 05:08:14 -05:00
|
|
|
sal_Int64 GetAspect() const { return aOLEObj.GetObject().GetViewAspect(); }
|
|
|
|
void SetAspect( sal_Int64 nAspect) { aOLEObj.GetObject().SetViewAspect( nAspect ); }
|
2004-10-04 12:59:21 -05:00
|
|
|
|
|
|
|
// OLE-Object aus dem "Speicher" entfernen
|
|
|
|
// inline void Unload() { aOLEObj.Unload(); }
|
2004-09-08 09:16:26 -05:00
|
|
|
String GetDescription() const { return aOLEObj.GetDescription(); }
|
|
|
|
|
2005-01-18 07:57:51 -06:00
|
|
|
sal_Bool UpdateLinkURL_Impl();
|
|
|
|
void BreakFileLink_Impl();
|
|
|
|
void DisconnectFileLink_Impl();
|
|
|
|
|
|
|
|
void CheckFileLink_Impl();
|
|
|
|
|
2009-03-17 05:06:02 -05:00
|
|
|
// --> OD 2009-03-05 #i99665#
|
|
|
|
bool IsChart() const;
|
|
|
|
// <--
|
|
|
|
|
2000-09-18 11:15:01 -05:00
|
|
|
#ifndef _FESHVIEW_ONLY_INLINE_NEEDED
|
|
|
|
const String& GetChartTblName() const { return sChartTblName; }
|
|
|
|
void SetChartTblName( const String& rNm ) { sChartTblName = rNm; }
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
2002-08-23 08:04:57 -05:00
|
|
|
|
2000-09-18 11:15:01 -05:00
|
|
|
// Inline Metoden aus Node.hxx - erst hier ist der TxtNode bekannt !!
|
|
|
|
inline SwOLENode *SwNode::GetOLENode()
|
|
|
|
{
|
|
|
|
return ND_OLENODE == nNodeType ? (SwOLENode*)this : 0;
|
|
|
|
}
|
|
|
|
inline const SwOLENode *SwNode::GetOLENode() const
|
|
|
|
{
|
|
|
|
return ND_OLENODE == nNodeType ? (const SwOLENode*)this : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // _NDOLE_HXX
|
|
|
|
|
2010-10-14 01:30:41 -05:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|