1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef SD_UNO_DRAW_VIEW_HXX 29 #define SD_UNO_DRAW_VIEW_HXX 30 31 #include "DrawSubController.hxx" 32 #include "DrawController.hxx" 33 #include "DrawViewShell.hxx" 34 #include <cppuhelper/basemutex.hxx> 35 36 class SdXImpressDocument; 37 class SdPage; 38 39 namespace css = ::com::sun::star; 40 41 namespace com { namespace sun { namespace star { namespace drawing { 42 class XLayer; 43 } } } } 44 45 namespace sd { 46 47 class DrawController; 48 class DrawViewShell; 49 50 /** This class implements the DrawViewShell specific part of the controller. 51 */ 52 class SdUnoDrawView 53 : private cppu::BaseMutex, 54 public DrawSubControllerInterfaceBase 55 { 56 public: 57 SdUnoDrawView ( 58 DrawController& rController, 59 DrawViewShell& rViewShell, 60 View& rView) throw(); 61 virtual ~SdUnoDrawView (void) throw(); 62 63 // XSelectionSupplier 64 65 virtual sal_Bool SAL_CALL select ( 66 const css::uno::Any& aSelection) 67 throw(css::lang::IllegalArgumentException, 68 css::uno::RuntimeException); 69 70 virtual css::uno::Any SAL_CALL getSelection (void) 71 throw(css::uno::RuntimeException); 72 73 virtual void SAL_CALL addSelectionChangeListener ( 74 const css::uno::Reference<css::view::XSelectionChangeListener>& rxListener) 75 throw(css::uno::RuntimeException); 76 77 virtual void SAL_CALL removeSelectionChangeListener ( 78 const css::uno::Reference<css::view::XSelectionChangeListener>& rxListener) 79 throw(css::uno::RuntimeException); 80 81 82 // XDrawView 83 84 virtual void SAL_CALL setCurrentPage ( 85 const css::uno::Reference<css::drawing::XDrawPage >& xPage) 86 throw(css::uno::RuntimeException); 87 88 virtual css::uno::Reference<css::drawing::XDrawPage> SAL_CALL getCurrentPage (void) 89 throw(css::uno::RuntimeException); 90 91 92 // XFastPropertySet 93 94 virtual void SAL_CALL setFastPropertyValue ( 95 sal_Int32 nHandle, 96 const css::uno::Any& rValue) 97 throw(css::beans::UnknownPropertyException, 98 css::beans::PropertyVetoException, 99 css::lang::IllegalArgumentException, 100 css::lang::WrappedTargetException, 101 css::uno::RuntimeException); 102 103 virtual css::uno::Any SAL_CALL getFastPropertyValue ( 104 sal_Int32 nHandle) 105 throw(css::beans::UnknownPropertyException, 106 css::lang::WrappedTargetException, 107 css::uno::RuntimeException); 108 109 // XServiceInfo 110 virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); 111 virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); 112 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); 113 114 protected: 115 sal_Bool getMasterPageMode(void) const throw(); 116 void setMasterPageMode(sal_Bool MasterPageMode_) throw(); 117 sal_Bool getLayerMode(void) const throw(); 118 void setLayerMode(sal_Bool LayerMode_) throw(); 119 120 /** Return a reference to the active layer object. 121 @return 122 The returned value may be empty when the internal state of this 123 view is not valid (like during destruction.) 124 */ 125 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XLayer> getActiveLayer (void) throw (); 126 127 /** Make the specified object the active layer. 128 @param rxLayer 129 The new layer object. 130 */ 131 void setActiveLayer (const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XLayer>& rxLayer) throw (); 132 133 void SetZoom( sal_Int16 nZoom ); 134 sal_Int16 GetZoom(void) const; 135 136 void SetViewOffset(const com::sun::star::awt::Point& rWinPos ); 137 com::sun::star::awt::Point GetViewOffset() const; 138 139 void SetZoomType( sal_Int16 nType ); 140 141 ::com::sun::star::uno::Any getDrawViewMode() const; 142 143 private: 144 DrawController& mrController; 145 DrawViewShell& mrDrawViewShell; 146 sd::View& mrView; 147 148 SdXImpressDocument* GetModel (void) const throw(); 149 }; 150 151 } // end of namespace sd 152 153 #endif 154