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