xref: /AOO41X/main/avmedia/source/viewer/mediawindow_impl.hxx (revision ebfcd9af2ce496a86a62eef7379364d0a42a7f96)
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_MEDIAWINDOW_IMPL_HXX
25 #define _AVMEDIA_MEDIAWINDOW_IMPL_HXX
26 
27 #include <svtools/transfer.hxx>
28 #include <vcl/syschild.hxx>
29 
30 #include "mediawindowbase_impl.hxx"
31 #include "mediacontrol.hxx"
32 
33 class BitmapEx;
34 
35 namespace avmedia
36 {
37     namespace priv
38     {
39         // ----------------------
40         // - MediaWindowControl -
41         // ----------------------
42 
43         class MediaWindowControl : public MediaControl
44         {
45         public:
46 
47                     MediaWindowControl( Window* pParent );
48                     ~MediaWindowControl();
49 
50         protected:
51 
52             void    update();
53             void    execute( const MediaItem& rItem );
54         };
55 
56         // --------------------
57         // - MediaChildWindow -
58         // --------------------
59 
60         class MediaChildWindow : public SystemChildWindow
61         {
62         public:
63 
64                             MediaChildWindow( Window* pParent );
65                             ~MediaChildWindow();
66 
67         protected:
68 
69             virtual void    MouseMove( const MouseEvent& rMEvt );
70             virtual void    MouseButtonDown( const MouseEvent& rMEvt );
71             virtual void    MouseButtonUp( const MouseEvent& rMEvt );
72             virtual void    KeyInput( const KeyEvent& rKEvt );
73             virtual void    KeyUp( const KeyEvent& rKEvt );
74             virtual void    Command( const CommandEvent& rCEvt );
75         };
76 
77         // ------------------.
78         // - MediaWindowImpl -
79         // -------------------
80 
81         class MediaEventListenersImpl;
82 
83         class MediaWindowImpl : public Control,
84                                 public MediaWindowBaseImpl,
85                                 public DropTargetHelper,
86                                 public DragSourceHelper
87 
88         {
89         public:
90 
91                             MediaWindowImpl( Window* parent, MediaWindow* pMediaWindow, bool bInternalMediaControl );
92             virtual         ~MediaWindowImpl();
93 
94             virtual void    cleanUp();
95             virtual void    onURLChanged();
96 
97         public:
98 
99             void            update();
100 
101             void            setPosSize( const Rectangle& rRect );
102 
103             void            setPointer( const Pointer& rPointer );
104             const Pointer&  getPointer() const;
105 
106             bool            hasInternalMediaControl() const;
107 
108         protected:
109 
110             // Window
111             virtual void    MouseMove( const MouseEvent& rMEvt );
112             virtual void    MouseButtonDown( const MouseEvent& rMEvt );
113             virtual void    MouseButtonUp( const MouseEvent& rMEvt );
114             virtual void    KeyInput( const KeyEvent& rKEvt );
115             virtual void    KeyUp( const KeyEvent& rKEvt );
116             virtual void    Command( const CommandEvent& rCEvt );
117             virtual void    Resize();
118             virtual void    StateChanged( StateChangedType );
119             virtual void    Paint( const Rectangle& ); // const
120             virtual void    GetFocus();
121 
122             // DropTargetHelper
123             virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
124             virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
125 
126             // DragSourceHelper
127             virtual void    StartDrag( sal_Int8 nAction, const Point& rPosPixel );
128 
129         private:
130 
131             ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >   mxEventsIf;
132             MediaEventListenersImpl*                                                mpEvents;
133             MediaChildWindow                                                        maChildWindow;
134             MediaWindowControl*                                                     mpMediaWindowControl;
135             BitmapEx*                                                               mpEmptyBmpEx;
136             BitmapEx*                                                               mpAudioBmpEx;
137         };
138     }
139 }
140 
141 #endif
142