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 "panel.hxx"
32 #include "helpers.hxx"
33 
34 //_________________________________________________________________________________________________________________
35 //	other includes
36 //_________________________________________________________________________________________________________________
37 
38 #include <vos/mutex.hxx>
39 #include <vcl/svapp.hxx>
40 #include <toolkit/helper/vclunohelper.hxx>
41 
42 //_________________________________________________________________________________________________________________
43 //	namespace
44 //_________________________________________________________________________________________________________________
45 
46 using namespace ::com::sun::star;
47 
48 namespace framework
49 {
50 
Panel(const uno::Reference<lang::XMultiServiceFactory> & rSMGR,const uno::Reference<awt::XWindow> & rParent,PanelPosition nPanel)51 Panel::Panel(
52     const uno::Reference< lang::XMultiServiceFactory >& rSMGR,
53     const uno::Reference< awt::XWindow >& rParent,
54     PanelPosition nPanel ) :
55     m_xSMGR(rSMGR), m_nPanelPosition(nPanel)
56 {
57     uno::Reference< awt::XWindowPeer > xWindowPeer( rParent, uno::UNO_QUERY );
58     m_xPanelWindow = uno::Reference< awt::XWindow >( createToolkitWindow( rSMGR, xWindowPeer, "splitwindow" ), uno::UNO_QUERY );
59 
60     vos::OGuard	aGuard( Application::GetSolarMutex() );
61     SplitWindow* pSplitWindow = dynamic_cast< SplitWindow* >( VCLUnoHelper::GetWindow( m_xPanelWindow ));
62 
63     if ( pSplitWindow )
64     {
65         // Set alignment
66         if (nPanel == PANEL_TOP)
67             pSplitWindow->SetAlign( WINDOWALIGN_TOP );
68         else if (nPanel == PANEL_BOTTOM)
69             pSplitWindow->SetAlign( WINDOWALIGN_BOTTOM );
70         else if (nPanel == PANEL_LEFT)
71             pSplitWindow->SetAlign( WINDOWALIGN_LEFT );
72         else
73             pSplitWindow->SetAlign( WINDOWALIGN_RIGHT );
74     }
75 }
76 
~Panel()77 Panel::~Panel()
78 {
79 }
80 
81 } // namespace framework
82