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 .
19 #ifndef INCLUDED_AVMEDIA_MEDIACONTROLBASE_HXX
20 #define INCLUDED_AVMEDIA_MEDIACONTROLBASE_HXX
22 #include <svx/svxdllapi.h>
23 #include <vcl/edit.hxx>
24 #include <vcl/toolbox.hxx>
25 #include <vcl/slider.hxx>
26 #include <avmedia/mediaitem.hxx>
27 #include <avmedia/mediawindow.hxx>
29 #define AVMEDIA_TIME_RANGE 2048
30 #define AVMEDIA_DB_RANGE -40
31 #define AVMEDIA_LINEINCREMENT 1.0
32 #define AVMEDIA_PAGEINCREMENT 10.0
34 #define AVMEDIA_TOOLBOXITEM_PLAY 0x0001
35 #define AVMEDIA_TOOLBOXITEM_PAUSE 0x0004
36 #define AVMEDIA_TOOLBOXITEM_STOP 0x0008
37 #define AVMEDIA_TOOLBOXITEM_MUTE 0x0010
38 #define AVMEDIA_TOOLBOXITEM_LOOP 0x0011
39 #define AVMEDIA_TOOLBOXITEM_ZOOM 0x0012
40 #define AVMEDIA_TOOLBOXITEM_OPEN 0x0014
41 #define AVMEDIA_TOOLBOXITEM_INSERT 0x0018
43 #define AVMEDIA_ZOOMLEVEL_50 0
44 #define AVMEDIA_ZOOMLEVEL_100 1
45 #define AVMEDIA_ZOOMLEVEL_200 2
46 #define AVMEDIA_ZOOMLEVEL_FIT 3
47 #define AVMEDIA_ZOOMLEVEL_SCALED 4
48 #define AVMEDIA_ZOOMLEVEL_INVALID 65535
52 enum MediaControlStyle
54 MEDIACONTROLSTYLE_SINGLELINE
= 0,
55 MEDIACONTROLSTYLE_MULTILINE
= 1
58 class AVMEDIA_DLLPUBLIC MediaControlBase
62 virtual ~MediaControlBase(){};
65 VclPtr
<ToolBox
> mpPlayToolBox
;
66 VclPtr
<Slider
> mpTimeSlider
;
67 VclPtr
<ToolBox
> mpMuteToolBox
;
68 VclPtr
<Slider
> mpVolumeSlider
;
69 VclPtr
<ListBox
> mpZoomListBox
;
70 VclPtr
<Edit
> mpTimeEdit
;
71 Image
GetImage( sal_Int32 nImageId
) const;
72 virtual void InitializeWidgets();
73 virtual void UpdateToolBoxes( MediaItem aMediaItem
);
74 void UpdateVolumeSlider( MediaItem aMediaItem
);
75 void UpdateTimeSlider( MediaItem aMediaItem
);
76 void UpdateTimeField( MediaItem aMediaItem
, double fTime
);
77 void SelectPlayToolBoxItem( MediaItem
& aExecItem
, MediaItem aItem
, sal_uInt16 nId
);
80 ImageList maImageList
;