merge the formfield patch from ooo-build
[ooovba.git] / sd / source / ui / toolpanel / controls / SlideTransitionPanel.cxx
blob4c09330ecccce8e9bbd5f7f074cfba5674ec7f27
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: SlideTransitionPanel.cxx,v $
10 * $Revision: 1.8 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sd.hxx"
33 #include "SlideTransitionPanel.hxx"
35 #include "taskpane/TaskPaneControlFactory.hxx"
37 #include "strings.hrc"
38 #include "sdresid.hxx"
39 #include <com/sun/star/frame/XModel.hpp>
41 namespace sd
44 class ViewShellBase;
45 extern ::Window * createSlideTransitionPanel( ::Window* pParent, ViewShellBase& rBase );
47 namespace toolpanel { namespace controls {
51 SlideTransitionPanel::SlideTransitionPanel(TreeNode* pParent, ViewShellBase& rBase)
52 : SubToolPanel (pParent),
53 maPreferredSize( 100, 200 )
55 mpWrappedControl = createSlideTransitionPanel( pParent->GetWindow(), rBase );
56 mpWrappedControl->Show();
59 SlideTransitionPanel::~SlideTransitionPanel()
61 delete mpWrappedControl;
64 std::auto_ptr<ControlFactory> SlideTransitionPanel::CreateControlFactory (ViewShellBase& rBase)
66 return std::auto_ptr<ControlFactory>(
67 new ControlFactoryWithArgs1<SlideTransitionPanel,ViewShellBase>(rBase));
70 Size SlideTransitionPanel::GetPreferredSize()
72 return maPreferredSize;
74 sal_Int32 SlideTransitionPanel::GetPreferredWidth(sal_Int32 )
76 return maPreferredSize.Width();
78 sal_Int32 SlideTransitionPanel::GetPreferredHeight(sal_Int32 )
80 return maPreferredSize.Height();
82 ::Window* SlideTransitionPanel::GetWindow()
84 return mpWrappedControl;
86 bool SlideTransitionPanel::IsResizable()
88 return true;
90 bool SlideTransitionPanel::IsExpandable() const
92 return true;
98 ::com::sun::star::uno::Reference<
99 ::com::sun::star::accessibility::XAccessible> SlideTransitionPanel::CreateAccessibleObject (
100 const ::com::sun::star::uno::Reference<
101 ::com::sun::star::accessibility::XAccessible>& )
103 if (GetWindow() != NULL)
104 return GetWindow()->GetAccessible();
105 else
106 return NULL;
110 } } } // end of namespace ::sd::toolpanel::controls