xref: /aoo41x/main/sc/inc/arealink.hxx (revision 38d50f7b)
1*38d50f7bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*38d50f7bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*38d50f7bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*38d50f7bSAndrew Rist  * distributed with this work for additional information
6*38d50f7bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*38d50f7bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*38d50f7bSAndrew Rist  * "License"); you may not use this file except in compliance
9*38d50f7bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*38d50f7bSAndrew Rist  *
11*38d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*38d50f7bSAndrew Rist  *
13*38d50f7bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*38d50f7bSAndrew Rist  * software distributed under the License is distributed on an
15*38d50f7bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*38d50f7bSAndrew Rist  * KIND, either express or implied.  See the License for the
17*38d50f7bSAndrew Rist  * specific language governing permissions and limitations
18*38d50f7bSAndrew Rist  * under the License.
19*38d50f7bSAndrew Rist  *
20*38d50f7bSAndrew Rist  *************************************************************/
21*38d50f7bSAndrew Rist 
22*38d50f7bSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SC_AREALINK_HXX
25cdf0e10cSrcweir #define SC_AREALINK_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "global.hxx"
28cdf0e10cSrcweir #include "refreshtimer.hxx"
29cdf0e10cSrcweir #include "address.hxx"
30cdf0e10cSrcweir #include <sfx2/lnkbase.hxx>
31cdf0e10cSrcweir #include "scdllapi.h"
32cdf0e10cSrcweir 
33cdf0e10cSrcweir class ScDocShell;
34cdf0e10cSrcweir class SfxObjectShell;
35cdf0e10cSrcweir class AbstractScLinkedAreaDlg;
36cdf0e10cSrcweir struct AreaLink_Impl;
37cdf0e10cSrcweir 
38cdf0e10cSrcweir class SC_DLLPUBLIC ScAreaLink : public ::sfx2::SvBaseLink, public ScRefreshTimer
39cdf0e10cSrcweir {
40cdf0e10cSrcweir private:
41cdf0e10cSrcweir     AreaLink_Impl*  pImpl;
42cdf0e10cSrcweir     String          aFileName;
43cdf0e10cSrcweir     String          aFilterName;
44cdf0e10cSrcweir     String          aOptions;
45cdf0e10cSrcweir     String          aSourceArea;
46cdf0e10cSrcweir     ScRange         aDestArea;
47cdf0e10cSrcweir     sal_Bool            bAddUndo;
48cdf0e10cSrcweir     sal_Bool            bInCreate;
49cdf0e10cSrcweir     sal_Bool            bDoInsert;      // wird fuer das erste Update auf sal_False gesetzt
50cdf0e10cSrcweir 
51cdf0e10cSrcweir 	sal_Bool		FindExtRange( ScRange& rRange, ScDocument* pSrcDoc, const String& rAreaName );
52cdf0e10cSrcweir 
53cdf0e10cSrcweir public:
54cdf0e10cSrcweir 	TYPEINFO();
55cdf0e10cSrcweir 	ScAreaLink( SfxObjectShell* pShell, const String& rFile,
56cdf0e10cSrcweir 					const String& rFilter, const String& rOpt,
57cdf0e10cSrcweir 					const String& rArea, const ScRange& rDest, sal_uLong nRefresh );
58cdf0e10cSrcweir 	virtual ~ScAreaLink();
59cdf0e10cSrcweir 
60cdf0e10cSrcweir 	virtual void Closed();
61cdf0e10cSrcweir 	virtual void DataChanged( const String& rMimeType,
62cdf0e10cSrcweir 							  const ::com::sun::star::uno::Any & rValue );
63cdf0e10cSrcweir 
64cdf0e10cSrcweir     virtual void    Edit( Window*, const Link& rEndEditHdl );
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 	sal_Bool	Refresh( const String& rNewFile, const String& rNewFilter,
67cdf0e10cSrcweir 					const String& rNewArea, sal_uLong nNewRefresh );
68cdf0e10cSrcweir 
SetInCreate(sal_Bool bSet)69cdf0e10cSrcweir 	void	SetInCreate(sal_Bool bSet)					{ bInCreate = bSet; }
SetDoInsert(sal_Bool bSet)70cdf0e10cSrcweir 	void	SetDoInsert(sal_Bool bSet)					{ bDoInsert = bSet; }
71cdf0e10cSrcweir 	void	SetDestArea(const ScRange& rNew);
72cdf0e10cSrcweir 	void	SetSource(const String& rDoc, const String& rFlt, const String& rOpt,
73cdf0e10cSrcweir 						const String& rArea);
74cdf0e10cSrcweir 
75cdf0e10cSrcweir 	sal_Bool	IsEqual( const String& rFile, const String& rFilter, const String& rOpt,
76cdf0e10cSrcweir 						const String& rSource, const ScRange& rDest ) const;
77cdf0e10cSrcweir 
GetFile() const78cdf0e10cSrcweir 	const String&	GetFile() const			{ return aFileName;		}
GetFilter() const79cdf0e10cSrcweir 	const String&	GetFilter() const		{ return aFilterName;	}
GetOptions() const80cdf0e10cSrcweir 	const String&	GetOptions() const		{ return aOptions;		}
GetSource() const81cdf0e10cSrcweir 	const String&	GetSource() const		{ return aSourceArea;	}
GetDestArea() const82cdf0e10cSrcweir 	const ScRange&	GetDestArea() const		{ return aDestArea;		}
83cdf0e10cSrcweir 
84cdf0e10cSrcweir     DECL_LINK( RefreshHdl, ScAreaLink* );
85cdf0e10cSrcweir     DECL_LINK( AreaEndEditHdl, void* );
86cdf0e10cSrcweir };
87cdf0e10cSrcweir 
88cdf0e10cSrcweir #endif
89cdf0e10cSrcweir 
90