merge the formfield patch from ooo-build
[ooovba.git] / avmedia / inc / mediacontrol.hxx
blob6a257d59fa8c95e59613a25196e3a2a4bc422ed6
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: mediacontrol.hxx,v $
10 * $Revision: 1.6 $
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_MEDIACONTROL_HXX
32 #define _AVMEDIA_MEDIACONTROL_HXX
34 #include <avmedia/mediaitem.hxx>
36 #include <vcl/timer.hxx>
37 #include <vcl/slider.hxx>
38 #include <vcl/toolbox.hxx>
39 #include <vcl/edit.hxx>
40 #include <vcl/image.hxx>
42 #define AVMEDIA_CONTROLOFFSET 6
44 class ListBox;
46 namespace avmedia
49 // ---------------------
50 // - MediaControlStyle -
51 // ---------------------
53 enum MediaControlStyle
55 MEDIACONTROLSTYLE_SINGLELINE = 0,
56 MEDIACONTROLSTYLE_MULTILINE = 1
59 // ----------------
60 // - MediaControl -
61 // ---------------
63 class MediaItem;
65 class MediaControl : public Control
67 public:
69 MediaControl( Window* pParent, MediaControlStyle eControlStyle );
70 virtual ~MediaControl();
72 const Size& getMinSizePixel() const;
74 void setState( const MediaItem& rItem );
75 void getState( MediaItem& rItem ) const;
77 protected:
79 virtual void update() = 0;
80 virtual void execute( const MediaItem& rItem ) = 0;
82 virtual void Resize();
84 private:
86 void implUpdateToolboxes();
87 void implUpdateTimeSlider();
88 void implUpdateVolumeSlider();
89 void implUpdateTimeField( double fCurTime );
90 Image implGetImage( sal_Int32 nImageId ) const;
92 DECL_LINK( implTimeHdl, Slider* );
93 DECL_LINK( implTimeEndHdl, Slider* );
94 DECL_LINK( implVolumeHdl, Slider* );
95 DECL_LINK( implVolumeEndHdl, Slider* );
96 DECL_LINK( implSelectHdl, ToolBox* );
97 DECL_LINK( implZoomSelectHdl, ListBox* );
98 DECL_LINK( implTimeoutHdl, Timer* );
100 ImageList maImageList;
101 Timer maTimer;
102 MediaItem maItem;
103 ToolBox maPlayToolBox;
104 Slider maTimeSlider;
105 ToolBox maMuteToolBox;
106 Slider maVolumeSlider;
107 ToolBox maZoomToolBox;
108 ListBox* mpZoomListBox;
109 Edit maTimeEdit;
110 Size maMinSize;
111 MediaControlStyle meControlStyle;
112 bool mbLocked;
117 #endif