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