LibreOffice Module sd (master) 1
CustomAnimationPane.hxx
Go to the documentation of this file.
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#pragma once
21
24#include <vcl/idle.hxx>
26#include <misc/scopelock.hxx>
27
28#include <vector>
29
30namespace com::sun::star::drawing { class XDrawPage; }
31namespace com::sun::star::drawing { class XDrawView; }
32namespace weld { class ComboBox; }
33namespace com::sun::star::animations { class XAnimationNode; }
34namespace sd::tools { class EventMultiplexerEvent; }
35
37
38namespace sd {
39
40class MotionPathTag;
41class SdPropertySubControl;
42class STLPropertySet;
43class ViewShellBase;
44
45typedef std::vector< rtl::Reference< MotionPathTag > > MotionPathTagVector;
46
48 , public sfx2::sidebar::ILayoutableWindow
50{
51 friend class MotionPathTag;
52public:
54 virtual ~CustomAnimationPane() override;
55
56 // ILayoutableWindow
57 virtual css::ui::LayoutSize GetHeightForWidth (const sal_Int32 nWidth) override;
58
59 // callbacks
60 void onSelectionChanged();
62 void onAdd();
63 void onRemove();
64 void onChangeStart();
65 void onChangeStart( sal_Int16 nNodeType );
66 void onChangeSpeed();
67
68 // methods
69 void preview( const css::uno::Reference< css::animations::XAnimationNode >& xAnimationNode );
70 void remove( CustomAnimationEffectPtr const & pEffect );
71
72 // ICustomAnimationListController
73 virtual void onSelect() override;
74 virtual void onDoubleClick() override;
75 virtual void onContextMenu(const OUString& rIdent) override;
76 virtual void onDragNDropComplete( std::vector< CustomAnimationEffectPtr > pEffectsDragged, CustomAnimationEffectPtr pEffectInsertBefore ) override;
77
78 void addUndo();
79
80 double getDuration() const;
82
83private:
84 void initialize();
85 void addListener();
86 void removeListener();
87 void updateControls();
89
90 void showOptions(const OUString& sPage = {});
91 void moveSelection( bool bUp );
92 void onPreview( bool bForcePreview );
93
94 std::unique_ptr<STLPropertySet> createSelectionSet();
95 void changeSelection( STLPropertySet const * pResultSet, STLPropertySet const * pOldSet );
96
97 static css::uno::Any getProperty1Value( sal_Int32 nType, const CustomAnimationEffectPtr& pEffect );
98 static bool setProperty1Value( sal_Int32 nType, const CustomAnimationEffectPtr& pEffect, const css::uno::Any& rValue );
99 sal_Int32 fillAnimationLB( bool bHasText );
101 void createPath( PathKind eKind, std::vector< ::com::sun::star::uno::Any >& rTargets, double fDuration );
102
103 DECL_LINK( implControlListBoxHdl, weld::ComboBox&, void );
104 DECL_LINK( implClickHdl, weld::Button&, void );
105 DECL_LINK( implToggleHdl, weld::Toggleable&, void );
106 DECL_LINK( implPropertyHdl, LinkParamNone*, void );
107 DECL_LINK( EventMultiplexerListener, tools::EventMultiplexerEvent&, void );
108 DECL_LINK( lateInitCallback, Timer *, void );
109 DECL_LINK( DurationModifiedHdl, weld::MetricSpinButton&, void );
110 DECL_LINK( DelayModifiedHdl, weld::MetricSpinButton&, void );
111 DECL_LINK( DelayLoseFocusHdl, weld::Widget&, void );
112 DECL_LINK( UpdateAnimationLB, weld::ComboBox&, void );
113 DECL_LINK( AnimationSelectHdl, weld::TreeView&, void );
114 DECL_LINK( SelectionHandler, Timer*, void );
115 void implControlHdl(const weld::Widget* pControl);
116
117private:
119
120 // UI Elements
121 std::unique_ptr<weld::Label> mxFTAnimation;
122 std::unique_ptr<CustomAnimationList> mxCustomAnimationList;
123 std::unique_ptr<weld::Button> mxPBAddEffect;
124 std::unique_ptr<weld::Button> mxPBRemoveEffect;
125 std::unique_ptr<weld::Button> mxPBMoveUp;
126 std::unique_ptr<weld::Button> mxPBMoveDown;
127 std::unique_ptr<weld::Label> mxFTCategory;
128 std::unique_ptr<weld::ComboBox> mxLBCategory;
129 std::unique_ptr<weld::Label> mxFTEffect;
130 std::unique_ptr<weld::TreeView> mxLBAnimation;
131 std::unique_ptr<weld::Label> mxFTStart;
132 std::unique_ptr<weld::ComboBox> mxLBStart;
133 std::unique_ptr<weld::Label> mxFTProperty;
134 std::unique_ptr<SdPropertySubControl> mxLBSubControl;
135 std::unique_ptr<weld::Container> mxPlaceholderBox;
136 std::unique_ptr<weld::Button> mxPBPropertyMore;
137 std::unique_ptr<weld::Label> mxFTDuration;
138 std::unique_ptr<weld::MetricSpinButton> mxCBXDuration;
139 std::unique_ptr<weld::Label> mxFTStartDelay;
140 std::unique_ptr<weld::MetricSpinButton> mxMFStartDelay;
141 std::unique_ptr<weld::CheckButton> mxCBAutoPreview;
142 std::unique_ptr<weld::Button> mxPBPlay;
143
145
146 OUString maStrModify;
148
150 sal_Int32 mnPropertyType;
151 static sal_Int32 const gnMotionPathPos = 3;
152 sal_Int32 mnCurvePathPos;
155
157 css::uno::Any maViewSelection;
158
160
161 css::uno::Reference< css::drawing::XDrawPage > mxCurrentPage;
162 css::uno::Reference< css::drawing::XDrawView > mxView;
163
169
171
173};
174
176
177}
178
179/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual ~CustomAnimationPane() override
std::unique_ptr< weld::TreeView > mxLBAnimation
std::unique_ptr< weld::MetricSpinButton > mxCBXDuration
DECL_LINK(implControlListBoxHdl, weld::ComboBox &, void)
void createPath(PathKind eKind, std::vector< ::com::sun::star::uno::Any > &rTargets, double fDuration)
virtual void onDragNDropComplete(std::vector< CustomAnimationEffectPtr > pEffectsDragged, CustomAnimationEffectPtr pEffectInsertBefore) override
void preview(const css::uno::Reference< css::animations::XAnimationNode > &xAnimationNode)
void onPreview(bool bForcePreview)
std::unique_ptr< weld::Button > mxPBAddEffect
std::unique_ptr< weld::Label > mxFTDuration
std::unique_ptr< weld::Label > mxFTCategory
void changeSelection(STLPropertySet const *pResultSet, STLPropertySet const *pOldSet)
std::unique_ptr< weld::Button > mxPBPlay
std::unique_ptr< SdPropertySubControl > mxLBSubControl
DECL_LINK(DurationModifiedHdl, weld::MetricSpinButton &, void)
static bool setProperty1Value(sal_Int32 nType, const CustomAnimationEffectPtr &pEffect, const css::uno::Any &rValue)
virtual void onDoubleClick() override
sal_Int32 fillAnimationLB(bool bHasText)
std::unique_ptr< CustomAnimationList > mxCustomAnimationList
DECL_LINK(lateInitCallback, Timer *, void)
DECL_LINK(AnimationSelectHdl, weld::TreeView &, void)
DECL_LINK(SelectionHandler, Timer *, void)
DECL_LINK(DelayModifiedHdl, weld::MetricSpinButton &, void)
std::unique_ptr< weld::Label > mxFTProperty
MotionPathTagVector maMotionPathTags
DECL_LINK(EventMultiplexerListener, tools::EventMultiplexerEvent &, void)
Timer maLateInitTimer
The CustomAnimationPresets is initialized either on demand or after a short time after the constructi...
static sal_Int32 const gnMotionPathPos
virtual void onSelect() override
std::unique_ptr< weld::MetricSpinButton > mxMFStartDelay
void showOptions(const OUString &sPage={})
css::uno::Reference< css::drawing::XDrawView > mxView
std::unique_ptr< weld::Label > mxFTStart
std::unique_ptr< weld::Button > mxPBMoveUp
DECL_LINK(implClickHdl, weld::Button &, void)
std::unique_ptr< weld::Label > mxFTStartDelay
std::unique_ptr< STLPropertySet > createSelectionSet()
css::uno::Reference< css::drawing::XDrawPage > mxCurrentPage
std::unique_ptr< weld::ComboBox > mxLBStart
DECL_LINK(implToggleHdl, weld::Toggleable &, void)
std::unique_ptr< weld::Label > mxFTAnimation
std::unique_ptr< weld::Button > mxPBRemoveEffect
DECL_LINK(DelayLoseFocusHdl, weld::Widget &, void)
void implControlHdl(const weld::Widget *pControl)
this link is called when one of the controls is modified
void updatePathFromMotionPathTag(const rtl::Reference< MotionPathTag > &xTag)
std::unique_ptr< weld::CheckButton > mxCBAutoPreview
DECL_LINK(UpdateAnimationLB, weld::ComboBox &, void)
DECL_LINK(implPropertyHdl, LinkParamNone *, void)
std::unique_ptr< weld::Button > mxPBMoveDown
std::unique_ptr< weld::ComboBox > mxLBCategory
std::unique_ptr< weld::Button > mxPBPropertyMore
std::unique_ptr< weld::Label > mxFTEffect
CustomAnimationPane(weld::Widget *pParent, ViewShellBase &rBase)
std::unique_ptr< weld::Container > mxPlaceholderBox
void remove(CustomAnimationEffectPtr const &pEffect)
virtual void onContextMenu(const OUString &rIdent) override
virtual css::ui::LayoutSize GetHeightForWidth(const sal_Int32 nWidth) override
static css::uno::Any getProperty1Value(sal_Int32 nType, const CustomAnimationEffectPtr &pEffect)
Base class for all functions.
SfxViewShell descendant that the stacked Draw/Impress shells are based on.
NONE
std::list< CustomAnimationEffectPtr > EffectSequence
void fillRepeatComboBox(weld::ComboBox &rBox)
std::shared_ptr< MainSequence > MainSequencePtr
std::vector< rtl::Reference< MotionPathTag > > MotionPathTagVector
std::shared_ptr< CustomAnimationEffect > CustomAnimationEffectPtr