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 .
20 #ifndef INCLUDED_SVX_SVDOMEDIA_HXX
21 #define INCLUDED_SVX_SVDOMEDIA_HXX
24 #include <svx/svdorect.hxx>
25 #include <avmedia/mediaitem.hxx>
26 #include <svx/svxdllapi.h>
30 namespace sdr
{ namespace contact
{ class ViewContactOfSdrMediaObj
; } }
31 namespace com::sun::star::graphic
{ class XGraphic
; }
34 class SVX_DLLPUBLIC SdrMediaObj final
: public SdrRectObj
36 friend class sdr::contact::ViewContactOfSdrMediaObj
;
39 // protected destructor - due to final, make private
40 virtual ~SdrMediaObj() override
;
43 SdrMediaObj(SdrModel
& rSdrModel
);
46 const tools::Rectangle
& rRect
);
48 virtual bool HasTextEdit() const override
;
50 virtual void TakeObjInfo(SdrObjTransformInfoRec
& rInfo
) const override
;
51 virtual sal_uInt16
GetObjIdentifier() const override
;
53 virtual OUString
TakeObjNameSingul() const override
;
54 virtual OUString
TakeObjNamePlural() const override
;
56 virtual SdrMediaObj
* CloneSdrObject(SdrModel
& rTargetModel
) const override
;
57 SdrMediaObj
& operator=(const SdrMediaObj
& rObj
);
59 virtual void AdjustToMaxRect( const tools::Rectangle
& rMaxRect
, bool bShrinkOnly
= false ) override
;
61 void setURL( const OUString
& rURL
, const OUString
& rReferer
, const OUString
& rMimeType
= OUString() );
62 const OUString
& getURL() const;
64 void setMediaProperties( const ::avmedia::MediaItem
& rState
);
65 const ::avmedia::MediaItem
& getMediaProperties() const;
67 css::uno::Reference
< css::graphic::XGraphic
> const &
69 css::uno::Reference
< css::io::XInputStream
>
70 GetInputStream() const;
71 void SetInputStream(css::uno::Reference
<css::io::XInputStream
> const&);
73 virtual bool shouldKeepAspectRatio() const override
{ return true; }
76 void mediaPropertiesChanged( const ::avmedia::MediaItem
& rNewState
);
77 virtual std::unique_ptr
<sdr::contact::ViewContact
> CreateObjectSpecificViewContact() override
;
80 std::unique_ptr
<Impl
> m_xImpl
;
83 #endif // INCLUDED_SVX_SVDOMEDIA_HXX
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */