1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_AVMEDIA_INC_MEDIACONTROL_HXX
21 #define INCLUDED_AVMEDIA_INC_MEDIACONTROL_HXX
23 #include <avmedia/mediaitem.hxx>
25 #include <vcl/timer.hxx>
26 #include <vcl/idle.hxx>
27 #include <vcl/slider.hxx>
28 #include <vcl/toolbox.hxx>
29 #include <vcl/edit.hxx>
30 #include <vcl/image.hxx>
32 #define AVMEDIA_CONTROLOFFSET 6
40 // - MediaControlStyle -
43 enum MediaControlStyle
45 MEDIACONTROLSTYLE_SINGLELINE
= 0,
46 MEDIACONTROLSTYLE_MULTILINE
= 1
55 class MediaControl
: public Control
59 MediaControl( vcl::Window
* pParent
, MediaControlStyle eControlStyle
);
60 virtual ~MediaControl();
61 virtual void dispose() SAL_OVERRIDE
;
63 const Size
& getMinSizePixel() const;
65 void setState( const MediaItem
& rItem
);
69 virtual void update() = 0;
70 virtual void execute( const MediaItem
& rItem
) = 0;
72 virtual void Resize() SAL_OVERRIDE
;
76 void implUpdateToolboxes();
77 void implUpdateTimeSlider();
78 void implUpdateVolumeSlider();
79 void implUpdateTimeField( double fCurTime
);
80 Image
implGetImage( sal_Int32 nImageId
) const;
82 DECL_LINK( implTimeHdl
, Slider
* );
83 DECL_LINK( implTimeEndHdl
, Slider
* );
84 DECL_LINK( implVolumeHdl
, Slider
* );
85 DECL_STATIC_LINK(MediaControl
, implVolumeEndHdl
, void *);
86 DECL_LINK_TYPED( implSelectHdl
, ToolBox
*, void );
87 DECL_LINK( implZoomSelectHdl
, ListBox
* );
88 DECL_LINK_TYPED(implTimeoutHdl
, Idle
*, void);
90 ImageList maImageList
;
93 VclPtr
<ToolBox
> maPlayToolBox
;
94 VclPtr
<Slider
> maTimeSlider
;
95 VclPtr
<ToolBox
> maMuteToolBox
;
96 VclPtr
<Slider
> maVolumeSlider
;
97 VclPtr
<ToolBox
> maZoomToolBox
;
98 VclPtr
<ListBox
> mpZoomListBox
;
99 VclPtr
<Edit
> maTimeEdit
;
101 MediaControlStyle meControlStyle
;
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */