1*6d739b60SAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*6d739b60SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*6d739b60SAndrew Rist * or more contributor license agreements. See the NOTICE file
5*6d739b60SAndrew Rist * distributed with this work for additional information
6*6d739b60SAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*6d739b60SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*6d739b60SAndrew Rist * "License"); you may not use this file except in compliance
9*6d739b60SAndrew Rist * with the License. You may obtain a copy of the License at
10cdf0e10cSrcweir *
11*6d739b60SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir *
13*6d739b60SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*6d739b60SAndrew Rist * software distributed under the License is distributed on an
15*6d739b60SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*6d739b60SAndrew Rist * KIND, either express or implied. See the License for the
17*6d739b60SAndrew Rist * specific language governing permissions and limitations
18*6d739b60SAndrew Rist * under the License.
19cdf0e10cSrcweir *
20*6d739b60SAndrew Rist *************************************************************/
21*6d739b60SAndrew Rist
22*6d739b60SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_framework.hxx"
26cdf0e10cSrcweir
27cdf0e10cSrcweir //_________________________________________________________________________________________________________________
28cdf0e10cSrcweir // my own includes
29cdf0e10cSrcweir //_________________________________________________________________________________________________________________
30cdf0e10cSrcweir
31cdf0e10cSrcweir #include "panel.hxx"
32cdf0e10cSrcweir #include "helpers.hxx"
33cdf0e10cSrcweir
34cdf0e10cSrcweir //_________________________________________________________________________________________________________________
35cdf0e10cSrcweir // other includes
36cdf0e10cSrcweir //_________________________________________________________________________________________________________________
37cdf0e10cSrcweir
38cdf0e10cSrcweir #include <vos/mutex.hxx>
39cdf0e10cSrcweir #include <vcl/svapp.hxx>
40cdf0e10cSrcweir #include <toolkit/unohlp.hxx>
41cdf0e10cSrcweir
42cdf0e10cSrcweir //_________________________________________________________________________________________________________________
43cdf0e10cSrcweir // namespace
44cdf0e10cSrcweir //_________________________________________________________________________________________________________________
45cdf0e10cSrcweir
46cdf0e10cSrcweir using namespace ::com::sun::star;
47cdf0e10cSrcweir
48cdf0e10cSrcweir namespace framework
49cdf0e10cSrcweir {
50cdf0e10cSrcweir
Panel(const uno::Reference<lang::XMultiServiceFactory> & rSMGR,const uno::Reference<awt::XWindow> & rParent,PanelPosition nPanel)51cdf0e10cSrcweir Panel::Panel(
52cdf0e10cSrcweir const uno::Reference< lang::XMultiServiceFactory >& rSMGR,
53cdf0e10cSrcweir const uno::Reference< awt::XWindow >& rParent,
54cdf0e10cSrcweir PanelPosition nPanel ) :
55cdf0e10cSrcweir m_xSMGR(rSMGR), m_nPanelPosition(nPanel)
56cdf0e10cSrcweir {
57cdf0e10cSrcweir uno::Reference< awt::XWindowPeer > xWindowPeer( rParent, uno::UNO_QUERY );
58cdf0e10cSrcweir m_xPanelWindow = uno::Reference< awt::XWindow >( createToolkitWindow( rSMGR, xWindowPeer, "splitwindow" ), uno::UNO_QUERY );
59cdf0e10cSrcweir
60cdf0e10cSrcweir vos::OGuard aGuard( Application::GetSolarMutex() );
61cdf0e10cSrcweir SplitWindow* pSplitWindow = dynamic_cast< SplitWindow* >( VCLUnoHelper::GetWindow( m_xPanelWindow ));
62cdf0e10cSrcweir
63cdf0e10cSrcweir if ( pSplitWindow )
64cdf0e10cSrcweir {
65cdf0e10cSrcweir // Set alignment
66cdf0e10cSrcweir if (nPanel == PANEL_TOP)
67cdf0e10cSrcweir pSplitWindow->SetAlign( WINDOWALIGN_TOP );
68cdf0e10cSrcweir else if (nPanel == PANEL_BOTTOM)
69cdf0e10cSrcweir pSplitWindow->SetAlign( WINDOWALIGN_BOTTOM );
70cdf0e10cSrcweir else if (nPanel == PANEL_LEFT)
71cdf0e10cSrcweir pSplitWindow->SetAlign( WINDOWALIGN_LEFT );
72cdf0e10cSrcweir else
73cdf0e10cSrcweir pSplitWindow->SetAlign( WINDOWALIGN_RIGHT );
74cdf0e10cSrcweir }
75cdf0e10cSrcweir }
76cdf0e10cSrcweir
~Panel()77cdf0e10cSrcweir Panel::~Panel()
78cdf0e10cSrcweir {
79cdf0e10cSrcweir }
80cdf0e10cSrcweir
81cdf0e10cSrcweir } // namespace framework
82