Update ooo320-m1
[ooovba.git] / sc / source / core / inc / ddelink.hxx
blob51a56d3d3747d6fda08808bcefe9eb8287ab2ed7
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: ddelink.hxx,v $
10 * $Revision: 1.11.32.1 $
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_DDELINK_HXX
32 #define SC_DDELINK_HXX
34 #include "address.hxx"
35 #include <sfx2/lnkbase.hxx>
36 #include <svtools/broadcast.hxx>
37 #include "scmatrix.hxx"
39 class ScDocument;
40 class ScMultipleReadHeader;
41 class ScMultipleWriteHeader;
42 class SvStream;
44 class ScDdeLink : public ::sfx2::SvBaseLink, public SvtBroadcaster
46 private:
47 static BOOL bIsInUpdate;
49 ScDocument* pDoc;
51 String aAppl; // Verbindungsdaten
52 String aTopic;
53 String aItem;
54 BYTE nMode; // Zahlformat-Modus
56 BOOL bNeedUpdate; // wird gesetzt, wenn Update nicht moeglich war
58 ScMatrixRef pResult; // Ergebnis
60 public:
61 TYPEINFO();
63 ScDdeLink( ScDocument* pD,
64 const String& rA, const String& rT, const String& rI,
65 BYTE nM );
66 ScDdeLink( ScDocument* pD, SvStream& rStream, ScMultipleReadHeader& rHdr );
67 ScDdeLink( ScDocument* pD, const ScDdeLink& rOther );
68 virtual ~ScDdeLink();
70 void Store( SvStream& rStream, ScMultipleWriteHeader& rHdr ) const;
72 // von SvBaseLink ueberladen:
73 virtual void DataChanged( const String& rMimeType,
74 const ::com::sun::star::uno::Any & rValue );
76 // von SvtBroadcaster ueberladen:
77 virtual void ListenersGone();
79 // fuer Interpreter:
81 const ScMatrix* GetResult() const { return pResult; }
82 void SetResult( ScMatrix* pRes ) { pResult = pRes; }
84 // XML and Excel import after NewData()
85 ScMatrixRef GetModifiableResult() { return pResult; }
87 const String& GetAppl() const { return aAppl; }
88 const String& GetTopic() const { return aTopic; }
89 const String& GetItem() const { return aItem; }
90 BYTE GetMode() const { return nMode; }
92 void ResetValue(); // Wert zuruecksetzen
93 void TryUpdate();
95 BOOL NeedsUpdate() const { return bNeedUpdate; }
97 static BOOL IsInUpdate() { return bIsInUpdate; }
101 #endif