1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2008 by Sun Microsystems, Inc. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * $RCSfile: layoutmanager.hxx,v $ 10 * $Revision: 1.34 $ 11 * 12 * This file is part of OpenOffice.org. 13 * 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. 17 * 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). 23 * 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. 28 * 29 ************************************************************************/ 30 31 // MARKER(update_precomp.py): autogen include statement, do not remove 32 #include "precompiled_framework.hxx" 33 34 //_________________________________________________________________________________________________________________ 35 // my own includes 36 //_________________________________________________________________________________________________________________ 37 38 #include "panelmanager.hxx" 39 #include "services.h" 40 #include "services/modelwinservice.hxx" 41 42 //_________________________________________________________________________________________________________________ 43 // interface includes 44 //_________________________________________________________________________________________________________________ 45 46 47 //_________________________________________________________________________________________________________________ 48 // other includes 49 //_________________________________________________________________________________________________________________ 50 51 #include <vcl/svapp.hxx> 52 #include <toolkit/unohlp.hxx> 53 54 //_________________________________________________________________________________________________________________ 55 // namespace 56 //_________________________________________________________________________________________________________________ 57 58 using namespace ::com::sun::star; 59 60 namespace framework 61 { 62 63 //_________________________________________________________________________________________________________________ 64 // non exported definitions 65 //_________________________________________________________________________________________________________________ 66 67 //_________________________________________________________________________________________________________________ 68 // declarations 69 //_________________________________________________________________________________________________________________ 70 71 72 PanelManager::PanelManager( 73 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rSMGR, 74 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame ) : 75 m_xSMGR( rSMGR ), 76 m_xFrame( rFrame ) 77 { 78 m_aPanels[PANEL_TOP] = 0; 79 m_aPanels[PANEL_BOTTOM] = 0; 80 m_aPanels[PANEL_LEFT] = 0; 81 m_aPanels[PANEL_RIGHT] = 0; 82 } 83 84 PanelManager::~PanelManager() 85 { 86 } 87 88 //--------------------------------------------------------------------------------------------------------- 89 // Creation and layouting 90 //--------------------------------------------------------------------------------------------------------- 91 bool PanelManager::createPanels() 92 { 93 if ( m_xFrame.is() ) 94 { 95 vos::OGuard aGuard( Application::GetSolarMutex() ); 96 uno::Reference< awt::XWindow > xWindow( m_xFrame->getContainerWindow(), uno::UNO_QUERY ); 97 if ( xWindow.is() ) 98 { 99 // destroy old panel windows 100 delete m_aPanels[PANEL_TOP ]; 101 delete m_aPanels[PANEL_BOTTOM]; 102 delete m_aPanels[PANEL_LEFT ]; 103 delete m_aPanels[PANEL_RIGHT ]; 104 105 m_aPanels[PANEL_TOP ] = new Panel( m_xSMGR, xWindow, PANEL_TOP ); 106 m_aPanels[PANEL_BOTTOM] = new Panel( m_xSMGR, xWindow, PANEL_BOTTOM ); 107 m_aPanels[PANEL_LEFT ] = new Panel( m_xSMGR, xWindow, PANEL_LEFT ); 108 m_aPanels[PANEL_RIGHT ] = new Panel( m_xSMGR, xWindow, PANEL_RIGHT ); 109 return true; 110 } 111 } 112 113 return false; 114 } 115 116 awt::Rectangle PanelManager::getPreferredSize() const 117 { 118 return awt::Rectangle(); 119 } 120 121 void PanelManager::layoutPanels( const awt::Rectangle /*newSize*/ ) 122 { 123 } 124 125 //--------------------------------------------------------------------------------------------------------- 126 // Panel functions 127 //--------------------------------------------------------------------------------------------------------- 128 UIElement* PanelManager::findDockingWindow( const ::rtl::OUString& /*rResourceName*/ ) 129 { 130 return NULL; 131 } 132 133 bool PanelManager::addDockingWindow( const ::rtl::OUString& /*rResourceName*/, const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement >& /*xUIElement*/ ) 134 { 135 return false; 136 } 137 138 bool PanelManager::destroyDockingWindow( const ::rtl::OUString& /*rResourceName*/ ) 139 { 140 return false; 141 } 142 143 //--------------------------------------------------------------------------------------------------------- 144 // XDockableWindowListener 145 //--------------------------------------------------------------------------------------------------------- 146 void SAL_CALL PanelManager::startDocking( const awt::DockingEvent& ) 147 throw (uno::RuntimeException) 148 { 149 } 150 151 awt::DockingData SAL_CALL PanelManager::docking( const awt::DockingEvent& ) 152 throw (uno::RuntimeException) 153 { 154 return awt::DockingData(); 155 } 156 157 void SAL_CALL PanelManager::endDocking( const awt::EndDockingEvent& ) 158 throw (uno::RuntimeException) 159 { 160 } 161 162 sal_Bool SAL_CALL PanelManager::prepareToggleFloatingMode( const lang::EventObject& ) 163 throw (uno::RuntimeException) 164 { 165 return false; 166 } 167 168 void SAL_CALL PanelManager::toggleFloatingMode( const lang::EventObject& ) 169 throw (uno::RuntimeException) 170 { 171 } 172 173 void SAL_CALL PanelManager::closed( const lang::EventObject& ) 174 throw (uno::RuntimeException) 175 { 176 } 177 178 void SAL_CALL PanelManager::endPopupMode( const awt::EndPopupModeEvent& ) 179 throw (uno::RuntimeException) 180 { 181 } 182 183 } // namespace framework 184