LibreOffice Module sfx2 (master) 1
linksrc.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#ifndef INCLUDED_SFX2_LINKSRC_HXX
20#define INCLUDED_SFX2_LINKSRC_HXX
21
22#include <sal/config.h>
23#include <sfx2/dllapi.h>
24
25#include <tools/ref.hxx>
26#include <com/sun/star/uno/Reference.hxx>
27#include <memory>
28#include <utility>
29
30namespace com::sun::star::uno
31{
32 class Any;
33}
34namespace weld { class Window; }
35
36template <typename Arg, typename Ret> class Link;
37namespace com::sun::star::io { class XInputStream; }
38
39#ifndef ADVISEMODE_NODATA
40// Must be the same value as Ole2 ADVF_*
41#define ADVISEMODE_NODATA 0x01
42#define ADVISEMODE_PRIMEFIRST 0x02
43#define ADVISEMODE_ONLYONCE 0x04
44#define ADVISEMODE_DATAONSTOP 0x40
45#endif
46
47namespace sfx2
48{
49
50class SvBaseLink;
51struct SvLinkSource_Impl;
52
54{
55private:
56 std::unique_ptr<SvLinkSource_Impl> pImpl; // compatible area
57
58public:
59
61 virtual ~SvLinkSource() override;
62
63 bool HasDataLinks() const;
64
65 void Closed();
66
67 sal_uInt64 GetUpdateTimeout() const;
68 void SetUpdateTimeout( sal_uInt64 nTimeMs );
69 // notify the sink, the mime type is not
70 // a selection criterion
71 void DataChanged( const OUString & rMimeType,
72 const css::uno::Any & rVal );
73 void SendDataChanged();
74 void NotifyDataChanged();
75
76 virtual bool Connect( SvBaseLink* );
77 virtual bool GetData( css::uno::Any & rData /*out param*/,
78 const OUString & rMimeType,
79 bool bSynchron = false );
80
81 // sal_True => waitinmg for data
82 virtual bool IsPending() const;
83 // sal_True => data complete loaded
84 virtual bool IsDataComplete() const;
85
86 virtual void Edit(weld::Window *, SvBaseLink *, const Link<const OUString&, void>& rEndEditHdl);
87
88
89 void AddDataAdvise( SvBaseLink *, const OUString & rMimeType,
90 sal_uInt16 nAdviceMode );
91 void RemoveAllDataAdvise( SvBaseLink const * );
92
93 void AddConnectAdvise( SvBaseLink * );
94 void RemoveConnectAdvise( SvBaseLink const * );
95
98 css::uno::Reference<css::io::XInputStream> xInputStream, bool bIsReadOnly )
99 :m_xInputStreamToLoadFrom(std::move(xInputStream)),
100 m_bIsReadOnly(bIsReadOnly)
101 {
102 }
103
104 css::uno::Reference<css::io::XInputStream>
107 };
108
109 StreamToLoadFrom getStreamToLoadFrom();
110 void setStreamToLoadFrom(const css::uno::Reference<css::io::XInputStream>& xInputStream, bool bIsReadOnly );
111 void clearStreamToLoadFrom();
112};
113
115
116}
117#endif
118
119/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< SvLinkSource_Impl > pImpl
Definition: linksrc.hxx:56
#define SFX2_DLLPUBLIC
Definition: dllapi.h:29
tools::SvRef< SvLinkSource > SvLinkSourceRef
Definition: linksrc.hxx:114
StreamToLoadFrom(css::uno::Reference< css::io::XInputStream > xInputStream, bool bIsReadOnly)
Definition: linksrc.hxx:97
css::uno::Reference< css::io::XInputStream > m_xInputStreamToLoadFrom
Definition: linksrc.hxx:105