Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / sw / inc / swbaslnk.hxx
blob0ec3d018c9702dcb35fb62567c6553de13433df2
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_SW_INC_SWBASLNK_HXX
20 #define INCLUDED_SW_INC_SWBASLNK_HXX
22 #include <sfx2/lnkbase.hxx>
24 class SwNode;
25 class SwContentNode;
27 class SwBaseLink : public ::sfx2::SvBaseLink
29 SwContentNode* pContentNode;
30 bool bSwapIn : 1;
31 bool bNoDataFlag : 1;
32 bool bIgnoreDataChanged : 1;
34 public:
36 SwBaseLink( SfxLinkUpdateMode nMode, SotClipboardFormatId nFormat, SwContentNode* pNode = nullptr )
37 : ::sfx2::SvBaseLink( nMode, nFormat ), pContentNode( pNode ),
38 bSwapIn( false ), bNoDataFlag( false ), bIgnoreDataChanged( false )
40 virtual ~SwBaseLink() override;
42 virtual ::sfx2::SvBaseLink::UpdateResult DataChanged(
43 const OUString& rMimeType, const css::uno::Any & rValue ) override;
45 virtual void Closed() override;
47 virtual const SwNode* GetAnchor() const;
49 // For graphics only.
50 bool SwapIn( bool bWaitForData = false, bool bNativFormat = false );
52 bool Connect() { return nullptr != SvBaseLink::GetRealObject(); }
54 // Only for graphics-links (for switching between DDE / Grf-link).
55 using SvBaseLink::SetObjType;
57 bool IsRecursion( const SwBaseLink* pChkLnk ) const;
58 virtual bool IsInRange( sal_uLong nSttNd, sal_uLong nEndNd, sal_Int32 nStt = 0,
59 sal_Int32 nEnd = -1 ) const;
61 void SetNoDataFlag() { bNoDataFlag = true; }
62 bool ChkNoDataFlag() { const bool bRet = bNoDataFlag; bNoDataFlag = false; return bRet; }
63 bool IsNoDataFlag() const { return bNoDataFlag; }
66 #endif
68 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */