1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _SWBASLNK_HXX 28 #define _SWBASLNK_HXX 29 30 #include <sfx2/lnkbase.hxx> 31 32 class SwNode; 33 class SwCntntNode; 34 class ReReadThread; 35 long GrfNodeChanged( void* pLink, void* pCaller ); 36 37 class SwBaseLink : public ::sfx2::SvBaseLink 38 { 39 friend long GrfNodeChanged( void* pLink, void* pCaller ); 40 41 SwCntntNode* pCntntNode; 42 sal_Bool bSwapIn : 1; 43 sal_Bool bNoDataFlag : 1; 44 sal_Bool bIgnoreDataChanged : 1; 45 ReReadThread* m_pReReadThread; 46 47 protected: 48 SwBaseLink(): m_pReReadThread(0) {} 49 50 SwBaseLink( const String& rNm, sal_uInt16 nObjectType, ::sfx2::SvLinkSource* pObj, 51 SwCntntNode* pNode = 0 ) 52 : ::sfx2::SvBaseLink( rNm, nObjectType, pObj ), pCntntNode( pNode ), 53 bSwapIn( sal_False ), bNoDataFlag( sal_False ), bIgnoreDataChanged( sal_False ), 54 m_pReReadThread(0) 55 {} 56 57 public: 58 TYPEINFO(); 59 60 SwBaseLink( sal_uInt16 nMode, sal_uInt16 nFormat, SwCntntNode* pNode = 0 ) 61 : ::sfx2::SvBaseLink( nMode, nFormat ), pCntntNode( pNode ), 62 bSwapIn( sal_False ), bNoDataFlag( sal_False ), bIgnoreDataChanged( sal_False ), 63 m_pReReadThread(0) 64 {} 65 virtual ~SwBaseLink(); 66 67 virtual void DataChanged( const String& rMimeType, 68 const ::com::sun::star::uno::Any & rValue ); 69 70 virtual void Closed(); 71 72 virtual const SwNode* GetAnchor() const; 73 74 SwCntntNode *GetCntntNode() { return pCntntNode; } 75 76 // nur fuer Grafiken 77 sal_Bool SwapIn( sal_Bool bWaitForData = sal_False, sal_Bool bNativFormat = sal_False ); 78 79 sal_Bool Connect() { return 0 != SvBaseLink::GetRealObject(); } 80 81 // nur fuer Grafik-Links ( zum Umschalten zwischen DDE / Grf-Link) 82 void SetObjType( sal_uInt16 nType ) { SvBaseLink::SetObjType( nType ); } 83 84 sal_Bool IsRecursion( const SwBaseLink* pChkLnk ) const; 85 virtual sal_Bool IsInRange( sal_uLong nSttNd, sal_uLong nEndNd, xub_StrLen nStt = 0, 86 xub_StrLen nEnd = STRING_NOTFOUND ) const; 87 88 void SetNoDataFlag() { bNoDataFlag = sal_True; } 89 sal_Bool ChkNoDataFlag() { sal_Bool bRet = bNoDataFlag; bNoDataFlag = sal_False; return bRet; } 90 sal_Bool IsNoDataFlag() const { return bNoDataFlag; } 91 }; 92 93 94 #endif 95 96