sync master with lastest vba changes
[ooovba.git] / sc / inc / arealink.hxx
blob8179a88ab3af9f422cb63db51d3321cdf4956a18
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: arealink.hxx,v $
10 * $Revision: 1.12 $
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 ************************************************************************/
31 #ifndef SC_AREALINK_HXX
32 #define SC_AREALINK_HXX
34 #include "global.hxx"
35 #include "refreshtimer.hxx"
36 #include "address.hxx"
37 #include <sfx2/lnkbase.hxx>
38 #include "scdllapi.h"
40 class ScDocShell;
41 class SfxObjectShell;
42 class AbstractScLinkedAreaDlg;
43 struct AreaLink_Impl;
45 class SC_DLLPUBLIC ScAreaLink : public ::sfx2::SvBaseLink, public ScRefreshTimer
47 private:
48 AreaLink_Impl* pImpl;
49 String aFileName;
50 String aFilterName;
51 String aOptions;
52 String aSourceArea;
53 ScRange aDestArea;
54 BOOL bAddUndo;
55 BOOL bInCreate;
56 BOOL bDoInsert; // wird fuer das erste Update auf FALSE gesetzt
58 BOOL FindExtRange( ScRange& rRange, ScDocument* pSrcDoc, const String& rAreaName );
60 public:
61 TYPEINFO();
62 ScAreaLink( SfxObjectShell* pShell, const String& rFile,
63 const String& rFilter, const String& rOpt,
64 const String& rArea, const ScRange& rDest, ULONG nRefresh );
65 virtual ~ScAreaLink();
67 virtual void Closed();
68 virtual void DataChanged( const String& rMimeType,
69 const ::com::sun::star::uno::Any & rValue );
71 virtual void Edit( Window*, const Link& rEndEditHdl );
73 BOOL Refresh( const String& rNewFile, const String& rNewFilter,
74 const String& rNewArea, ULONG nNewRefresh );
76 void SetInCreate(BOOL bSet) { bInCreate = bSet; }
77 void SetDoInsert(BOOL bSet) { bDoInsert = bSet; }
78 void SetDestArea(const ScRange& rNew);
79 void SetSource(const String& rDoc, const String& rFlt, const String& rOpt,
80 const String& rArea);
82 BOOL IsEqual( const String& rFile, const String& rFilter, const String& rOpt,
83 const String& rSource, const ScRange& rDest ) const;
85 const String& GetFile() const { return aFileName; }
86 const String& GetFilter() const { return aFilterName; }
87 const String& GetOptions() const { return aOptions; }
88 const String& GetSource() const { return aSourceArea; }
89 const ScRange& GetDestArea() const { return aDestArea; }
91 DECL_LINK( RefreshHdl, ScAreaLink* );
92 DECL_LINK( AreaEndEditHdl, void* );
95 #endif