xref: /trunk/main/svx/inc/svx/svdomedia.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _SVDOMEDIA_HXX
29 #define _SVDOMEDIA_HXX
30 
31 #include <svx/svdorect.hxx>
32 #include <avmedia/mediaitem.hxx>
33 #include "svx/svxdllapi.h"
34 
35 class Graphic;
36 
37 namespace sdr { namespace contact { class ViewContactOfSdrMediaObj; } }
38 
39 // ---------------
40 // - SdrMediaObj -
41 // ---------------
42 
43 class SVX_DLLPUBLIC SdrMediaObj : public SdrRectObj
44 {
45 	friend class ::sdr::contact::ViewContactOfSdrMediaObj;
46 
47 public:
48 
49 									TYPEINFO();
50 
51 									SdrMediaObj();
52 									SdrMediaObj( const Rectangle& rRect );
53 
54 		virtual 					~SdrMediaObj();
55 
56 		virtual FASTBOOL 			HasTextEdit() const;
57 
58 		virtual void				TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
59 		virtual sal_uInt16				GetObjIdentifier() const;
60 
61 		virtual void 				TakeObjNameSingul(String& rName) const;
62 		virtual void 				TakeObjNamePlural(String& rName) const;
63 
64 		virtual void 				operator=(const SdrObject& rObj);
65 
66 		virtual void				AdjustToMaxRect( const Rectangle& rMaxRect, bool bShrinkOnly = false );
67 
68 public:
69 
70 		void						setURL( const ::rtl::OUString& rURL );
71 		const ::rtl::OUString&		getURL() const;
72 
73 		void						setMediaProperties( const ::avmedia::MediaItem& rState );
74 		const ::avmedia::MediaItem& getMediaProperties() const;
75 
76 		bool						hasPreferredSize() const;
77 		Size						getPreferredSize() const;
78 
79         const Graphic&              getGraphic() const;
80         void                        setGraphic( const Graphic* pGraphic = NULL );
81 
82 protected:
83 
84 		virtual void				mediaPropertiesChanged( const ::avmedia::MediaItem& rNewState );
85 		virtual ::sdr::contact::ViewContact* CreateObjectSpecificViewContact();
86 
87 private:
88 
89 		::avmedia::MediaItem		maMediaProperties;
90         ::std::auto_ptr< Graphic >  mapGraphic;
91 };
92 
93 #endif //_SVDOMEDIA_HXX
94