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 _SC_ZOOMSLIDERTBCONTRL_HXX
20 #define _SC_ZOOMSLIDERTBCONTRL_HXX
22 #include <vcl/window.hxx>
23 #include <svl/poolitem.hxx>
24 #include <sfx2/tbxctrl.hxx>
25 #include <com/sun/star/frame/XDispatchProvider.hpp>
26 #include <com/sun/star/frame/XFrame.hpp>
27 #include <svx/zoomslideritem.hxx>
30 class ScZoomSliderControl
: public SfxToolBoxControl
33 SFX_DECL_TOOLBOX_CONTROL();
34 ScZoomSliderControl( sal_uInt16 nSlotId
, sal_uInt16 nId
, ToolBox
& rTbx
);
35 ~ScZoomSliderControl();
37 virtual void StateChanged( sal_uInt16 nSID
, SfxItemState eState
, const SfxPoolItem
* pState
);
38 virtual Window
* CreateItemWindow( Window
*pParent
);
41 class ScZoomSliderWnd
: public Window
44 struct ScZoomSliderWnd_Impl
;
45 ScZoomSliderWnd_Impl
* mpImpl
;
47 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatchProvider
> m_xDispatchProvider
;
48 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
> m_xFrame
;
50 sal_uInt16
Offset2Zoom( long nOffset
) const;
51 long Zoom2Offset( sal_uInt16 nZoom
) const;
52 void DoPaint( const Rectangle
& rRect
);
55 ScZoomSliderWnd( Window
* pParent
, const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatchProvider
>& rDispatchProvider
,
56 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& _xFrame
, sal_uInt16 nCurrentZoom
);
58 void UpdateFromItem( const SvxZoomSliderItem
* pZoomSliderItem
);
61 virtual void MouseButtonDown( const MouseEvent
& rMEvt
);
62 virtual void MouseMove( const MouseEvent
& rMEvt
);
63 virtual void Paint( const Rectangle
& rRect
);
67 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */