CWS-TOOLING: integrate CWS os150
[LibreOffice.git] / sd / source / ui / toolpanel / controls / TableDesignPanel.cxx
blobd6507a25c11fecd7efa234d193cc6d5a5329959a
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"
31 #include "TableDesignPanel.hxx"
33 #include "taskpane/TaskPaneControlFactory.hxx"
34 #include "taskpane/ToolPanelViewShell.hxx"
36 #include "strings.hrc"
37 #include "sdresid.hxx"
39 namespace sd
42 class ViewShellBase;
43 extern ::Window * createTableDesignPanel( ::Window* pParent, ViewShellBase& rBase );
45 namespace toolpanel { namespace controls {
48 TableDesignPanel::TableDesignPanel( ::Window& i_rParentWindow, ToolPanelViewShell& i_rPanelViewShell )
49 :SubToolPanel( i_rParentWindow )
50 ,m_pPanelViewShell( &i_rPanelViewShell )
52 mpWrappedControl = createTableDesignPanel( &i_rParentWindow, i_rPanelViewShell.GetViewShellBase() );
53 mpWrappedControl->Show();
56 TableDesignPanel::~TableDesignPanel()
58 delete mpWrappedControl;
61 std::auto_ptr< ControlFactory > TableDesignPanel::CreateControlFactory( ToolPanelViewShell& i_rToolPanelShell )
63 return std::auto_ptr< ControlFactory >(
64 new RootControlFactoryWithArg< TableDesignPanel, ToolPanelViewShell >( i_rToolPanelShell ) );
67 TaskPaneShellManager* TableDesignPanel::GetShellManager()
69 if ( m_pPanelViewShell )
70 return &m_pPanelViewShell->GetSubShellManager();
71 return SubToolPanel::GetShellManager();
74 Size TableDesignPanel::GetPreferredSize()
76 return maPreferredSize;
78 sal_Int32 TableDesignPanel::GetPreferredWidth(sal_Int32 )
80 return maPreferredSize.Width();
82 sal_Int32 TableDesignPanel::GetPreferredHeight(sal_Int32 )
84 return maPreferredSize.Height();
86 ::Window* TableDesignPanel::GetWindow()
88 return mpWrappedControl;
90 bool TableDesignPanel::IsResizable()
92 return true;
94 bool TableDesignPanel::IsExpandable() const
96 return true;
99 ::com::sun::star::uno::Reference<
100 ::com::sun::star::accessibility::XAccessible> TableDesignPanel::CreateAccessibleObject (
101 const ::com::sun::star::uno::Reference<
102 ::com::sun::star::accessibility::XAccessible>& )
104 if (GetWindow() != NULL)
105 return GetWindow()->GetAccessible();
106 else
107 return NULL;
110 } } } // end of namespace ::sd::toolpanel::controls