1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef _SVDOMEDIA_HXX 25 #define _SVDOMEDIA_HXX 26 27 #include <svx/svdorect.hxx> 28 #include <avmedia/mediaitem.hxx> 29 #include "svx/svxdllapi.h" 30 31 class Graphic; 32 33 namespace sdr { namespace contact { class ViewContactOfSdrMediaObj; } } 34 35 // --------------- 36 // - SdrMediaObj - 37 // --------------- 38 39 class SVX_DLLPUBLIC SdrMediaObj : public SdrRectObj 40 { 41 friend class ::sdr::contact::ViewContactOfSdrMediaObj; 42 43 public: 44 45 TYPEINFO(); 46 47 SdrMediaObj(); 48 SdrMediaObj( const Rectangle& rRect ); 49 50 virtual ~SdrMediaObj(); 51 52 virtual FASTBOOL HasTextEdit() const; 53 54 virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const; 55 virtual sal_uInt16 GetObjIdentifier() const; 56 57 virtual void TakeObjNameSingul(String& rName) const; 58 virtual void TakeObjNamePlural(String& rName) const; 59 60 virtual void operator=(const SdrObject& rObj); 61 62 virtual void AdjustToMaxRect( const Rectangle& rMaxRect, bool bShrinkOnly = false ); 63 64 public: 65 66 void setURL( const ::rtl::OUString& rURL ); 67 const ::rtl::OUString& getURL() const; 68 69 void setMediaProperties( const ::avmedia::MediaItem& rState ); 70 const ::avmedia::MediaItem& getMediaProperties() const; 71 72 bool hasPreferredSize() const; 73 Size getPreferredSize() const; 74 75 const Graphic& getGraphic() const; 76 void setGraphic( const Graphic* pGraphic = NULL ); 77 78 protected: 79 80 virtual void mediaPropertiesChanged( const ::avmedia::MediaItem& rNewState ); 81 virtual ::sdr::contact::ViewContact* CreateObjectSpecificViewContact(); 82 83 private: 84 85 ::avmedia::MediaItem maMediaProperties; 86 ::std::auto_ptr< Graphic > mapGraphic; 87 }; 88 89 #endif //_SVDOMEDIA_HXX 90