xref: /trunk/main/avmedia/source/viewer/mediawindow_impl.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2008 by Sun Microsystems, Inc.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * $RCSfile: mediawindow_impl.hxx,v $
10  * $Revision: 1.3 $
11  *
12  * This file is part of OpenOffice.org.
13  *
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.
17  *
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).
23  *
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.
28  *
29  ************************************************************************/
30 
31 #ifndef _AVMEDIA_MEDIAWINDOW_IMPL_HXX
32 #define _AVMEDIA_MEDIAWINDOW_IMPL_HXX
33 
34 #include <svtools/transfer.hxx>
35 #include <vcl/syschild.hxx>
36 
37 #include "mediawindowbase_impl.hxx"
38 #include "mediacontrol.hxx"
39 
40 class BitmapEx;
41 
42 namespace avmedia
43 {
44     namespace priv
45     {
46         // ----------------------
47         // - MediaWindowControl -
48         // ----------------------
49 
50         class MediaWindowControl : public MediaControl
51         {
52         public:
53 
54                     MediaWindowControl( Window* pParent );
55                     ~MediaWindowControl();
56 
57         protected:
58 
59             void    update();
60             void    execute( const MediaItem& rItem );
61         };
62 
63         // --------------------
64         // - MediaChildWindow -
65         // --------------------
66 
67         class MediaChildWindow : public SystemChildWindow
68         {
69         public:
70 
71                             MediaChildWindow( Window* pParent );
72                             ~MediaChildWindow();
73 
74         protected:
75 
76             virtual void    MouseMove( const MouseEvent& rMEvt );
77             virtual void    MouseButtonDown( const MouseEvent& rMEvt );
78             virtual void    MouseButtonUp( const MouseEvent& rMEvt );
79             virtual void    KeyInput( const KeyEvent& rKEvt );
80             virtual void    KeyUp( const KeyEvent& rKEvt );
81             virtual void    Command( const CommandEvent& rCEvt );
82         };
83 
84         // ------------------.
85         // - MediaWindowImpl -
86         // -------------------
87 
88         class MediaEventListenersImpl;
89 
90         class MediaWindowImpl : public Control,
91                                 public MediaWindowBaseImpl,
92                                 public DropTargetHelper,
93                                 public DragSourceHelper
94 
95         {
96         public:
97 
98                             MediaWindowImpl( Window* parent, MediaWindow* pMediaWindow, bool bInternalMediaControl );
99             virtual         ~MediaWindowImpl();
100 
101             virtual void    cleanUp();
102             virtual void    onURLChanged();
103 
104         public:
105 
106             void            update();
107 
108             void            setPosSize( const Rectangle& rRect );
109 
110             void            setPointer( const Pointer& rPointer );
111             const Pointer&  getPointer() const;
112 
113             bool            hasInternalMediaControl() const;
114 
115         protected:
116 
117             // Window
118             virtual void    MouseMove( const MouseEvent& rMEvt );
119             virtual void    MouseButtonDown( const MouseEvent& rMEvt );
120             virtual void    MouseButtonUp( const MouseEvent& rMEvt );
121             virtual void    KeyInput( const KeyEvent& rKEvt );
122             virtual void    KeyUp( const KeyEvent& rKEvt );
123             virtual void    Command( const CommandEvent& rCEvt );
124             virtual void    Resize();
125             virtual void    StateChanged( StateChangedType );
126             virtual void    Paint( const Rectangle& ); // const
127             virtual void    GetFocus();
128 
129             // DropTargetHelper
130             virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
131             virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
132 
133             // DragSourceHelper
134             virtual void    StartDrag( sal_Int8 nAction, const Point& rPosPixel );
135 
136         private:
137 
138             ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >   mxEventsIf;
139             MediaEventListenersImpl*                                                mpEvents;
140             MediaChildWindow                                                        maChildWindow;
141             MediaWindowControl*                                                     mpMediaWindowControl;
142             BitmapEx*                                                               mpEmptyBmpEx;
143             BitmapEx*                                                               mpAudioBmpEx;
144         };
145     }
146 }
147 
148 #endif
149