xref: /aoo4110/main/sw/inc/swbaslnk.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _SWBASLNK_HXX
24 #define _SWBASLNK_HXX
25 
26 #include <sfx2/lnkbase.hxx>
27 
28 class SwNode;
29 class SwCntntNode;
30 class ReReadThread;
31 long GrfNodeChanged( void* pLink, void* pCaller );
32 
33 class SwBaseLink : public ::sfx2::SvBaseLink
34 {
35     friend long GrfNodeChanged( void* pLink, void* pCaller );
36 
37 	SwCntntNode* pCntntNode;
38 	sal_Bool bSwapIn : 1;
39 	sal_Bool bNoDataFlag : 1;
40 	sal_Bool bIgnoreDataChanged : 1;
41     ReReadThread* m_pReReadThread;
42 
43 protected:
SwBaseLink()44 	SwBaseLink(): m_pReReadThread(0) {}
45 
SwBaseLink(const String & rNm,sal_uInt16 nObjectType,::sfx2::SvLinkSource * pObj,SwCntntNode * pNode=0)46     SwBaseLink( const String& rNm, sal_uInt16 nObjectType, ::sfx2::SvLinkSource* pObj,
47 				 SwCntntNode* pNode = 0 )
48         : ::sfx2::SvBaseLink( rNm, nObjectType, pObj ), pCntntNode( pNode ),
49 		bSwapIn( sal_False ), bNoDataFlag( sal_False ), bIgnoreDataChanged( sal_False ),
50         m_pReReadThread(0)
51 	{}
52 
53 public:
54 	TYPEINFO();
55 
SwBaseLink(sal_uInt16 nMode,sal_uInt16 nFormat,SwCntntNode * pNode=0)56 	SwBaseLink( sal_uInt16 nMode, sal_uInt16 nFormat, SwCntntNode* pNode = 0 )
57         : ::sfx2::SvBaseLink( nMode, nFormat ), pCntntNode( pNode ),
58 		bSwapIn( sal_False ), bNoDataFlag( sal_False ), bIgnoreDataChanged( sal_False ),
59         m_pReReadThread(0)
60 	{}
61 	virtual ~SwBaseLink();
62 
63 	virtual void DataChanged( const String& rMimeType,
64 								const ::com::sun::star::uno::Any & rValue );
65 
66 	virtual void Closed();
67 
68 	virtual const SwNode* GetAnchor() const;
69 
GetCntntNode()70 	SwCntntNode *GetCntntNode() { return pCntntNode; }
71 
72 	// nur fuer Grafiken
73 	sal_Bool SwapIn( sal_Bool bWaitForData = sal_False, sal_Bool bNativFormat = sal_False );
74 
Connect()75 	sal_Bool Connect() { return 0 != SvBaseLink::GetRealObject(); }
76 
77 	// nur fuer Grafik-Links ( zum Umschalten zwischen DDE / Grf-Link)
SetObjType(sal_uInt16 nType)78 	void SetObjType( sal_uInt16 nType )	{ SvBaseLink::SetObjType( nType ); }
79 
80 	sal_Bool IsRecursion( const SwBaseLink* pChkLnk ) const;
81 	virtual sal_Bool IsInRange( sal_uLong nSttNd, sal_uLong nEndNd, xub_StrLen nStt = 0,
82 							xub_StrLen nEnd = STRING_NOTFOUND ) const;
83 
SetNoDataFlag()84 	void SetNoDataFlag()	{ bNoDataFlag = sal_True; }
ChkNoDataFlag()85 	sal_Bool ChkNoDataFlag()	{ sal_Bool bRet = bNoDataFlag; bNoDataFlag = sal_False; return bRet; }
IsNoDataFlag() const86 	sal_Bool IsNoDataFlag()	const			{ return bNoDataFlag; }
87 };
88 
89 
90 #endif
91 
92