1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_framework.hxx"
26 
27 //_________________________________________________________________________________________________________________
28 //	my own includes
29 //_________________________________________________________________________________________________________________
30 
31 #include "panelmanager.hxx"
32 #include "services.h"
33 #include "services/modelwinservice.hxx"
34 
35 //_________________________________________________________________________________________________________________
36 //	interface includes
37 //_________________________________________________________________________________________________________________
38 
39 
40 //_________________________________________________________________________________________________________________
41 //	other includes
42 //_________________________________________________________________________________________________________________
43 
44 #include <vcl/svapp.hxx>
45 #include <toolkit/helper/vclunohelper.hxx>
46 
47 //_________________________________________________________________________________________________________________
48 //	namespace
49 //_________________________________________________________________________________________________________________
50 
51 using namespace ::com::sun::star;
52 
53 namespace framework
54 {
55 
56 //_________________________________________________________________________________________________________________
57 //	non exported definitions
58 //_________________________________________________________________________________________________________________
59 
60 //_________________________________________________________________________________________________________________
61 //	declarations
62 //_________________________________________________________________________________________________________________
63 
64 
PanelManager(const::com::sun::star::uno::Reference<::com::sun::star::lang::XMultiServiceFactory> & rSMGR,const::com::sun::star::uno::Reference<::com::sun::star::frame::XFrame> & rFrame)65 PanelManager::PanelManager(
66     const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rSMGR,
67     const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame ) :
68     m_xSMGR( rSMGR ),
69     m_xFrame( rFrame )
70 {
71     m_aPanels[PANEL_TOP]    = 0;
72     m_aPanels[PANEL_BOTTOM] = 0;
73     m_aPanels[PANEL_LEFT]   = 0;
74     m_aPanels[PANEL_RIGHT]  = 0;
75 }
76 
~PanelManager()77 PanelManager::~PanelManager()
78 {
79 }
80 
81 //---------------------------------------------------------------------------------------------------------
82 // Creation and layouting
83 //---------------------------------------------------------------------------------------------------------
createPanels()84 bool PanelManager::createPanels()
85 {
86     if ( m_xFrame.is() )
87     {
88         vos::OGuard aGuard( Application::GetSolarMutex() );
89         uno::Reference< awt::XWindow > xWindow( m_xFrame->getContainerWindow(), uno::UNO_QUERY );
90         if ( xWindow.is() )
91         {
92             // destroy old panel windows
93             delete m_aPanels[PANEL_TOP   ];
94             delete m_aPanels[PANEL_BOTTOM];
95             delete m_aPanels[PANEL_LEFT  ];
96             delete m_aPanels[PANEL_RIGHT ];
97 
98             m_aPanels[PANEL_TOP   ] = new Panel( m_xSMGR, xWindow, PANEL_TOP    );
99             m_aPanels[PANEL_BOTTOM] = new Panel( m_xSMGR, xWindow, PANEL_BOTTOM );
100             m_aPanels[PANEL_LEFT  ] = new Panel( m_xSMGR, xWindow, PANEL_LEFT   );
101             m_aPanels[PANEL_RIGHT ] = new Panel( m_xSMGR, xWindow, PANEL_RIGHT  );
102             return true;
103         }
104     }
105 
106     return false;
107 }
108 
getPreferredSize() const109 awt::Rectangle PanelManager::getPreferredSize() const
110 {
111     return awt::Rectangle();
112 }
113 
layoutPanels(const awt::Rectangle)114 void PanelManager::layoutPanels( const awt::Rectangle /*newSize*/ )
115 {
116 }
117 
118 //---------------------------------------------------------------------------------------------------------
119 //  Panel functions
120 //---------------------------------------------------------------------------------------------------------
findDockingWindow(const::rtl::OUString &)121 UIElement* PanelManager::findDockingWindow( const ::rtl::OUString& /*rResourceName*/ )
122 {
123     return NULL;
124 }
125 
addDockingWindow(const::rtl::OUString &,const::com::sun::star::uno::Reference<::com::sun::star::ui::XUIElement> &)126 bool PanelManager::addDockingWindow( const ::rtl::OUString& /*rResourceName*/, const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement >& /*xUIElement*/ )
127 {
128     return false;
129 }
130 
destroyDockingWindow(const::rtl::OUString &)131 bool PanelManager::destroyDockingWindow( const ::rtl::OUString& /*rResourceName*/ )
132 {
133     return false;
134 }
135 
136 //---------------------------------------------------------------------------------------------------------
137 //  XDockableWindowListener
138 //---------------------------------------------------------------------------------------------------------
startDocking(const awt::DockingEvent &)139 void SAL_CALL PanelManager::startDocking( const awt::DockingEvent& )
140 throw (uno::RuntimeException)
141 {
142 }
143 
docking(const awt::DockingEvent &)144 awt::DockingData SAL_CALL PanelManager::docking( const awt::DockingEvent& )
145 throw (uno::RuntimeException)
146 {
147     return awt::DockingData();
148 }
149 
endDocking(const awt::EndDockingEvent &)150 void SAL_CALL PanelManager::endDocking( const awt::EndDockingEvent& )
151 throw (uno::RuntimeException)
152 {
153 }
154 
prepareToggleFloatingMode(const lang::EventObject &)155 sal_Bool SAL_CALL PanelManager::prepareToggleFloatingMode( const lang::EventObject& )
156 throw (uno::RuntimeException)
157 {
158     return false;
159 }
160 
toggleFloatingMode(const lang::EventObject &)161 void SAL_CALL PanelManager::toggleFloatingMode( const lang::EventObject& )
162 throw (uno::RuntimeException)
163 {
164 }
165 
closed(const lang::EventObject &)166 void SAL_CALL PanelManager::closed( const lang::EventObject& )
167 throw (uno::RuntimeException)
168 {
169 }
170 
endPopupMode(const awt::EndPopupModeEvent &)171 void SAL_CALL PanelManager::endPopupMode( const awt::EndPopupModeEvent& )
172 throw (uno::RuntimeException)
173 {
174 }
175 
176 } // namespace framework
177