Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef SC_AREALINK_HXX
30 : : #define SC_AREALINK_HXX
31 : :
32 : : #include "global.hxx"
33 : : #include "refreshtimer.hxx"
34 : : #include "address.hxx"
35 : : #include <sfx2/lnkbase.hxx>
36 : : #include "scdllapi.h"
37 : :
38 : : class SfxObjectShell;
39 : : struct AreaLink_Impl;
40 : :
41 : : class SC_DLLPUBLIC ScAreaLink : public ::sfx2::SvBaseLink, public ScRefreshTimer
42 : : {
43 : : private:
44 : : AreaLink_Impl* pImpl;
45 : : String aFileName;
46 : : String aFilterName;
47 : : String aOptions;
48 : : String aSourceArea;
49 : : ScRange aDestArea;
50 : : bool bAddUndo;
51 : : bool bInCreate;
52 : : bool bDoInsert; // is set to FALSE for first update
53 : : bool FindExtRange( ScRange& rRange, ScDocument* pSrcDoc, const String& rAreaName );
54 : :
55 : : public:
56 : : TYPEINFO();
57 : : ScAreaLink( SfxObjectShell* pShell, const String& rFile,
58 : : const String& rFilter, const String& rOpt,
59 : : const String& rArea, const ScRange& rDest, sal_uLong nRefresh );
60 : : virtual ~ScAreaLink();
61 : :
62 : : virtual void Closed();
63 : : virtual ::sfx2::SvBaseLink::UpdateResult DataChanged(
64 : : const String& rMimeType, const ::com::sun::star::uno::Any & rValue );
65 : :
66 : : virtual void Edit( Window*, const Link& rEndEditHdl );
67 : :
68 : : sal_Bool Refresh( const String& rNewFile, const String& rNewFilter,
69 : : const String& rNewArea, sal_uLong nNewRefresh );
70 : :
71 : 0 : void SetInCreate(bool bSet) { bInCreate = bSet; }
72 : 32 : void SetDoInsert(bool bSet) { bDoInsert = bSet; }
73 : : void SetDestArea(const ScRange& rNew);
74 : : void SetSource(const String& rDoc, const String& rFlt, const String& rOpt,
75 : : const String& rArea);
76 : :
77 : : bool IsEqual( const String& rFile, const String& rFilter, const String& rOpt,
78 : : const String& rSource, const ScRange& rDest ) const;
79 : :
80 : 20 : const String& GetFile() const { return aFileName; }
81 : 20 : const String& GetFilter() const { return aFilterName; }
82 : 20 : const String& GetOptions() const { return aOptions; }
83 : 16 : const String& GetSource() const { return aSourceArea; }
84 : 17 : const ScRange& GetDestArea() const { return aDestArea; }
85 : :
86 : : DECL_LINK( RefreshHdl, void* );
87 : : DECL_LINK( AreaEndEditHdl, void* );
88 : : };
89 : :
90 : : #endif
91 : :
92 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|