1*9ea84ac5SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*9ea84ac5SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*9ea84ac5SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*9ea84ac5SAndrew Rist * distributed with this work for additional information 6*9ea84ac5SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*9ea84ac5SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*9ea84ac5SAndrew Rist * "License"); you may not use this file except in compliance 9*9ea84ac5SAndrew Rist * with the License. You may obtain a copy of the License at 10*9ea84ac5SAndrew Rist * 11*9ea84ac5SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*9ea84ac5SAndrew Rist * 13*9ea84ac5SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*9ea84ac5SAndrew Rist * software distributed under the License is distributed on an 15*9ea84ac5SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*9ea84ac5SAndrew Rist * KIND, either express or implied. See the License for the 17*9ea84ac5SAndrew Rist * specific language governing permissions and limitations 18*9ea84ac5SAndrew Rist * under the License. 19*9ea84ac5SAndrew Rist * 20*9ea84ac5SAndrew Rist *************************************************************/ 21*9ea84ac5SAndrew Rist 22*9ea84ac5SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _AVMEDIA_MEDIACONTROL_HXX 25cdf0e10cSrcweir #define _AVMEDIA_MEDIACONTROL_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <avmedia/mediaitem.hxx> 28cdf0e10cSrcweir 29cdf0e10cSrcweir #include <vcl/timer.hxx> 30cdf0e10cSrcweir #include <vcl/slider.hxx> 31cdf0e10cSrcweir #include <vcl/toolbox.hxx> 32cdf0e10cSrcweir #include <vcl/edit.hxx> 33cdf0e10cSrcweir #include <vcl/image.hxx> 34cdf0e10cSrcweir 35cdf0e10cSrcweir #define AVMEDIA_CONTROLOFFSET 6 36cdf0e10cSrcweir 37cdf0e10cSrcweir class ListBox; 38cdf0e10cSrcweir 39cdf0e10cSrcweir namespace avmedia 40cdf0e10cSrcweir { 41cdf0e10cSrcweir 42cdf0e10cSrcweir // --------------------- 43cdf0e10cSrcweir // - MediaControlStyle - 44cdf0e10cSrcweir // --------------------- 45cdf0e10cSrcweir 46cdf0e10cSrcweir enum MediaControlStyle 47cdf0e10cSrcweir { 48cdf0e10cSrcweir MEDIACONTROLSTYLE_SINGLELINE = 0, 49cdf0e10cSrcweir MEDIACONTROLSTYLE_MULTILINE = 1 50cdf0e10cSrcweir }; 51cdf0e10cSrcweir 52cdf0e10cSrcweir // ---------------- 53cdf0e10cSrcweir // - MediaControl - 54cdf0e10cSrcweir // --------------- 55cdf0e10cSrcweir 56cdf0e10cSrcweir class MediaItem; 57cdf0e10cSrcweir 58cdf0e10cSrcweir class MediaControl : public Control 59cdf0e10cSrcweir { 60cdf0e10cSrcweir public: 61cdf0e10cSrcweir 62cdf0e10cSrcweir MediaControl( Window* pParent, MediaControlStyle eControlStyle ); 63cdf0e10cSrcweir virtual ~MediaControl(); 64cdf0e10cSrcweir 65cdf0e10cSrcweir const Size& getMinSizePixel() const; 66cdf0e10cSrcweir 67cdf0e10cSrcweir void setState( const MediaItem& rItem ); 68cdf0e10cSrcweir void getState( MediaItem& rItem ) const; 69cdf0e10cSrcweir 70cdf0e10cSrcweir protected: 71cdf0e10cSrcweir 72cdf0e10cSrcweir virtual void update() = 0; 73cdf0e10cSrcweir virtual void execute( const MediaItem& rItem ) = 0; 74cdf0e10cSrcweir 75cdf0e10cSrcweir virtual void Resize(); 76cdf0e10cSrcweir 77cdf0e10cSrcweir private: 78cdf0e10cSrcweir 79cdf0e10cSrcweir void implUpdateToolboxes(); 80cdf0e10cSrcweir void implUpdateTimeSlider(); 81cdf0e10cSrcweir void implUpdateVolumeSlider(); 82cdf0e10cSrcweir void implUpdateTimeField( double fCurTime ); 83cdf0e10cSrcweir Image implGetImage( sal_Int32 nImageId ) const; 84cdf0e10cSrcweir 85cdf0e10cSrcweir DECL_LINK( implTimeHdl, Slider* ); 86cdf0e10cSrcweir DECL_LINK( implTimeEndHdl, Slider* ); 87cdf0e10cSrcweir DECL_LINK( implVolumeHdl, Slider* ); 88cdf0e10cSrcweir DECL_LINK( implVolumeEndHdl, Slider* ); 89cdf0e10cSrcweir DECL_LINK( implSelectHdl, ToolBox* ); 90cdf0e10cSrcweir DECL_LINK( implZoomSelectHdl, ListBox* ); 91cdf0e10cSrcweir DECL_LINK( implTimeoutHdl, Timer* ); 92cdf0e10cSrcweir 93cdf0e10cSrcweir ImageList maImageList; 94cdf0e10cSrcweir Timer maTimer; 95cdf0e10cSrcweir MediaItem maItem; 96cdf0e10cSrcweir ToolBox maPlayToolBox; 97cdf0e10cSrcweir Slider maTimeSlider; 98cdf0e10cSrcweir ToolBox maMuteToolBox; 99cdf0e10cSrcweir Slider maVolumeSlider; 100cdf0e10cSrcweir ToolBox maZoomToolBox; 101cdf0e10cSrcweir ListBox* mpZoomListBox; 102cdf0e10cSrcweir Edit maTimeEdit; 103cdf0e10cSrcweir Size maMinSize; 104cdf0e10cSrcweir MediaControlStyle meControlStyle; 105cdf0e10cSrcweir bool mbLocked; 106cdf0e10cSrcweir }; 107cdf0e10cSrcweir 108cdf0e10cSrcweir } 109cdf0e10cSrcweir 110cdf0e10cSrcweir #endif 111