Branch data 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 "CustomAnimationPanel.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 * createCustomAnimationPanel( ::Window* pParent, ViewShellBase& rBase );
34 : :
35 : : namespace toolpanel { namespace controls {
36 : :
37 : :
38 : 0 : CustomAnimationPanel::CustomAnimationPanel(Window& i_rParentWindow, ToolPanelViewShell& i_rPanelViewShell)
39 : : :SubToolPanel( i_rParentWindow )
40 : 0 : ,m_pPanelViewShell( &i_rPanelViewShell )
41 : : {
42 [ # # ][ # # ]: 0 : mpWrappedControl = createCustomAnimationPanel( &i_rParentWindow, i_rPanelViewShell.GetViewShellBase() );
43 [ # # ]: 0 : mpWrappedControl->Show();
44 : 0 : }
45 : :
46 : 0 : CustomAnimationPanel::~CustomAnimationPanel()
47 : : {
48 [ # # ][ # # ]: 0 : delete mpWrappedControl;
49 [ # # ]: 0 : }
50 : :
51 : 0 : std::auto_ptr< ControlFactory > CustomAnimationPanel::CreateControlFactory( ToolPanelViewShell& i_rToolPanelShell )
52 : : {
53 : : return std::auto_ptr< ControlFactory >(
54 [ # # ]: 0 : new RootControlFactoryWithArg< CustomAnimationPanel, ToolPanelViewShell >( i_rToolPanelShell ) );
55 : : }
56 : :
57 : 0 : TaskPaneShellManager* CustomAnimationPanel::GetShellManager()
58 : : {
59 [ # # ]: 0 : if ( m_pPanelViewShell )
60 : 0 : return &m_pPanelViewShell->GetSubShellManager();
61 : 0 : return SubToolPanel::GetShellManager();
62 : : }
63 : :
64 : 0 : Size CustomAnimationPanel::GetPreferredSize()
65 : : {
66 : 0 : return maPreferredSize;
67 : : }
68 : 0 : sal_Int32 CustomAnimationPanel::GetPreferredWidth(sal_Int32 )
69 : : {
70 : 0 : return maPreferredSize.Width();
71 : : }
72 : 0 : sal_Int32 CustomAnimationPanel::GetPreferredHeight(sal_Int32 )
73 : : {
74 : 0 : return maPreferredSize.Height();
75 : : }
76 : 0 : ::Window* CustomAnimationPanel::GetWindow()
77 : : {
78 : 0 : return mpWrappedControl;
79 : : }
80 : 0 : bool CustomAnimationPanel::IsResizable()
81 : : {
82 : 0 : return true;
83 : : }
84 : 0 : bool CustomAnimationPanel::IsExpandable() const
85 : : {
86 : 0 : return true;
87 : : }
88 : :
89 : :
90 : :
91 : :
92 : : ::com::sun::star::uno::Reference<
93 : 0 : ::com::sun::star::accessibility::XAccessible> CustomAnimationPanel::CreateAccessibleObject (
94 : : const ::com::sun::star::uno::Reference<
95 : : ::com::sun::star::accessibility::XAccessible>& )
96 : : {
97 [ # # ]: 0 : if (GetWindow() != NULL)
98 : 0 : return GetWindow()->GetAccessible();
99 : : else
100 : 0 : return NULL;
101 : : }
102 : :
103 : : } } } // end of namespace ::sd::toolpanel::controls
104 : :
105 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|