LibreOffice Module svx (master)  1
svdomedia.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 
20 #ifndef INCLUDED_SVX_SVDOMEDIA_HXX
21 #define INCLUDED_SVX_SVDOMEDIA_HXX
22 
23 #include <memory>
24 #include <svx/svdorect.hxx>
25 #include <avmedia/mediaitem.hxx>
26 #include <svx/svxdllapi.h>
27 
28 class Graphic;
29 
30 namespace sdr::contact { class ViewContactOfSdrMediaObj; }
31 namespace com::sun::star::graphic { class XGraphic; }
32 
33 
35 {
37 
38 private:
39  // protected destructor - due to final, make private
40  virtual ~SdrMediaObj() override;
41 
42 public:
43  SdrMediaObj(SdrModel& rSdrModel);
45  SdrModel& rSdrModel,
46  const tools::Rectangle& rRect);
47 
48  virtual bool HasTextEdit() const override;
49 
50  virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override;
51  virtual sal_uInt16 GetObjIdentifier() const override;
52 
53  virtual OUString TakeObjNameSingul() const override;
54  virtual OUString TakeObjNamePlural() const override;
55 
56  virtual SdrMediaObj* CloneSdrObject(SdrModel& rTargetModel) const override;
57  SdrMediaObj& operator=(const SdrMediaObj& rObj);
58 
59  virtual void AdjustToMaxRect( const tools::Rectangle& rMaxRect, bool bShrinkOnly = false ) override;
60 
61  void setURL( const OUString& rURL, const OUString& rReferer, const OUString& rMimeType = OUString() );
62  const OUString& getURL() const;
63 
64  void setMediaProperties( const ::avmedia::MediaItem& rState );
65  const ::avmedia::MediaItem& getMediaProperties() const;
66 
67  css::uno::Reference< css::graphic::XGraphic > const &
68  getSnapshot() const;
69  css::uno::Reference< css::io::XInputStream>
70  GetInputStream() const;
71  void SetInputStream(css::uno::Reference<css::io::XInputStream> const&);
72 
73  virtual bool shouldKeepAspectRatio() const override { return true; }
74 
75 private:
76  void mediaPropertiesChanged( const ::avmedia::MediaItem& rNewState );
77  virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
78 
79  struct Impl;
80  std::unique_ptr<Impl> m_xImpl;
81 };
82 
83 #endif // INCLUDED_SVX_SVDOMEDIA_HXX
84 
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual OUString TakeObjNameSingul() const override
Definition: svdorect.cxx:192
Rectangle objects (rectangle, circle, ...)
Definition: svdorect.hxx:39
Provides information about various ZObject properties.
Definition: svdobj.hxx:248
virtual bool HasTextEdit() const override
Definition: svdotxed.cxx:34
std::unique_ptr< Impl > m_xImpl
Definition: svdomedia.hxx:79
virtual bool shouldKeepAspectRatio() const override
Whether the aspect ratio should be kept by default when resizing.
Definition: svdomedia.hxx:73
virtual void AdjustToMaxRect(const tools::Rectangle &rMaxRect, bool bShrinkOnly=false)
Definition: svdobj.cxx:1617
void mediaPropertiesChanged(const ::avmedia::MediaItem &rNewState)
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const override
Definition: svdorect.cxx:138
virtual SdrRectObj * CloneSdrObject(SdrModel &rTargetModel) const override
Definition: svdorect.cxx:246
SdrRectObj & operator=(const SdrRectObj &rCopy)
Definition: svdorect.cxx:251
virtual sal_uInt16 GetObjIdentifier() const override
Definition: svdorect.cxx:164
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact() override
Definition: svdorect.cxx:47
#define SVXCORE_DLLPUBLIC
Definition: svxdllapi.h:35
virtual OUString TakeObjNamePlural() const override
Definition: svdorect.cxx:225