1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_sd.hxx"
30 #include "SlideTransitionPanel.hxx"
32 #include "taskpane/TaskPaneControlFactory.hxx"
33 #include "taskpane/ToolPanelViewShell.hxx"
35 #include "strings.hrc"
36 #include "sdresid.hxx"
37 #include <com/sun/star/frame/XModel.hpp>
43 extern ::Window
* createSlideTransitionPanel( ::Window
* pParent
, ViewShellBase
& rBase
);
45 namespace toolpanel
{ namespace controls
{
49 SlideTransitionPanel::SlideTransitionPanel(Window
& i_rParentWindow
, ToolPanelViewShell
& i_rToolPanelShell
)
50 :SubToolPanel( i_rParentWindow
)
51 ,maPreferredSize( 100, 200 )
52 ,m_pPanelViewShell( &i_rToolPanelShell
)
54 mpWrappedControl
= createSlideTransitionPanel( &i_rParentWindow
, i_rToolPanelShell
.GetViewShellBase() );
55 mpWrappedControl
->Show();
58 SlideTransitionPanel::~SlideTransitionPanel()
60 delete mpWrappedControl
;
63 std::auto_ptr
< ControlFactory
> SlideTransitionPanel::CreateControlFactory( ToolPanelViewShell
& i_rToolPanelShell
)
65 return std::auto_ptr
< ControlFactory
>(
66 new RootControlFactoryWithArg
< SlideTransitionPanel
, ToolPanelViewShell
>( i_rToolPanelShell
) );
69 TaskPaneShellManager
* SlideTransitionPanel::GetShellManager()
71 if ( m_pPanelViewShell
)
72 return &m_pPanelViewShell
->GetSubShellManager();
73 return SubToolPanel::GetShellManager();
76 Size
SlideTransitionPanel::GetPreferredSize()
78 return maPreferredSize
;
80 sal_Int32
SlideTransitionPanel::GetPreferredWidth(sal_Int32
)
82 return maPreferredSize
.Width();
84 sal_Int32
SlideTransitionPanel::GetPreferredHeight(sal_Int32
)
86 return maPreferredSize
.Height();
88 ::Window
* SlideTransitionPanel::GetWindow()
90 return mpWrappedControl
;
92 bool SlideTransitionPanel::IsResizable()
96 bool SlideTransitionPanel::IsExpandable() const
104 ::com::sun::star::uno::Reference
<
105 ::com::sun::star::accessibility::XAccessible
> SlideTransitionPanel::CreateAccessibleObject (
106 const ::com::sun::star::uno::Reference
<
107 ::com::sun::star::accessibility::XAccessible
>& )
109 if (GetWindow() != NULL
)
110 return GetWindow()->GetAccessible();
116 } } } // end of namespace ::sd::toolpanel::controls