1 /*************************************************************************
3 * OpenOffice.org - a multi-platform office productivity suite
5 * $RCSfile: tbzoomsliderctrl.hxx,v $
9 * last change: $Author: maoyg $ $Date: 2008/04/25 10:08:08 $
11 * The Contents of this file are made available subject to
12 * the terms of GNU Lesser General Public License Version 2.1.
15 * GNU Lesser General Public License Version 2.1
16 * =============================================
17 * Copyright 2005 by Sun Microsystems, Inc.
18 * 901 San Antonio Road, Palo Alto, CA 94303, USA
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License version 2.1, as published by the Free Software Foundation.
24 * This library is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27 * Lesser General Public License for more details.
29 * You should have received a copy of the GNU Lesser General Public
30 * License along with this library; if not, write to the Free Software
31 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
34 ************************************************************************/
35 #ifndef _SC_ZOOMSLIDERTBCONTRL_HXX
36 #define _SC_ZOOMSLIDERTBCONTRL_HXX
38 #ifndef _WINDOW_HXX //autogen
39 #include <vcl/window.hxx>
41 #ifndef _SFXPOOLITEM_HXX //autogen
42 #include <svtools/poolitem.hxx>
44 #ifndef _SFXTBXCTRL_HXX //autogen
45 #include <sfx2/tbxctrl.hxx>
47 #ifndef _COM_SUN_STAR_FRAME_XDISPATCHPROVIDER_HPP_
48 #include <com/sun/star/frame/XDispatchProvider.hpp>
50 #ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_
51 #include <com/sun/star/frame/XFrame.hpp>
53 #include <svx/zoomslideritem.hxx>
56 //class ScZoomSliderControl define
57 class ScZoomSliderControl
: public SfxToolBoxControl
60 SFX_DECL_TOOLBOX_CONTROL();
61 ScZoomSliderControl( USHORT nSlotId
, USHORT nId
, ToolBox
& rTbx
);
62 ~ScZoomSliderControl();
64 virtual void StateChanged( USHORT nSID
, SfxItemState eState
, const SfxPoolItem
* pState
);
65 virtual Window
* CreateItemWindow( Window
*pParent
);
68 //========================================================================
69 // class ScZoomSliderWnd define---------------------------------------
70 //========================================================================
71 class ScZoomSliderWnd
: public Window
74 struct ScZoomSliderWnd_Impl
;
75 ScZoomSliderWnd_Impl
* mpImpl
;
77 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatchProvider
> m_xDispatchProvider
;
78 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
> m_xFrame
;
80 USHORT
Offset2Zoom( long nOffset
) const;
81 long Zoom2Offset( USHORT nZoom
) const;
82 void DoPaint( const Rectangle
& rRect
);
85 ScZoomSliderWnd( Window
* pParent
, const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatchProvider
>& rDispatchProvider
,
86 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& _xFrame
, USHORT nCurrentZoom
);
88 void UpdateFromItem( const SvxZoomSliderItem
* pZoomSliderItem
);
91 virtual void MouseButtonDown( const MouseEvent
& rMEvt
);
92 virtual void MouseMove( const MouseEvent
& rMEvt
);
93 virtual void Paint( const Rectangle
& rRect
);