1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include "CustomAnimationPanel.hxx"
23 #include "taskpane/TaskPaneControlFactory.hxx"
24 #include "taskpane/ToolPanelViewShell.hxx"
26 #include "strings.hrc"
27 #include "sdresid.hxx"
33 extern ::Window
* createCustomAnimationPanel( ::Window
* pParent
, ViewShellBase
& rBase
);
35 namespace toolpanel
{ namespace controls
{
38 CustomAnimationPanel::CustomAnimationPanel(Window
& i_rParentWindow
, ToolPanelViewShell
& i_rPanelViewShell
)
39 :SubToolPanel( i_rParentWindow
)
40 ,m_pPanelViewShell( &i_rPanelViewShell
)
42 mpWrappedControl
= createCustomAnimationPanel( &i_rParentWindow
, i_rPanelViewShell
.GetViewShellBase() );
43 mpWrappedControl
->Show();
46 CustomAnimationPanel::~CustomAnimationPanel()
48 delete mpWrappedControl
;
51 std::auto_ptr
< ControlFactory
> CustomAnimationPanel::CreateControlFactory( ToolPanelViewShell
& i_rToolPanelShell
)
53 return std::auto_ptr
< ControlFactory
>(
54 new RootControlFactoryWithArg
< CustomAnimationPanel
, ToolPanelViewShell
>( i_rToolPanelShell
) );
57 TaskPaneShellManager
* CustomAnimationPanel::GetShellManager()
59 if ( m_pPanelViewShell
)
60 return &m_pPanelViewShell
->GetSubShellManager();
61 return SubToolPanel::GetShellManager();
64 Size
CustomAnimationPanel::GetPreferredSize()
66 return maPreferredSize
;
68 sal_Int32
CustomAnimationPanel::GetPreferredWidth(sal_Int32
)
70 return maPreferredSize
.Width();
72 sal_Int32
CustomAnimationPanel::GetPreferredHeight(sal_Int32
)
74 return maPreferredSize
.Height();
76 ::Window
* CustomAnimationPanel::GetWindow()
78 return mpWrappedControl
;
80 bool CustomAnimationPanel::IsResizable()
84 bool CustomAnimationPanel::IsExpandable() const
92 ::com::sun::star::uno::Reference
<
93 ::com::sun::star::accessibility::XAccessible
> CustomAnimationPanel::CreateAccessibleObject (
94 const ::com::sun::star::uno::Reference
<
95 ::com::sun::star::accessibility::XAccessible
>& )
97 if (GetWindow() != NULL
)
98 return GetWindow()->GetAccessible();
103 } } } // end of namespace ::sd::toolpanel::controls
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */