1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir #ifndef _SECTION_HXX 29*cdf0e10cSrcweir #define _SECTION_HXX 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir #include <boost/utility.hpp> 32*cdf0e10cSrcweir 33*cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.h> 34*cdf0e10cSrcweir 35*cdf0e10cSrcweir #include <tools/rtti.hxx> 36*cdf0e10cSrcweir #include <tools/ref.hxx> 37*cdf0e10cSrcweir #include <svl/svarray.hxx> 38*cdf0e10cSrcweir #include <sfx2/lnkbase.hxx> 39*cdf0e10cSrcweir #include <sfx2/Metadatable.hxx> 40*cdf0e10cSrcweir 41*cdf0e10cSrcweir #include <frmfmt.hxx> 42*cdf0e10cSrcweir 43*cdf0e10cSrcweir 44*cdf0e10cSrcweir namespace com { namespace sun { namespace star { 45*cdf0e10cSrcweir namespace text { class XTextSection; } 46*cdf0e10cSrcweir } } } 47*cdf0e10cSrcweir 48*cdf0e10cSrcweir // Forward Deklaration 49*cdf0e10cSrcweir class SwSectionFmt; 50*cdf0e10cSrcweir class SwDoc; 51*cdf0e10cSrcweir class SwSection; 52*cdf0e10cSrcweir class SwSectionNode; 53*cdf0e10cSrcweir class SwTOXBase; 54*cdf0e10cSrcweir 55*cdf0e10cSrcweir #ifndef SW_DECL_SWSERVEROBJECT_DEFINED 56*cdf0e10cSrcweir #define SW_DECL_SWSERVEROBJECT_DEFINED 57*cdf0e10cSrcweir SV_DECL_REF( SwServerObject ) 58*cdf0e10cSrcweir #endif 59*cdf0e10cSrcweir 60*cdf0e10cSrcweir SV_DECL_PTRARR( SwSections, SwSection*, 0, 4 ) 61*cdf0e10cSrcweir 62*cdf0e10cSrcweir enum SectionType { CONTENT_SECTION, 63*cdf0e10cSrcweir TOX_HEADER_SECTION, 64*cdf0e10cSrcweir TOX_CONTENT_SECTION, 65*cdf0e10cSrcweir DDE_LINK_SECTION = OBJECT_CLIENT_DDE, 66*cdf0e10cSrcweir FILE_LINK_SECTION = OBJECT_CLIENT_FILE 67*cdf0e10cSrcweir /* 68*cdf0e10cSrcweir // verbleiben noch: 69*cdf0e10cSrcweir OBJECT_CLIENT_SO = 0x80, 70*cdf0e10cSrcweir OBJECT_CLIENT_OLE = 0x82, 71*cdf0e10cSrcweir OBJECT_CLIENT_OLE_CACHE = 0x83, 72*cdf0e10cSrcweir */ 73*cdf0e10cSrcweir }; 74*cdf0e10cSrcweir 75*cdf0e10cSrcweir enum LinkCreateType 76*cdf0e10cSrcweir { 77*cdf0e10cSrcweir CREATE_NONE, // nichts weiter tun 78*cdf0e10cSrcweir CREATE_CONNECT, // Link gleich connecten 79*cdf0e10cSrcweir CREATE_UPDATE // Link connecten und updaten 80*cdf0e10cSrcweir }; 81*cdf0e10cSrcweir 82*cdf0e10cSrcweir class SW_DLLPUBLIC SwSectionData 83*cdf0e10cSrcweir { 84*cdf0e10cSrcweir private: 85*cdf0e10cSrcweir SectionType m_eType; 86*cdf0e10cSrcweir 87*cdf0e10cSrcweir String m_sSectionName; 88*cdf0e10cSrcweir String m_sCondition; 89*cdf0e10cSrcweir String m_sLinkFileName; 90*cdf0e10cSrcweir String m_sLinkFilePassword; // JP 27.02.2001: must be changed to Sequence 91*cdf0e10cSrcweir ::com::sun::star::uno::Sequence <sal_Int8> m_Password; 92*cdf0e10cSrcweir 93*cdf0e10cSrcweir /// it seems this flag caches the current final "hidden" state 94*cdf0e10cSrcweir bool m_bHiddenFlag : 1; 95*cdf0e10cSrcweir /// flags that correspond to attributes in the format: 96*cdf0e10cSrcweir /// may have different value than format attribute: 97*cdf0e10cSrcweir /// format attr has value for this section, while flag is 98*cdf0e10cSrcweir /// effectively ORed with parent sections! 99*cdf0e10cSrcweir bool m_bProtectFlag : 1; 100*cdf0e10cSrcweir // --> FME 2004-06-22 #114856# edit in readonly sections 101*cdf0e10cSrcweir bool m_bEditInReadonlyFlag : 1; 102*cdf0e10cSrcweir // <-- 103*cdf0e10cSrcweir bool m_bHidden : 1; // all paragraphs hidden? 104*cdf0e10cSrcweir bool m_bCondHiddenFlag : 1; // Hiddenflag for condition 105*cdf0e10cSrcweir bool m_bConnectFlag : 1; // connected to server? 106*cdf0e10cSrcweir 107*cdf0e10cSrcweir public: 108*cdf0e10cSrcweir 109*cdf0e10cSrcweir SwSectionData(SectionType const eType, String const& rName); 110*cdf0e10cSrcweir explicit SwSectionData(SwSection const&); 111*cdf0e10cSrcweir SwSectionData(SwSectionData const&); 112*cdf0e10cSrcweir SwSectionData & operator=(SwSectionData const&); 113*cdf0e10cSrcweir bool operator==(SwSectionData const&) const; 114*cdf0e10cSrcweir 115*cdf0e10cSrcweir String const& GetSectionName() const { return m_sSectionName; } 116*cdf0e10cSrcweir void SetSectionName(String const& rName){ m_sSectionName = rName; } 117*cdf0e10cSrcweir SectionType GetType() const { return m_eType; } 118*cdf0e10cSrcweir void SetType(SectionType const eNew) { m_eType = eNew; } 119*cdf0e10cSrcweir 120*cdf0e10cSrcweir bool IsHidden() const { return m_bHidden; } 121*cdf0e10cSrcweir void SetHidden(bool const bFlag = true) { m_bHidden = bFlag; } 122*cdf0e10cSrcweir 123*cdf0e10cSrcweir bool IsHiddenFlag() const { return m_bHiddenFlag; } 124*cdf0e10cSrcweir SW_DLLPRIVATE void 125*cdf0e10cSrcweir SetHiddenFlag(bool const bFlag) { m_bHiddenFlag = bFlag; } 126*cdf0e10cSrcweir bool IsProtectFlag() const { return m_bProtectFlag; } 127*cdf0e10cSrcweir SW_DLLPRIVATE void 128*cdf0e10cSrcweir SetProtectFlag(bool const bFlag) { m_bProtectFlag = bFlag; } 129*cdf0e10cSrcweir // --> FME 2004-06-22 #114856# edit in readonly sections 130*cdf0e10cSrcweir bool IsEditInReadonlyFlag() const { return m_bEditInReadonlyFlag; } 131*cdf0e10cSrcweir void SetEditInReadonlyFlag(bool const bFlag) 132*cdf0e10cSrcweir { m_bEditInReadonlyFlag = bFlag; } 133*cdf0e10cSrcweir // <-- 134*cdf0e10cSrcweir 135*cdf0e10cSrcweir void SetCondHidden(bool const bFlag = true) { m_bCondHiddenFlag = bFlag; }; 136*cdf0e10cSrcweir bool IsCondHidden() const { return m_bCondHiddenFlag; } 137*cdf0e10cSrcweir 138*cdf0e10cSrcweir String const& GetCondition() const { return m_sCondition; } 139*cdf0e10cSrcweir void SetCondition(String const& rNew) { m_sCondition = rNew; } 140*cdf0e10cSrcweir 141*cdf0e10cSrcweir String const& GetLinkFileName() const { return m_sLinkFileName; }; 142*cdf0e10cSrcweir void SetLinkFileName(String const& rNew, String const* pPassWd = 0) 143*cdf0e10cSrcweir { 144*cdf0e10cSrcweir m_sLinkFileName = rNew; 145*cdf0e10cSrcweir if (pPassWd) { SetLinkFilePassword(*pPassWd); } 146*cdf0e10cSrcweir } 147*cdf0e10cSrcweir 148*cdf0e10cSrcweir String const& GetLinkFilePassword() const { return m_sLinkFilePassword; } 149*cdf0e10cSrcweir void SetLinkFilePassword(String const& rS) { m_sLinkFilePassword = rS; } 150*cdf0e10cSrcweir 151*cdf0e10cSrcweir ::com::sun::star::uno::Sequence<sal_Int8> const& GetPassword() const 152*cdf0e10cSrcweir { return m_Password; } 153*cdf0e10cSrcweir void SetPassword(::com::sun::star::uno::Sequence<sal_Int8> const& rNew) 154*cdf0e10cSrcweir { m_Password = rNew; } 155*cdf0e10cSrcweir bool IsLinkType() const 156*cdf0e10cSrcweir { return (DDE_LINK_SECTION == m_eType) || (FILE_LINK_SECTION == m_eType); } 157*cdf0e10cSrcweir 158*cdf0e10cSrcweir bool IsConnectFlag() const { return m_bConnectFlag; } 159*cdf0e10cSrcweir void SetConnectFlag(bool const bFlag = true){ m_bConnectFlag = bFlag; } 160*cdf0e10cSrcweir }; 161*cdf0e10cSrcweir 162*cdf0e10cSrcweir class SW_DLLPUBLIC SwSection 163*cdf0e10cSrcweir : public SwClient 164*cdf0e10cSrcweir { 165*cdf0e10cSrcweir // damit beim Anlegen/Loeschen von Frames das Flag richtig gepflegt wird! 166*cdf0e10cSrcweir friend class SwSectionNode; 167*cdf0e10cSrcweir // the "read CTOR" of SwSectionFrm have to change the Hiddenflag 168*cdf0e10cSrcweir friend class SwSectionFrm; 169*cdf0e10cSrcweir 170*cdf0e10cSrcweir private: 171*cdf0e10cSrcweir SwSectionData m_Data; 172*cdf0e10cSrcweir 173*cdf0e10cSrcweir SwServerObjectRef m_RefObj; // set if DataServer 174*cdf0e10cSrcweir ::sfx2::SvBaseLinkRef m_RefLink; 175*cdf0e10cSrcweir 176*cdf0e10cSrcweir SW_DLLPRIVATE void ImplSetHiddenFlag( 177*cdf0e10cSrcweir bool const bHidden, bool const bCondition); 178*cdf0e10cSrcweir 179*cdf0e10cSrcweir protected: 180*cdf0e10cSrcweir virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ); 181*cdf0e10cSrcweir 182*cdf0e10cSrcweir public: 183*cdf0e10cSrcweir TYPEINFO(); // rtti 184*cdf0e10cSrcweir 185*cdf0e10cSrcweir SwSection(SectionType const eType, String const& rName, 186*cdf0e10cSrcweir SwSectionFmt & rFormat); 187*cdf0e10cSrcweir virtual ~SwSection(); 188*cdf0e10cSrcweir 189*cdf0e10cSrcweir bool DataEquals(SwSectionData const& rCmp) const; 190*cdf0e10cSrcweir 191*cdf0e10cSrcweir void SetSectionData(SwSectionData const& rData); 192*cdf0e10cSrcweir 193*cdf0e10cSrcweir String const& GetSectionName() const { return m_Data.GetSectionName(); } 194*cdf0e10cSrcweir void SetSectionName(String const& rName){ m_Data.SetSectionName(rName); } 195*cdf0e10cSrcweir SectionType GetType() const { return m_Data.GetType(); } 196*cdf0e10cSrcweir void SetType(SectionType const eType) { return m_Data.SetType(eType); } 197*cdf0e10cSrcweir 198*cdf0e10cSrcweir SwSectionFmt* GetFmt() { return (SwSectionFmt*)GetRegisteredIn(); } 199*cdf0e10cSrcweir SwSectionFmt* GetFmt() const { return (SwSectionFmt*)GetRegisteredIn(); } 200*cdf0e10cSrcweir 201*cdf0e10cSrcweir // setze die Hidden/Protected -> gesamten Baum updaten ! 202*cdf0e10cSrcweir // (Attribute/Flags werden gesetzt/erfragt) 203*cdf0e10cSrcweir bool IsHidden() const { return m_Data.IsHidden(); } 204*cdf0e10cSrcweir void SetHidden (bool const bFlag = true); 205*cdf0e10cSrcweir bool IsProtect() const; 206*cdf0e10cSrcweir void SetProtect(bool const bFlag = true); 207*cdf0e10cSrcweir // --> FME 2004-06-22 #114856# edit in readonly sections 208*cdf0e10cSrcweir bool IsEditInReadonly() const; 209*cdf0e10cSrcweir void SetEditInReadonly(bool const bFlag = true); 210*cdf0e10cSrcweir // <-- 211*cdf0e10cSrcweir 212*cdf0e10cSrcweir // erfrage die internen Flags (Zustand inklusive Parents nicht, was 213*cdf0e10cSrcweir // aktuell an der Section gesetzt ist!!) 214*cdf0e10cSrcweir bool IsHiddenFlag() const { return m_Data.IsHiddenFlag(); } 215*cdf0e10cSrcweir bool IsProtectFlag() const { return m_Data.IsProtectFlag(); } 216*cdf0e10cSrcweir // --> FME 2004-06-22 #114856# edit in readonly sections 217*cdf0e10cSrcweir bool IsEditInReadonlyFlag() const { return m_Data.IsEditInReadonlyFlag(); } 218*cdf0e10cSrcweir // <-- 219*cdf0e10cSrcweir 220*cdf0e10cSrcweir void SetCondHidden(bool const bFlag = true); 221*cdf0e10cSrcweir bool IsCondHidden() const { return m_Data.IsCondHidden(); } 222*cdf0e10cSrcweir // erfrage (auch ueber die Parents), ob diese Section versteckt sein soll. 223*cdf0e10cSrcweir sal_Bool CalcHiddenFlag() const; 224*cdf0e10cSrcweir 225*cdf0e10cSrcweir 226*cdf0e10cSrcweir inline SwSection* GetParent() const; 227*cdf0e10cSrcweir 228*cdf0e10cSrcweir String const& GetCondition() const { return m_Data.GetCondition(); } 229*cdf0e10cSrcweir void SetCondition(String const& rNew) { m_Data.SetCondition(rNew); } 230*cdf0e10cSrcweir 231*cdf0e10cSrcweir const String& GetLinkFileName() const; 232*cdf0e10cSrcweir void SetLinkFileName(String const& rNew, String const*const pPassWd = 0); 233*cdf0e10cSrcweir // password of linked file (only valid during runtime!) 234*cdf0e10cSrcweir String const& GetLinkFilePassword() const 235*cdf0e10cSrcweir { return m_Data.GetLinkFilePassword(); } 236*cdf0e10cSrcweir void SetLinkFilePassword(String const& rS) 237*cdf0e10cSrcweir { m_Data.SetLinkFilePassword(rS); } 238*cdf0e10cSrcweir 239*cdf0e10cSrcweir // get / set password of this section 240*cdf0e10cSrcweir ::com::sun::star::uno::Sequence<sal_Int8> const& GetPassword() const 241*cdf0e10cSrcweir { return m_Data.GetPassword(); } 242*cdf0e10cSrcweir void SetPassword(::com::sun::star::uno::Sequence <sal_Int8> const& rNew) 243*cdf0e10cSrcweir { m_Data.SetPassword(rNew); } 244*cdf0e10cSrcweir 245*cdf0e10cSrcweir // Daten Server-Methoden 246*cdf0e10cSrcweir void SetRefObject( SwServerObject* pObj ); 247*cdf0e10cSrcweir const SwServerObject* GetObject() const { return & m_RefObj; } 248*cdf0e10cSrcweir SwServerObject* GetObject() { return & m_RefObj; } 249*cdf0e10cSrcweir bool IsServer() const { return m_RefObj.Is(); } 250*cdf0e10cSrcweir 251*cdf0e10cSrcweir // Methoden fuer gelinkte Bereiche 252*cdf0e10cSrcweir sal_uInt16 GetUpdateType() const { return m_RefLink->GetUpdateMode(); } 253*cdf0e10cSrcweir void SetUpdateType(sal_uInt16 const nType ) 254*cdf0e10cSrcweir { m_RefLink->SetUpdateMode(nType); } 255*cdf0e10cSrcweir 256*cdf0e10cSrcweir bool IsConnected() const { return m_RefLink.Is(); } 257*cdf0e10cSrcweir void UpdateNow() { m_RefLink->Update(); } 258*cdf0e10cSrcweir void Disconnect() { m_RefLink->Disconnect(); } 259*cdf0e10cSrcweir 260*cdf0e10cSrcweir const ::sfx2::SvBaseLink& GetBaseLink() const { return *m_RefLink; } 261*cdf0e10cSrcweir ::sfx2::SvBaseLink& GetBaseLink() { return *m_RefLink; } 262*cdf0e10cSrcweir 263*cdf0e10cSrcweir void CreateLink( LinkCreateType eType ); 264*cdf0e10cSrcweir 265*cdf0e10cSrcweir void MakeChildLinksVisible( const SwSectionNode& rSectNd ); 266*cdf0e10cSrcweir 267*cdf0e10cSrcweir bool IsLinkType() const { return m_Data.IsLinkType(); } 268*cdf0e10cSrcweir 269*cdf0e10cSrcweir // Flags fuer UI - Verbindung geklappt? 270*cdf0e10cSrcweir bool IsConnectFlag() const { return m_Data.IsConnectFlag(); } 271*cdf0e10cSrcweir void SetConnectFlag(bool const bFlag = true) 272*cdf0e10cSrcweir { m_Data.SetConnectFlag(bFlag); } 273*cdf0e10cSrcweir 274*cdf0e10cSrcweir // return the TOX base class if the section is a TOX section 275*cdf0e10cSrcweir const SwTOXBase* GetTOXBase() const; 276*cdf0e10cSrcweir 277*cdf0e10cSrcweir // --> OD 2007-02-14 #b6521322# 278*cdf0e10cSrcweir void BreakLink(); 279*cdf0e10cSrcweir // <-- 280*cdf0e10cSrcweir 281*cdf0e10cSrcweir }; 282*cdf0e10cSrcweir 283*cdf0e10cSrcweir 284*cdf0e10cSrcweir enum SectionSort { SORTSECT_NOT, SORTSECT_NAME, SORTSECT_POS }; 285*cdf0e10cSrcweir 286*cdf0e10cSrcweir class SW_DLLPUBLIC SwSectionFmt 287*cdf0e10cSrcweir : public SwFrmFmt 288*cdf0e10cSrcweir , public ::sfx2::Metadatable 289*cdf0e10cSrcweir { 290*cdf0e10cSrcweir friend class SwDoc; 291*cdf0e10cSrcweir 292*cdf0e10cSrcweir /** why does this exist in addition to the m_wXObject in SwFrmFmt? 293*cdf0e10cSrcweir in case of an index, both a SwXDocumentIndex and a SwXTextSection 294*cdf0e10cSrcweir register at this SwSectionFmt, so we need to have two refs. 295*cdf0e10cSrcweir */ 296*cdf0e10cSrcweir ::com::sun::star::uno::WeakReference< 297*cdf0e10cSrcweir ::com::sun::star::text::XTextSection> m_wXTextSection; 298*cdf0e10cSrcweir 299*cdf0e10cSrcweir SW_DLLPRIVATE void UpdateParent(); // Parent wurde veraendert 300*cdf0e10cSrcweir 301*cdf0e10cSrcweir protected: 302*cdf0e10cSrcweir SwSectionFmt( SwSectionFmt* pDrvdFrm, SwDoc *pDoc ); 303*cdf0e10cSrcweir virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ); 304*cdf0e10cSrcweir 305*cdf0e10cSrcweir public: 306*cdf0e10cSrcweir TYPEINFO(); //Bereits in Basisklasse Client drin. 307*cdf0e10cSrcweir ~SwSectionFmt(); 308*cdf0e10cSrcweir 309*cdf0e10cSrcweir //Vernichtet alle Frms in aDepend (Frms werden per PTR_CAST erkannt). 310*cdf0e10cSrcweir virtual void DelFrms(); 311*cdf0e10cSrcweir 312*cdf0e10cSrcweir //Erzeugt die Ansichten 313*cdf0e10cSrcweir virtual void MakeFrms(); 314*cdf0e10cSrcweir 315*cdf0e10cSrcweir // erfrage vom Format Informationen 316*cdf0e10cSrcweir virtual sal_Bool GetInfo( SfxPoolItem& ) const; 317*cdf0e10cSrcweir 318*cdf0e10cSrcweir SwSection* GetSection() const; 319*cdf0e10cSrcweir inline SwSectionFmt* GetParent() const; 320*cdf0e10cSrcweir inline SwSection* GetParentSection() const; 321*cdf0e10cSrcweir 322*cdf0e10cSrcweir // alle Sections, die von dieser abgeleitet sind 323*cdf0e10cSrcweir // - sortiert nach : Name oder Position oder unsortiert 324*cdf0e10cSrcweir // - alle oder nur die, die sich im normalten Nodes-Array befinden 325*cdf0e10cSrcweir sal_uInt16 GetChildSections( SwSections& rArr, 326*cdf0e10cSrcweir SectionSort eSort = SORTSECT_NOT, 327*cdf0e10cSrcweir sal_Bool bAllSections = sal_True ) const; 328*cdf0e10cSrcweir 329*cdf0e10cSrcweir // erfrage, ob sich die Section im Nodes-Array oder UndoNodes-Array 330*cdf0e10cSrcweir // befindet. 331*cdf0e10cSrcweir sal_Bool IsInNodesArr() const; 332*cdf0e10cSrcweir 333*cdf0e10cSrcweir SwSectionNode* GetSectionNode(bool const bEvenIfInUndo = false); 334*cdf0e10cSrcweir const SwSectionNode* GetSectionNode(bool const bEvenIfInUndo = false) const 335*cdf0e10cSrcweir { return const_cast<SwSectionFmt *>(this) 336*cdf0e10cSrcweir ->GetSectionNode(bEvenIfInUndo); } 337*cdf0e10cSrcweir 338*cdf0e10cSrcweir // ist die Section eine gueltige fuers GlobalDocument? 339*cdf0e10cSrcweir const SwSection* GetGlobalDocSection() const; 340*cdf0e10cSrcweir 341*cdf0e10cSrcweir SW_DLLPRIVATE ::com::sun::star::uno::WeakReference< 342*cdf0e10cSrcweir ::com::sun::star::text::XTextSection> const& GetXTextSection() const 343*cdf0e10cSrcweir { return m_wXTextSection; } 344*cdf0e10cSrcweir SW_DLLPRIVATE void SetXTextSection(::com::sun::star::uno::Reference< 345*cdf0e10cSrcweir ::com::sun::star::text::XTextSection> const& xTextSection) 346*cdf0e10cSrcweir { m_wXTextSection = xTextSection; } 347*cdf0e10cSrcweir 348*cdf0e10cSrcweir // sfx2::Metadatable 349*cdf0e10cSrcweir virtual ::sfx2::IXmlIdRegistry& GetRegistry(); 350*cdf0e10cSrcweir virtual bool IsInClipboard() const; 351*cdf0e10cSrcweir virtual bool IsInUndo() const; 352*cdf0e10cSrcweir virtual bool IsInContent() const; 353*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 354*cdf0e10cSrcweir ::com::sun::star::rdf::XMetadatable > MakeUnoObject(); 355*cdf0e10cSrcweir 356*cdf0e10cSrcweir }; 357*cdf0e10cSrcweir 358*cdf0e10cSrcweir // -------------- inlines --------------------------------- 359*cdf0e10cSrcweir 360*cdf0e10cSrcweir inline SwSection* SwSection::GetParent() const 361*cdf0e10cSrcweir { 362*cdf0e10cSrcweir SwSectionFmt* pFmt = GetFmt(); 363*cdf0e10cSrcweir SwSection* pRet = 0; 364*cdf0e10cSrcweir if( pFmt ) 365*cdf0e10cSrcweir pRet = pFmt->GetParentSection(); 366*cdf0e10cSrcweir return pRet; 367*cdf0e10cSrcweir } 368*cdf0e10cSrcweir 369*cdf0e10cSrcweir inline SwSectionFmt* SwSectionFmt::GetParent() const 370*cdf0e10cSrcweir { 371*cdf0e10cSrcweir SwSectionFmt* pRet = 0; 372*cdf0e10cSrcweir if( GetRegisteredIn() ) 373*cdf0e10cSrcweir pRet = PTR_CAST( SwSectionFmt, GetRegisteredIn() ); 374*cdf0e10cSrcweir return pRet; 375*cdf0e10cSrcweir } 376*cdf0e10cSrcweir 377*cdf0e10cSrcweir inline SwSection* SwSectionFmt::GetParentSection() const 378*cdf0e10cSrcweir { 379*cdf0e10cSrcweir SwSectionFmt* pParent = GetParent(); 380*cdf0e10cSrcweir SwSection* pRet = 0; 381*cdf0e10cSrcweir if( pParent ) 382*cdf0e10cSrcweir { 383*cdf0e10cSrcweir pRet = pParent->GetSection(); 384*cdf0e10cSrcweir } 385*cdf0e10cSrcweir return pRet; 386*cdf0e10cSrcweir } 387*cdf0e10cSrcweir 388*cdf0e10cSrcweir 389*cdf0e10cSrcweir #endif /* _SECTION_HXX */ 390