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 24 #ifndef SC_AREALINK_HXX 25 #define SC_AREALINK_HXX 26 27 #include "global.hxx" 28 #include "refreshtimer.hxx" 29 #include "address.hxx" 30 #include <sfx2/lnkbase.hxx> 31 #include "scdllapi.h" 32 33 class ScDocShell; 34 class SfxObjectShell; 35 class AbstractScLinkedAreaDlg; 36 struct AreaLink_Impl; 37 38 class SC_DLLPUBLIC ScAreaLink : public ::sfx2::SvBaseLink, public ScRefreshTimer 39 { 40 private: 41 AreaLink_Impl* pImpl; 42 String aFileName; 43 String aFilterName; 44 String aOptions; 45 String aSourceArea; 46 ScRange aDestArea; 47 sal_Bool bAddUndo; 48 sal_Bool bInCreate; 49 sal_Bool bDoInsert; // wird fuer das erste Update auf sal_False gesetzt 50 51 sal_Bool FindExtRange( ScRange& rRange, ScDocument* pSrcDoc, const String& rAreaName ); 52 53 public: 54 TYPEINFO(); 55 ScAreaLink( SfxObjectShell* pShell, const String& rFile, 56 const String& rFilter, const String& rOpt, 57 const String& rArea, const ScRange& rDest, sal_uLong nRefresh ); 58 virtual ~ScAreaLink(); 59 60 virtual void Closed(); 61 virtual void DataChanged( const String& rMimeType, 62 const ::com::sun::star::uno::Any & rValue ); 63 64 virtual void Edit( Window*, const Link& rEndEditHdl ); 65 66 sal_Bool Refresh( const String& rNewFile, const String& rNewFilter, 67 const String& rNewArea, sal_uLong nNewRefresh ); 68 SetInCreate(sal_Bool bSet)69 void SetInCreate(sal_Bool bSet) { bInCreate = bSet; } SetDoInsert(sal_Bool bSet)70 void SetDoInsert(sal_Bool bSet) { bDoInsert = bSet; } 71 void SetDestArea(const ScRange& rNew); 72 void SetSource(const String& rDoc, const String& rFlt, const String& rOpt, 73 const String& rArea); 74 75 sal_Bool IsEqual( const String& rFile, const String& rFilter, const String& rOpt, 76 const String& rSource, const ScRange& rDest ) const; 77 GetFile() const78 const String& GetFile() const { return aFileName; } GetFilter() const79 const String& GetFilter() const { return aFilterName; } GetOptions() const80 const String& GetOptions() const { return aOptions; } GetSource() const81 const String& GetSource() const { return aSourceArea; } GetDestArea() const82 const ScRange& GetDestArea() const { return aDestArea; } 83 84 DECL_LINK( RefreshHdl, ScAreaLink* ); 85 DECL_LINK( AreaEndEditHdl, void* ); 86 }; 87 88 #endif 89 90