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 _AVMEDIA_MEDIACHILD_HXX
25 #define _AVMEDIA_MEDIACHILD_HXX
26 
27 #include <sfx2/ctrlitem.hxx>
28 #include <sfx2/dockwin.hxx>
29 #include <tools/urlobj.hxx>
30 
31 // -----------
32 // - Defines -
33 // -----------
34 
35 #define AVMEDIA_MEDIAWINDOW() 																							\
36 (static_cast< ::avmedia::MediaFloater* >( (																				\
37 SfxViewFrame::Current() && SfxViewFrame::Current()->GetChildWindow(::avmedia::MediaPlayer::GetChildWindowId())) ?	\
38 SfxViewFrame::Current()->GetChildWindow(::avmedia::MediaPlayer::GetChildWindowId())->GetWindow() : 				\
39 NULL))
40 
41 namespace avmedia
42 {
43 
44 // ---------------
45 // - MediaPlayer -
46 // ---------------
47 
48 class MediaPlayer : public SfxChildWindow
49 {
50 public:
51 						MediaPlayer( Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo* );
52 						~MediaPlayer();
53 
54 						SFX_DECL_CHILDWINDOW( MediaPlayer );
55 };
56 
57 // ----------------
58 // - MediaFloater -
59 // ----------------
60 
61 class MediaWindow;
62 
63 class MediaFloater : public SfxDockingWindow
64 {
65 public:
66 
67 							MediaFloater( SfxBindings* pBindings, SfxChildWindow* pCW, Window* pParent );
68 							~MediaFloater();
69 
70 	void					setURL( const ::rtl::OUString& rURL, bool bPlayImmediately );
71 	const ::rtl::OUString&	getURL() const;
72 
73 	void					dispatchCurrentURL();
74 
75 protected:
76 
77 	virtual void			Resize();
78 	virtual void			ToggleFloatingMode();
79 
80 private:
81 
82 	MediaWindow*			mpMediaWindow;
83 	Size					maLastSize;
84 	long					mnDummy1;
85 	long					mnDummy2;
86 
87     void                	implInit();
88 };
89 
90 }
91 
92 #endif
93