1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: mediaitem.hxx,v $
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_MEDIAITEM_HXX
32 #define _AVMEDIA_MEDIAITEM_HXX
34 #include <tools/rtti.hxx>
36 #include <svtools/poolitem.hxx>
38 #include <com/sun/star/media/ZoomLevel.hpp>
40 #define AVMEDIA_SETMASK_NONE ((sal_uInt32)(0x00000000))
41 #define AVMEDIA_SETMASK_STATE ((sal_uInt32)(0x00000001))
42 #define AVMEDIA_SETMASK_DURATION ((sal_uInt32)(0x00000002))
43 #define AVMEDIA_SETMASK_TIME ((sal_uInt32)(0x00000004))
44 #define AVMEDIA_SETMASK_LOOP ((sal_uInt32)(0x00000008))
45 #define AVMEDIA_SETMASK_MUTE ((sal_uInt32)(0x00000010))
46 #define AVMEDIA_SETMASK_VOLUMEDB ((sal_uInt32)(0x00000020))
47 #define AVMEDIA_SETMASK_ZOOM ((sal_uInt32)(0x00000040))
48 #define AVMEDIA_SETMASK_URL ((sal_uInt32)(0x00000080))
49 #define AVMEDIA_SETMASK_ALL ((sal_uInt32)(0xffffffff))
64 MEDIASTATE_PLAYFFW
= 2,
72 class MediaItem
: public SfxPoolItem
77 MediaItem( USHORT nWhich
= 0, sal_uInt32 nMaskSet
= AVMEDIA_SETMASK_NONE
);
78 MediaItem( const MediaItem
& rMediaItem
);
81 virtual int operator==( const SfxPoolItem
& ) const;
82 virtual SfxPoolItem
* Clone( SfxItemPool
* pPool
= 0 ) const;
83 virtual SfxItemPresentation
GetPresentation( SfxItemPresentation ePres
,
87 const IntlWrapper
*pIntl
) const;
88 virtual BOOL
QueryValue( com::sun::star::uno::Any
& rVal
, BYTE nMemberId
= 0 ) const;
89 virtual BOOL
PutValue( const com::sun::star::uno::Any
& rVal
, BYTE nMemberId
= 0 );
91 void merge( const MediaItem
& rMediaItem
);
93 sal_uInt32
getMaskSet() const;
95 void setState( MediaState eState
);
96 MediaState
getState() const;
98 void setDuration( double fDuration
);
99 double getDuration() const;
101 void setTime( double fTime
);
102 double getTime() const;
104 void setLoop( sal_Bool bLoop
);
105 sal_Bool
isLoop() const;
107 void setMute( sal_Bool bMute
);
108 sal_Bool
isMute() const;
110 void setVolumeDB( sal_Int16 nDB
);
111 sal_Int16
getVolumeDB() const;
113 void setZoom( ::com::sun::star::media::ZoomLevel eZoom
);
114 ::com::sun::star::media::ZoomLevel
getZoom() const;
116 void setURL( const ::rtl::OUString
& rURL
);
117 const ::rtl::OUString
& getURL() const;
121 ::rtl::OUString maURL
;
122 sal_uInt32 mnMaskSet
;
126 sal_Int16 mnVolumeDB
;
129 ::com::sun::star::media::ZoomLevel meZoom
;
132 typedef ::avmedia::MediaItem avmedia_MediaItem
;