xref: /AOO41X/main/framework/source/layoutmanager/panelmanager.cxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2008 by Sun Microsystems, Inc.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * $RCSfile: layoutmanager.hxx,v $
10*cdf0e10cSrcweir  * $Revision: 1.34 $
11*cdf0e10cSrcweir  *
12*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
13*cdf0e10cSrcweir  *
14*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
15*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
16*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
17*cdf0e10cSrcweir  *
18*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
19*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
22*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
23*cdf0e10cSrcweir  *
24*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
25*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
26*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
27*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
28*cdf0e10cSrcweir  *
29*cdf0e10cSrcweir  ************************************************************************/
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
32*cdf0e10cSrcweir #include "precompiled_framework.hxx"
33*cdf0e10cSrcweir 
34*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
35*cdf0e10cSrcweir //	my own includes
36*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
37*cdf0e10cSrcweir 
38*cdf0e10cSrcweir #include "panelmanager.hxx"
39*cdf0e10cSrcweir #include "services.h"
40*cdf0e10cSrcweir #include "services/modelwinservice.hxx"
41*cdf0e10cSrcweir 
42*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
43*cdf0e10cSrcweir //	interface includes
44*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
45*cdf0e10cSrcweir 
46*cdf0e10cSrcweir 
47*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
48*cdf0e10cSrcweir //	other includes
49*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir #include <vcl/svapp.hxx>
52*cdf0e10cSrcweir #include <toolkit/unohlp.hxx>
53*cdf0e10cSrcweir 
54*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
55*cdf0e10cSrcweir //	namespace
56*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
57*cdf0e10cSrcweir 
58*cdf0e10cSrcweir using namespace ::com::sun::star;
59*cdf0e10cSrcweir 
60*cdf0e10cSrcweir namespace framework
61*cdf0e10cSrcweir {
62*cdf0e10cSrcweir 
63*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
64*cdf0e10cSrcweir //	non exported definitions
65*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
66*cdf0e10cSrcweir 
67*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
68*cdf0e10cSrcweir //	declarations
69*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
70*cdf0e10cSrcweir 
71*cdf0e10cSrcweir 
72*cdf0e10cSrcweir PanelManager::PanelManager(
73*cdf0e10cSrcweir     const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rSMGR,
74*cdf0e10cSrcweir     const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame ) :
75*cdf0e10cSrcweir     m_xSMGR( rSMGR ),
76*cdf0e10cSrcweir     m_xFrame( rFrame )
77*cdf0e10cSrcweir {
78*cdf0e10cSrcweir     m_aPanels[PANEL_TOP]    = 0;
79*cdf0e10cSrcweir     m_aPanels[PANEL_BOTTOM] = 0;
80*cdf0e10cSrcweir     m_aPanels[PANEL_LEFT]   = 0;
81*cdf0e10cSrcweir     m_aPanels[PANEL_RIGHT]  = 0;
82*cdf0e10cSrcweir }
83*cdf0e10cSrcweir 
84*cdf0e10cSrcweir PanelManager::~PanelManager()
85*cdf0e10cSrcweir {
86*cdf0e10cSrcweir }
87*cdf0e10cSrcweir 
88*cdf0e10cSrcweir //---------------------------------------------------------------------------------------------------------
89*cdf0e10cSrcweir // Creation and layouting
90*cdf0e10cSrcweir //---------------------------------------------------------------------------------------------------------
91*cdf0e10cSrcweir bool PanelManager::createPanels()
92*cdf0e10cSrcweir {
93*cdf0e10cSrcweir     if ( m_xFrame.is() )
94*cdf0e10cSrcweir     {
95*cdf0e10cSrcweir         vos::OGuard aGuard( Application::GetSolarMutex() );
96*cdf0e10cSrcweir         uno::Reference< awt::XWindow > xWindow( m_xFrame->getContainerWindow(), uno::UNO_QUERY );
97*cdf0e10cSrcweir         if ( xWindow.is() )
98*cdf0e10cSrcweir         {
99*cdf0e10cSrcweir             // destroy old panel windows
100*cdf0e10cSrcweir             delete m_aPanels[PANEL_TOP   ];
101*cdf0e10cSrcweir             delete m_aPanels[PANEL_BOTTOM];
102*cdf0e10cSrcweir             delete m_aPanels[PANEL_LEFT  ];
103*cdf0e10cSrcweir             delete m_aPanels[PANEL_RIGHT ];
104*cdf0e10cSrcweir 
105*cdf0e10cSrcweir             m_aPanels[PANEL_TOP   ] = new Panel( m_xSMGR, xWindow, PANEL_TOP    );
106*cdf0e10cSrcweir             m_aPanels[PANEL_BOTTOM] = new Panel( m_xSMGR, xWindow, PANEL_BOTTOM );
107*cdf0e10cSrcweir             m_aPanels[PANEL_LEFT  ] = new Panel( m_xSMGR, xWindow, PANEL_LEFT   );
108*cdf0e10cSrcweir             m_aPanels[PANEL_RIGHT ] = new Panel( m_xSMGR, xWindow, PANEL_RIGHT  );
109*cdf0e10cSrcweir             return true;
110*cdf0e10cSrcweir         }
111*cdf0e10cSrcweir     }
112*cdf0e10cSrcweir 
113*cdf0e10cSrcweir     return false;
114*cdf0e10cSrcweir }
115*cdf0e10cSrcweir 
116*cdf0e10cSrcweir awt::Rectangle PanelManager::getPreferredSize() const
117*cdf0e10cSrcweir {
118*cdf0e10cSrcweir     return awt::Rectangle();
119*cdf0e10cSrcweir }
120*cdf0e10cSrcweir 
121*cdf0e10cSrcweir void PanelManager::layoutPanels( const awt::Rectangle /*newSize*/ )
122*cdf0e10cSrcweir {
123*cdf0e10cSrcweir }
124*cdf0e10cSrcweir 
125*cdf0e10cSrcweir //---------------------------------------------------------------------------------------------------------
126*cdf0e10cSrcweir //  Panel functions
127*cdf0e10cSrcweir //---------------------------------------------------------------------------------------------------------
128*cdf0e10cSrcweir UIElement* PanelManager::findDockingWindow( const ::rtl::OUString& /*rResourceName*/ )
129*cdf0e10cSrcweir {
130*cdf0e10cSrcweir     return NULL;
131*cdf0e10cSrcweir }
132*cdf0e10cSrcweir 
133*cdf0e10cSrcweir bool PanelManager::addDockingWindow( const ::rtl::OUString& /*rResourceName*/, const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement >& /*xUIElement*/ )
134*cdf0e10cSrcweir {
135*cdf0e10cSrcweir     return false;
136*cdf0e10cSrcweir }
137*cdf0e10cSrcweir 
138*cdf0e10cSrcweir bool PanelManager::destroyDockingWindow( const ::rtl::OUString& /*rResourceName*/ )
139*cdf0e10cSrcweir {
140*cdf0e10cSrcweir     return false;
141*cdf0e10cSrcweir }
142*cdf0e10cSrcweir 
143*cdf0e10cSrcweir //---------------------------------------------------------------------------------------------------------
144*cdf0e10cSrcweir //  XDockableWindowListener
145*cdf0e10cSrcweir //---------------------------------------------------------------------------------------------------------
146*cdf0e10cSrcweir void SAL_CALL PanelManager::startDocking( const awt::DockingEvent& )
147*cdf0e10cSrcweir throw (uno::RuntimeException)
148*cdf0e10cSrcweir {
149*cdf0e10cSrcweir }
150*cdf0e10cSrcweir 
151*cdf0e10cSrcweir awt::DockingData SAL_CALL PanelManager::docking( const awt::DockingEvent& )
152*cdf0e10cSrcweir throw (uno::RuntimeException)
153*cdf0e10cSrcweir {
154*cdf0e10cSrcweir     return awt::DockingData();
155*cdf0e10cSrcweir }
156*cdf0e10cSrcweir 
157*cdf0e10cSrcweir void SAL_CALL PanelManager::endDocking( const awt::EndDockingEvent& )
158*cdf0e10cSrcweir throw (uno::RuntimeException)
159*cdf0e10cSrcweir {
160*cdf0e10cSrcweir }
161*cdf0e10cSrcweir 
162*cdf0e10cSrcweir sal_Bool SAL_CALL PanelManager::prepareToggleFloatingMode( const lang::EventObject& )
163*cdf0e10cSrcweir throw (uno::RuntimeException)
164*cdf0e10cSrcweir {
165*cdf0e10cSrcweir     return false;
166*cdf0e10cSrcweir }
167*cdf0e10cSrcweir 
168*cdf0e10cSrcweir void SAL_CALL PanelManager::toggleFloatingMode( const lang::EventObject& )
169*cdf0e10cSrcweir throw (uno::RuntimeException)
170*cdf0e10cSrcweir {
171*cdf0e10cSrcweir }
172*cdf0e10cSrcweir 
173*cdf0e10cSrcweir void SAL_CALL PanelManager::closed( const lang::EventObject& )
174*cdf0e10cSrcweir throw (uno::RuntimeException)
175*cdf0e10cSrcweir {
176*cdf0e10cSrcweir }
177*cdf0e10cSrcweir 
178*cdf0e10cSrcweir void SAL_CALL PanelManager::endPopupMode( const awt::EndPopupModeEvent& )
179*cdf0e10cSrcweir throw (uno::RuntimeException)
180*cdf0e10cSrcweir {
181*cdf0e10cSrcweir }
182*cdf0e10cSrcweir 
183*cdf0e10cSrcweir } // namespace framework
184