Update ooo320-m1
[ooovba.git] / sd / source / ui / animations / CustomAnimationPane.hxx
blob6cfe43229a8c358ec96aab39e7f1273de588dd8e
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: CustomAnimationPane.hxx,v $
10 * $Revision: 1.8 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SD_CUSTOMANIMATIONPANE_HXX
32 #define _SD_CUSTOMANIMATIONPANE_HXX
34 #include <com/sun/star/drawing/XDrawView.hpp>
35 #include <com/sun/star/frame/XModel.hpp>
36 #include <vcl/dialog.hxx>
37 #include "CustomAnimationPreset.hxx"
38 #include "CustomAnimationList.hxx"
39 #include "CustomAnimationCreateDialog.hxx"
41 #include "motionpathtag.hxx"
42 #include "misc/scopelock.hxx"
44 #include <vector>
46 class PushButton;
47 class FixedLine;
48 class FixedText;
49 class ListBox;
50 class ComboBox;
51 class CheckBox;
52 class SdDrawDocument;
54 namespace com { namespace sun { namespace star { namespace animations {
55 class XAnimationNode;
56 } } } }
58 namespace sd { namespace tools {
59 class EventMultiplexerEvent;
60 } }
62 namespace sd {
64 class PropertyControl;
65 class STLPropertySet;
66 class ViewShellBase;
68 typedef std::vector< rtl::Reference< MotionPathTag > > MotionPathTagVector;
70 // --------------------------------------------------------------------
72 class CustomAnimationPane : public Control, public ICustomAnimationListController
74 friend class MotionPathTag;
75 public:
76 CustomAnimationPane( ::Window* pParent, ViewShellBase& rBase, const Size& rMinSize );
77 virtual ~CustomAnimationPane();
79 // callbacks
80 void onSelectionChanged();
81 void onChangeCurrentPage();
82 void onChange( bool bCreate );
83 void onRemove();
84 void onChangeStart();
85 void onChangeStart( sal_Int16 nNodeType );
86 void onChangeProperty();
87 void onChangeSpeed();
89 // methods
90 void preview( const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xAnimationNode );
91 void remove( CustomAnimationEffectPtr& pEffect );
93 // Control
94 virtual void Resize();
95 virtual void StateChanged( StateChangedType nStateChange );
96 virtual void KeyInput( const KeyEvent& rKEvt );
98 // ICustomAnimationListController
99 virtual void onSelect();
100 virtual void onDoubleClick();
101 virtual void onContextMenu( USHORT nSelectedPopupEntry );
103 void addUndo();
105 void updatePathFromMotionPathTag( const rtl::Reference< MotionPathTag >& xTag );
107 private:
108 void addListener();
109 void removeListener();
110 void updateLayout();
111 void updateControls();
112 void updateMotionPathTags();
113 void markShapesFromSelectedEffects();
115 void showOptions( USHORT nPage = 0 );
116 void moveSelection( bool bUp );
117 void onPreview( bool bForcePreview );
119 void createPath( PathKind eKind, std::vector< ::com::sun::star::uno::Any >& rTargets, double fDuration );
121 STLPropertySet* createSelectionSet();
122 void changeSelection( STLPropertySet* pResultSet, STLPropertySet* pOldSet );
124 ::com::sun::star::uno::Any getProperty1Value( sal_Int32 nType, CustomAnimationEffectPtr pEffect );
125 bool setProperty1Value( sal_Int32 nType, CustomAnimationEffectPtr pEffect, const ::com::sun::star::uno::Any& rValue );
127 DECL_LINK( implControlHdl, Control* );
128 DECL_LINK( implPropertyHdl, Control* );
129 DECL_LINK(EventMultiplexerListener, tools::EventMultiplexerEvent*);
130 DECL_LINK(lateInitCallback, Timer*);
132 private:
133 ViewShellBase& mrBase;
135 const CustomAnimationPresets* mpCustomAnimationPresets;
137 FixedLine* mpFLModify;
138 PushButton* mpPBAddEffect;
139 PushButton* mpPBChangeEffect;
140 PushButton* mpPBRemoveEffect;
141 FixedLine* mpFLEffect;
142 FixedText* mpFTStart;
143 ListBox* mpLBStart;
144 FixedText* mpFTProperty;
145 PropertyControl* mpLBProperty;
146 PushButton* mpPBPropertyMore;
147 FixedText* mpFTSpeed;
148 ComboBox* mpCBSpeed;
149 CustomAnimationList* mpCustomAnimationList;
150 FixedText* mpFTChangeOrder;
151 PushButton* mpPBMoveUp;
152 PushButton* mpPBMoveDown;
153 FixedLine* mpFLSeperator1;
154 PushButton* mpPBPlay;
155 PushButton* mpPBSlideShow;
156 FixedLine* mpFLSeperator2;
157 CheckBox* mpCBAutoPreview;
159 String maStrModify;
160 String maStrProperty;
162 sal_Int32 mnPropertyType;
164 Size maMinSize;
166 EffectSequence maListSelection;
167 ::com::sun::star::uno::Any maViewSelection;
169 MainSequencePtr mpMainSequence;
171 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > mxCurrentPage;
172 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawView > mxView;
173 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxModel;
175 /** The mpCustomAnimationPresets is initialized either on demand or
176 after a short time after the construction of a new object of this
177 class. This timer is responsible for the later.
179 Timer maLateInitTimer;
181 /** This method initializes the mpCustomAnimationPresets on demand and
182 returns a reference to the list.
184 const CustomAnimationPresets& getPresets (void);
186 MotionPathTagVector maMotionPathTags;
188 ScopeLock maSelectionLock;
193 #endif // _SD_CUSTOMANIMATIONPANE_HXX