1c45d927aSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3c45d927aSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4c45d927aSAndrew Rist * or more contributor license agreements. See the NOTICE file 5c45d927aSAndrew Rist * distributed with this work for additional information 6c45d927aSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7c45d927aSAndrew Rist * to you under the Apache License, Version 2.0 (the 8c45d927aSAndrew Rist * "License"); you may not use this file except in compliance 9c45d927aSAndrew Rist * with the License. You may obtain a copy of the License at 10c45d927aSAndrew Rist * 11c45d927aSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12c45d927aSAndrew Rist * 13c45d927aSAndrew Rist * Unless required by applicable law or agreed to in writing, 14c45d927aSAndrew Rist * software distributed under the License is distributed on an 15c45d927aSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16c45d927aSAndrew Rist * KIND, either express or implied. See the License for the 17c45d927aSAndrew Rist * specific language governing permissions and limitations 18c45d927aSAndrew Rist * under the License. 19c45d927aSAndrew Rist * 20c45d927aSAndrew Rist *************************************************************/ 21c45d927aSAndrew Rist 22c45d927aSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef SD_UNO_DRAW_VIEW_HXX 25cdf0e10cSrcweir #define SD_UNO_DRAW_VIEW_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include "DrawSubController.hxx" 28cdf0e10cSrcweir #include "DrawController.hxx" 29cdf0e10cSrcweir #include "DrawViewShell.hxx" 30cdf0e10cSrcweir #include <cppuhelper/basemutex.hxx> 31cdf0e10cSrcweir 32cdf0e10cSrcweir class SdXImpressDocument; 33cdf0e10cSrcweir class SdPage; 34cdf0e10cSrcweir 35cdf0e10cSrcweir namespace css = ::com::sun::star; 36cdf0e10cSrcweir 37cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace drawing { 38cdf0e10cSrcweir class XLayer; 39cdf0e10cSrcweir } } } } 40cdf0e10cSrcweir 41cdf0e10cSrcweir namespace sd { 42cdf0e10cSrcweir 43cdf0e10cSrcweir class DrawController; 44cdf0e10cSrcweir class DrawViewShell; 45cdf0e10cSrcweir 46cdf0e10cSrcweir /** This class implements the DrawViewShell specific part of the controller. 47cdf0e10cSrcweir */ 48cdf0e10cSrcweir class SdUnoDrawView 49cdf0e10cSrcweir : private cppu::BaseMutex, 50cdf0e10cSrcweir public DrawSubControllerInterfaceBase 51cdf0e10cSrcweir { 52cdf0e10cSrcweir public: 53cdf0e10cSrcweir SdUnoDrawView ( 54cdf0e10cSrcweir DrawController& rController, 55cdf0e10cSrcweir DrawViewShell& rViewShell, 56cdf0e10cSrcweir View& rView) throw(); 57cdf0e10cSrcweir virtual ~SdUnoDrawView (void) throw(); 58cdf0e10cSrcweir 59cdf0e10cSrcweir // XSelectionSupplier 60cdf0e10cSrcweir 61cdf0e10cSrcweir virtual sal_Bool SAL_CALL select ( 62cdf0e10cSrcweir const css::uno::Any& aSelection) 63cdf0e10cSrcweir throw(css::lang::IllegalArgumentException, 64cdf0e10cSrcweir css::uno::RuntimeException); 65cdf0e10cSrcweir 66cdf0e10cSrcweir virtual css::uno::Any SAL_CALL getSelection (void) 67cdf0e10cSrcweir throw(css::uno::RuntimeException); 68cdf0e10cSrcweir 69cdf0e10cSrcweir virtual void SAL_CALL addSelectionChangeListener ( 70cdf0e10cSrcweir const css::uno::Reference<css::view::XSelectionChangeListener>& rxListener) 71cdf0e10cSrcweir throw(css::uno::RuntimeException); 72cdf0e10cSrcweir 73cdf0e10cSrcweir virtual void SAL_CALL removeSelectionChangeListener ( 74cdf0e10cSrcweir const css::uno::Reference<css::view::XSelectionChangeListener>& rxListener) 75cdf0e10cSrcweir throw(css::uno::RuntimeException); 76cdf0e10cSrcweir 77cdf0e10cSrcweir 78cdf0e10cSrcweir // XDrawView 79cdf0e10cSrcweir 80cdf0e10cSrcweir virtual void SAL_CALL setCurrentPage ( 81cdf0e10cSrcweir const css::uno::Reference<css::drawing::XDrawPage >& xPage) 82cdf0e10cSrcweir throw(css::uno::RuntimeException); 83cdf0e10cSrcweir 84cdf0e10cSrcweir virtual css::uno::Reference<css::drawing::XDrawPage> SAL_CALL getCurrentPage (void) 85cdf0e10cSrcweir throw(css::uno::RuntimeException); 86cdf0e10cSrcweir 87cdf0e10cSrcweir 88cdf0e10cSrcweir // XFastPropertySet 89cdf0e10cSrcweir 90cdf0e10cSrcweir virtual void SAL_CALL setFastPropertyValue ( 91cdf0e10cSrcweir sal_Int32 nHandle, 92cdf0e10cSrcweir const css::uno::Any& rValue) 93cdf0e10cSrcweir throw(css::beans::UnknownPropertyException, 94cdf0e10cSrcweir css::beans::PropertyVetoException, 95cdf0e10cSrcweir css::lang::IllegalArgumentException, 96cdf0e10cSrcweir css::lang::WrappedTargetException, 97cdf0e10cSrcweir css::uno::RuntimeException); 98cdf0e10cSrcweir 99cdf0e10cSrcweir virtual css::uno::Any SAL_CALL getFastPropertyValue ( 100cdf0e10cSrcweir sal_Int32 nHandle) 101cdf0e10cSrcweir throw(css::beans::UnknownPropertyException, 102cdf0e10cSrcweir css::lang::WrappedTargetException, 103cdf0e10cSrcweir css::uno::RuntimeException); 104cdf0e10cSrcweir 105cdf0e10cSrcweir // XServiceInfo 106cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); 107cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); 108cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); 109cdf0e10cSrcweir 110cdf0e10cSrcweir protected: 111cdf0e10cSrcweir sal_Bool getMasterPageMode(void) const throw(); 112cdf0e10cSrcweir void setMasterPageMode(sal_Bool MasterPageMode_) throw(); 113cdf0e10cSrcweir sal_Bool getLayerMode(void) const throw(); 114cdf0e10cSrcweir void setLayerMode(sal_Bool LayerMode_) throw(); 115*0deba7fbSSteve Yin public: 116cdf0e10cSrcweir /** Return a reference to the active layer object. 117cdf0e10cSrcweir @return 118cdf0e10cSrcweir The returned value may be empty when the internal state of this 119cdf0e10cSrcweir view is not valid (like during destruction.) 120cdf0e10cSrcweir */ 121cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XLayer> getActiveLayer (void) throw (); 122*0deba7fbSSteve Yin protected: 123cdf0e10cSrcweir /** Make the specified object the active layer. 124cdf0e10cSrcweir @param rxLayer 125cdf0e10cSrcweir The new layer object. 126cdf0e10cSrcweir */ 127cdf0e10cSrcweir void setActiveLayer (const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XLayer>& rxLayer) throw (); 128cdf0e10cSrcweir 129cdf0e10cSrcweir void SetZoom( sal_Int16 nZoom ); 130cdf0e10cSrcweir sal_Int16 GetZoom(void) const; 131cdf0e10cSrcweir 132cdf0e10cSrcweir void SetViewOffset(const com::sun::star::awt::Point& rWinPos ); 133cdf0e10cSrcweir com::sun::star::awt::Point GetViewOffset() const; 134cdf0e10cSrcweir 135cdf0e10cSrcweir void SetZoomType( sal_Int16 nType ); 136cdf0e10cSrcweir 137cdf0e10cSrcweir ::com::sun::star::uno::Any getDrawViewMode() const; 138cdf0e10cSrcweir 139cdf0e10cSrcweir private: 140cdf0e10cSrcweir DrawController& mrController; 141cdf0e10cSrcweir DrawViewShell& mrDrawViewShell; 142cdf0e10cSrcweir sd::View& mrView; 143cdf0e10cSrcweir 144cdf0e10cSrcweir SdXImpressDocument* GetModel (void) const throw(); 145cdf0e10cSrcweir }; 146cdf0e10cSrcweir 147cdf0e10cSrcweir } // end of namespace sd 148cdf0e10cSrcweir 149cdf0e10cSrcweir #endif 150