merge the formfield patch from ooo-build
[ooovba.git] / avmedia / source / viewer / mediawindow_impl.hxx
blob52a47d0391cca89b984d92b67fda5ffce0884780
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: mediawindow_impl.hxx,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _AVMEDIA_MEDIAWINDOW_IMPL_HXX
32 #define _AVMEDIA_MEDIAWINDOW_IMPL_HXX
34 #include <svtools/transfer.hxx>
35 #ifdef GSTREAMER
36 #include <vcl/syschild.hxx>
37 #else
38 #include <vcl/javachild.hxx>
39 #endif
41 #include "mediawindowbase_impl.hxx"
42 #include "mediacontrol.hxx"
44 class BitmapEx;
46 namespace avmedia
48 namespace priv
50 // ----------------------
51 // - MediaWindowControl -
52 // ----------------------
54 class MediaWindowControl : public MediaControl
56 public:
58 MediaWindowControl( Window* pParent );
59 ~MediaWindowControl();
61 protected:
63 void update();
64 void execute( const MediaItem& rItem );
67 // --------------------
68 // - MediaChildWindow -
69 // --------------------
71 #ifdef GSTREAMER
72 class MediaChildWindow : public SystemChildWindow
73 #else
74 class MediaChildWindow : public JavaChildWindow
75 #endif
77 public:
79 MediaChildWindow( Window* pParent );
80 ~MediaChildWindow();
82 protected:
84 virtual void MouseMove( const MouseEvent& rMEvt );
85 virtual void MouseButtonDown( const MouseEvent& rMEvt );
86 virtual void MouseButtonUp( const MouseEvent& rMEvt );
87 virtual void KeyInput( const KeyEvent& rKEvt );
88 virtual void KeyUp( const KeyEvent& rKEvt );
89 virtual void Command( const CommandEvent& rCEvt );
92 // ------------------.
93 // - MediaWindowImpl -
94 // -------------------
96 class MediaEventListenersImpl;
98 class MediaWindowImpl : public Control,
99 public MediaWindowBaseImpl,
100 public DropTargetHelper,
101 public DragSourceHelper
104 public:
106 MediaWindowImpl( Window* parent, MediaWindow* pMediaWindow, bool bInternalMediaControl );
107 virtual ~MediaWindowImpl();
109 virtual void cleanUp();
110 virtual void onURLChanged();
112 public:
114 void update();
116 void setPosSize( const Rectangle& rRect );
118 void setPointer( const Pointer& rPointer );
119 const Pointer& getPointer() const;
121 bool hasInternalMediaControl() const;
123 protected:
125 // Window
126 virtual void MouseMove( const MouseEvent& rMEvt );
127 virtual void MouseButtonDown( const MouseEvent& rMEvt );
128 virtual void MouseButtonUp( const MouseEvent& rMEvt );
129 virtual void KeyInput( const KeyEvent& rKEvt );
130 virtual void KeyUp( const KeyEvent& rKEvt );
131 virtual void Command( const CommandEvent& rCEvt );
132 virtual void Resize();
133 virtual void StateChanged( StateChangedType );
134 virtual void Paint( const Rectangle& ); // const
135 virtual void GetFocus();
137 // DropTargetHelper
138 virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
139 virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
141 // DragSourceHelper
142 virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
144 private:
146 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxEventsIf;
147 MediaEventListenersImpl* mpEvents;
148 MediaChildWindow maChildWindow;
149 MediaWindowControl* mpMediaWindowControl;
150 BitmapEx* mpEmptyBmpEx;
151 BitmapEx* mpAudioBmpEx;
156 #endif