1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
23 #include <svx/svdorect.hxx>
24 #include <avmedia/mediaitem.hxx>
25 #include <svx/svxdllapi.h>
29 namespace sdr::contact
{ class ViewContactOfSdrMediaObj
; }
30 namespace com::sun::star::graphic
{ class XGraphic
; }
33 class SVXCORE_DLLPUBLIC SdrMediaObj final
: public SdrRectObj
35 friend class sdr::contact::ViewContactOfSdrMediaObj
;
38 // protected destructor - due to final, make private
39 virtual ~SdrMediaObj() override
;
42 SdrMediaObj(SdrModel
& rSdrModel
);
44 SdrMediaObj(SdrModel
& rSdrModel
, SdrMediaObj
const & rSource
);
47 const tools::Rectangle
& rRect
);
49 virtual bool HasTextEdit() const override
;
51 virtual void TakeObjInfo(SdrObjTransformInfoRec
& rInfo
) const override
;
52 virtual SdrObjKind
GetObjIdentifier() const override
;
54 virtual OUString
TakeObjNameSingul() const override
;
55 virtual OUString
TakeObjNamePlural() const override
;
57 virtual rtl::Reference
<SdrObject
> CloneSdrObject(SdrModel
& rTargetModel
) const override
;
59 virtual void AdjustToMaxRect( const tools::Rectangle
& rMaxRect
, bool bShrinkOnly
= false ) override
;
61 void setURL(const OUString
& rURL
, const OUString
& rReferer
);
62 const OUString
& getURL() const;
64 /// Returns the URL to the temporary extracted media file.
65 const OUString
& getTempURL() const;
67 void setMediaProperties( const ::avmedia::MediaItem
& rState
);
68 const ::avmedia::MediaItem
& getMediaProperties() const;
70 css::uno::Reference
< css::graphic::XGraphic
> const &
72 css::uno::Reference
< css::io::XInputStream
>
73 GetInputStream() const;
74 void SetInputStream(css::uno::Reference
<css::io::XInputStream
> const&);
76 virtual bool shouldKeepAspectRatio() const override
{ return true; }
79 void mediaPropertiesChanged( const ::avmedia::MediaItem
& rNewState
);
80 virtual std::unique_ptr
<sdr::contact::ViewContact
> CreateObjectSpecificViewContact() override
;
83 std::unique_ptr
<Impl
> m_xImpl
;
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */