Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_sw / ndole.hxx
blob5b2401c3e6727ae5fe085fa157dec9a29f96b9aa
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ndole.hxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _NDOLE_HXX
31 #define _NDOLE_HXX
33 #ifndef _NDNOTXT_HXX
34 #include <ndnotxt.hxx>
35 #endif
37 namespace binfilter {
39 class SvInPlaceObjectRef;
40 class SvInPlaceObject;
42 class SwGrfFmtColl;
43 class SwDoc;
44 class SwOLENode;
45 class SwOLELink;
46 class SwOLELRUCache;
49 class SwOLEObj
51 friend class SwOLENode;
53 static SwOLELRUCache* pOLELRU_Cache;
55 const SwOLENode* pOLENd;
57 //Entweder Ref oder Name sind bekannt, wenn nur der Name bekannt ist, wird
58 //dir Ref bei Anforderung durch GetOleRef() vom Sfx besorgt.
59 SvInPlaceObjectRef *pOLERef; //new/delete, damit so2.hxx wegfaellt.
60 String aName;
62 SwOLEObj( const SwOLEObj& rObj ); //nicht erlaubt.
63 SwOLEObj();
65 void SetNode( SwOLENode* pNode );
67 public:
68 SwOLEObj( SvInPlaceObject *pObj );
69 SwOLEObj( const String &rName );
70 ~SwOLEObj();
72 BOOL RemovedFromLRU();
74 #ifndef _FESHVIEW_ONLY_INLINE_NEEDED
75 SvInPlaceObjectRef GetOleRef();
76 const String &GetName() const { return aName; }
78 BOOL IsOleRef() const; //Damit das Objekt nicht unnoetig geladen werden muss.
79 #endif
83 // --------------------
84 // SwOLENode
85 // --------------------
87 struct SwPersistentOleData;
89 class SwOLENode: public SwNoTxtNode
91 friend class SwNodes;
92 SwOLEObj aOLEObj;
93 SwPersistentOleData* pSavedData;
94 String sChartTblName; // bei Chart Objecten: Name der ref. Tabelle
95 BOOL bOLESizeInvalid; //Soll beim SwDoc::PrtOLENotify beruecksichtig
96 //werden (zum Beispiel kopiert). Ist nicht
97 //Persistent.
99 SwOLENode( const SwNodeIndex &rWhere,
100 SvInPlaceObject *,
101 SwGrfFmtColl *pGrfColl,
102 SwAttrSet* pAutoAttr = 0 );
104 SwOLENode( const SwNodeIndex &rWhere,
105 const String &rName,
106 SwGrfFmtColl *pGrfColl,
107 SwAttrSet* pAutoAttr = 0 );
109 // aOLEObj besitzt einen privaten Copy-CTOR, wir brauchen auch einen:
110 SwOLENode( const SwOLENode & );
112 public:
113 const SwOLEObj& GetOLEObj() const { return aOLEObj; }
114 SwOLEObj& GetOLEObj() { return aOLEObj; }
116 virtual SwCntntNode *SplitNode( const SwPosition & );
117 // steht in ndcopy.cxx
118 virtual SwCntntNode* MakeCopy( SwDoc*, const SwNodeIndex& ) const;
120 virtual Size GetTwipSize() const;
123 BOOL IsInGlobalDocSection() const;
124 BOOL IsOLEObjectDeleted() const;
126 BOOL IsOLESizeInvalid() const { return bOLESizeInvalid; }
127 void SetOLESizeInvalid( BOOL b ){ bOLESizeInvalid = b; }
129 #ifndef _FESHVIEW_ONLY_INLINE_NEEDED
130 const String& GetChartTblName() const { return sChartTblName; }
131 void SetChartTblName( const String& rNm ) { sChartTblName = rNm; }
132 #endif
136 // Inline Metoden aus Node.hxx - erst hier ist der TxtNode bekannt !!
137 #if !(defined(MACOSX) && ( __GNUC__ < 3 ))
138 // GrP moved to gcc_outl.cxx; revisit with gcc3
139 inline SwOLENode *SwNode::GetOLENode()
141 return ND_OLENODE == nNodeType ? (SwOLENode*)this : 0;
143 inline const SwOLENode *SwNode::GetOLENode() const
145 return ND_OLENODE == nNodeType ? (const SwOLENode*)this : 0;
147 #endif
149 } //namespace binfilter
150 #endif // _NDOLE_HXX