Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 :
21 : #include "TableDesignPanel.hxx"
22 :
23 : #include "taskpane/TaskPaneControlFactory.hxx"
24 : #include "taskpane/ToolPanelViewShell.hxx"
25 :
26 : #include "strings.hrc"
27 : #include "sdresid.hxx"
28 :
29 : namespace sd
30 : {
31 :
32 : class ViewShellBase;
33 : extern ::Window * createTableDesignPanel( ::Window* pParent, ViewShellBase& rBase );
34 :
35 : namespace toolpanel { namespace controls {
36 :
37 :
38 0 : TableDesignPanel::TableDesignPanel( ::Window& i_rParentWindow, ToolPanelViewShell& i_rPanelViewShell )
39 : :SubToolPanel( i_rParentWindow )
40 0 : ,m_pPanelViewShell( &i_rPanelViewShell )
41 : {
42 0 : mpWrappedControl = createTableDesignPanel( &i_rParentWindow, i_rPanelViewShell.GetViewShellBase() );
43 0 : mpWrappedControl->Show();
44 0 : }
45 :
46 0 : TableDesignPanel::~TableDesignPanel()
47 : {
48 0 : delete mpWrappedControl;
49 0 : }
50 :
51 0 : std::auto_ptr< ControlFactory > TableDesignPanel::CreateControlFactory( ToolPanelViewShell& i_rToolPanelShell )
52 : {
53 : return std::auto_ptr< ControlFactory >(
54 0 : new RootControlFactoryWithArg< TableDesignPanel, ToolPanelViewShell >( i_rToolPanelShell ) );
55 : }
56 :
57 0 : TaskPaneShellManager* TableDesignPanel::GetShellManager()
58 : {
59 0 : if ( m_pPanelViewShell )
60 0 : return &m_pPanelViewShell->GetSubShellManager();
61 0 : return SubToolPanel::GetShellManager();
62 : }
63 :
64 0 : Size TableDesignPanel::GetPreferredSize()
65 : {
66 0 : return maPreferredSize;
67 : }
68 0 : sal_Int32 TableDesignPanel::GetPreferredWidth(sal_Int32 )
69 : {
70 0 : return maPreferredSize.Width();
71 : }
72 0 : sal_Int32 TableDesignPanel::GetPreferredHeight(sal_Int32 )
73 : {
74 0 : return maPreferredSize.Height();
75 : }
76 0 : ::Window* TableDesignPanel::GetWindow()
77 : {
78 0 : return mpWrappedControl;
79 : }
80 0 : bool TableDesignPanel::IsResizable()
81 : {
82 0 : return true;
83 : }
84 0 : bool TableDesignPanel::IsExpandable() const
85 : {
86 0 : return true;
87 : }
88 :
89 : ::com::sun::star::uno::Reference<
90 0 : ::com::sun::star::accessibility::XAccessible> TableDesignPanel::CreateAccessibleObject (
91 : const ::com::sun::star::uno::Reference<
92 : ::com::sun::star::accessibility::XAccessible>& )
93 : {
94 0 : if (GetWindow() != NULL)
95 0 : return GetWindow()->GetAccessible();
96 : else
97 0 : return NULL;
98 : }
99 :
100 : } } } // end of namespace ::sd::toolpanel::controls
101 :
102 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|