Update ooo320-m1
[ooovba.git] / sw / inc / swbaslnk.hxx
blobaf0c2eb115dc8ea86d82c7768d1453d1ca08fdbc
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: swbaslnk.hxx,v $
10 * $Revision: 1.9 $
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 _SWBASLNK_HXX
31 #define _SWBASLNK_HXX
33 #include <sfx2/lnkbase.hxx>
35 class SwNode;
36 class SwCntntNode;
37 class ReReadThread;
38 long GrfNodeChanged( void* pLink, void* pCaller );
40 class SwBaseLink : public ::sfx2::SvBaseLink
42 friend long GrfNodeChanged( void* pLink, void* pCaller );
44 SwCntntNode* pCntntNode;
45 BOOL bSwapIn : 1;
46 BOOL bNoDataFlag : 1;
47 BOOL bIgnoreDataChanged : 1;
48 ReReadThread* m_pReReadThread;
50 protected:
51 SwBaseLink(): m_pReReadThread(0) {}
53 SwBaseLink( const String& rNm, USHORT nObjectType, ::sfx2::SvLinkSource* pObj,
54 SwCntntNode* pNode = 0 )
55 : ::sfx2::SvBaseLink( rNm, nObjectType, pObj ), pCntntNode( pNode ),
56 bSwapIn( FALSE ), bNoDataFlag( FALSE ), bIgnoreDataChanged( FALSE ),
57 m_pReReadThread(0)
60 public:
61 TYPEINFO();
63 SwBaseLink( USHORT nMode, USHORT nFormat, SwCntntNode* pNode = 0 )
64 : ::sfx2::SvBaseLink( nMode, nFormat ), pCntntNode( pNode ),
65 bSwapIn( FALSE ), bNoDataFlag( FALSE ), bIgnoreDataChanged( FALSE ),
66 m_pReReadThread(0)
68 virtual ~SwBaseLink();
70 virtual void DataChanged( const String& rMimeType,
71 const ::com::sun::star::uno::Any & rValue );
73 virtual void Closed();
75 virtual const SwNode* GetAnchor() const;
77 SwCntntNode *GetCntntNode() { return pCntntNode; }
79 // nur fuer Grafiken
80 BOOL SwapIn( BOOL bWaitForData = FALSE, BOOL bNativFormat = FALSE );
82 BOOL Connect() { return 0 != SvBaseLink::GetRealObject(); }
84 // nur fuer Grafik-Links ( zum Umschalten zwischen DDE / Grf-Link)
85 void SetObjType( USHORT nType ) { SvBaseLink::SetObjType( nType ); }
87 BOOL IsRecursion( const SwBaseLink* pChkLnk ) const;
88 virtual BOOL IsInRange( ULONG nSttNd, ULONG nEndNd, xub_StrLen nStt = 0,
89 xub_StrLen nEnd = STRING_NOTFOUND ) const;
91 void SetNoDataFlag() { bNoDataFlag = TRUE; }
92 BOOL ChkNoDataFlag() { BOOL bRet = bNoDataFlag; bNoDataFlag = FALSE; return bRet; }
93 BOOL IsNoDataFlag() const { return bNoDataFlag; }
97 #endif