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 <uielement/panelwindow.hxx>
32 
33 namespace framework
34 {
35 
PanelWindow(Window * pParent,WinBits nWinBits)36 PanelWindow::PanelWindow( Window* pParent, WinBits nWinBits ) :
37 	DockingWindow( pParent, nWinBits )
38 {
39 }
40 
~PanelWindow()41 PanelWindow::~PanelWindow()
42 {
43 }
44 
getResourceURL() const45 const ::rtl::OUString& PanelWindow::getResourceURL() const
46 {
47 	return m_aResourceURL;
48 }
49 
setResourceURL(const::rtl::OUString & rResourceURL)50 void PanelWindow::setResourceURL(const ::rtl::OUString& rResourceURL)
51 {
52 	m_aResourceURL = rResourceURL;
53 }
54 
getContentWindow() const55 Window* PanelWindow::getContentWindow() const
56 {
57 	return m_pContentWindow;
58 }
59 
setContentWindow(Window * pContentWindow)60 void PanelWindow::setContentWindow( Window* pContentWindow )
61 {
62 	m_pContentWindow = pContentWindow;
63 	if ( m_pContentWindow != NULL )
64 	{
65 		m_pContentWindow->SetParent(this);
66 		m_pContentWindow->SetSizePixel( GetOutputSizePixel() );
67 		m_pContentWindow->Show();
68 	}
69 }
70 
Command(const CommandEvent & rCEvt)71 void PanelWindow::Command( const CommandEvent& rCEvt )
72 {
73 	if ( m_aCommandHandler.IsSet() )
74 		m_aCommandHandler.Call( (void *)( &rCEvt ));
75 	DockingWindow::Command( rCEvt );
76 }
77 
StateChanged(StateChangedType nType)78 void PanelWindow::StateChanged( StateChangedType nType )
79 {
80 	DockingWindow::StateChanged( nType );
81 	if ( m_aStateChangedHandler.IsSet() )
82 		m_aStateChangedHandler.Call( &nType );
83 }
84 
DataChanged(const DataChangedEvent & rDCEvt)85 void PanelWindow::DataChanged( const DataChangedEvent& rDCEvt )
86 {
87 	DockingWindow::DataChanged( rDCEvt );
88 	if ( m_aDataChangedHandler.IsSet() )
89 		m_aDataChangedHandler.Call( (void*)&rDCEvt );
90 }
91 
Resize()92 void PanelWindow::Resize()
93 {
94 	DockingWindow::Resize();
95 	if ( m_pContentWindow )
96 		m_pContentWindow->SetSizePixel( GetOutputSizePixel() );
97 }
98 
99 }
100