CWS-TOOLING: integrate CWS os150
[LibreOffice.git] / sd / source / ui / animations / CustomAnimationPane.hxx
blob33dd25ebaf66db25635487b9315f4c7bbe875b31
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef _SD_CUSTOMANIMATIONPANE_HXX
29 #define _SD_CUSTOMANIMATIONPANE_HXX
31 #include <com/sun/star/drawing/XDrawView.hpp>
32 #include <com/sun/star/frame/XModel.hpp>
33 #include <vcl/dialog.hxx>
34 #include "CustomAnimationPreset.hxx"
35 #include "CustomAnimationList.hxx"
36 #include "CustomAnimationCreateDialog.hxx"
38 #include "motionpathtag.hxx"
39 #include "misc/scopelock.hxx"
41 #include <vector>
43 class PushButton;
44 class FixedLine;
45 class FixedText;
46 class ListBox;
47 class ComboBox;
48 class CheckBox;
49 class SdDrawDocument;
51 namespace com { namespace sun { namespace star { namespace animations {
52 class XAnimationNode;
53 } } } }
55 namespace sd { namespace tools {
56 class EventMultiplexerEvent;
57 } }
59 namespace sd {
61 class PropertyControl;
62 class STLPropertySet;
63 class ViewShellBase;
65 typedef std::vector< rtl::Reference< MotionPathTag > > MotionPathTagVector;
67 // --------------------------------------------------------------------
69 class CustomAnimationPane : public Control, public ICustomAnimationListController
71 friend class MotionPathTag;
72 public:
73 CustomAnimationPane( ::Window* pParent, ViewShellBase& rBase, const Size& rMinSize );
74 virtual ~CustomAnimationPane();
76 // callbacks
77 void onSelectionChanged();
78 void onChangeCurrentPage();
79 void onChange( bool bCreate );
80 void onRemove();
81 void onChangeStart();
82 void onChangeStart( sal_Int16 nNodeType );
83 void onChangeProperty();
84 void onChangeSpeed();
86 // methods
87 void preview( const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xAnimationNode );
88 void remove( CustomAnimationEffectPtr& pEffect );
90 // Control
91 virtual void Resize();
92 virtual void StateChanged( StateChangedType nStateChange );
93 virtual void KeyInput( const KeyEvent& rKEvt );
95 // ICustomAnimationListController
96 virtual void onSelect();
97 virtual void onDoubleClick();
98 virtual void onContextMenu( sal_uInt16 nSelectedPopupEntry );
100 void addUndo();
102 void updatePathFromMotionPathTag( const rtl::Reference< MotionPathTag >& xTag );
104 private:
105 void addListener();
106 void removeListener();
107 void updateLayout();
108 void updateControls();
109 void updateMotionPathTags();
110 void markShapesFromSelectedEffects();
112 void showOptions( sal_uInt16 nPage = 0 );
113 void moveSelection( bool bUp );
114 void onPreview( bool bForcePreview );
116 void createPath( PathKind eKind, std::vector< ::com::sun::star::uno::Any >& rTargets, double fDuration );
118 STLPropertySet* createSelectionSet();
119 void changeSelection( STLPropertySet* pResultSet, STLPropertySet* pOldSet );
121 ::com::sun::star::uno::Any getProperty1Value( sal_Int32 nType, CustomAnimationEffectPtr pEffect );
122 bool setProperty1Value( sal_Int32 nType, CustomAnimationEffectPtr pEffect, const ::com::sun::star::uno::Any& rValue );
124 DECL_LINK( implControlHdl, Control* );
125 DECL_LINK( implPropertyHdl, Control* );
126 DECL_LINK(EventMultiplexerListener, tools::EventMultiplexerEvent*);
127 DECL_LINK(lateInitCallback, Timer*);
129 private:
130 ViewShellBase& mrBase;
132 const CustomAnimationPresets* mpCustomAnimationPresets;
134 FixedLine* mpFLModify;
135 PushButton* mpPBAddEffect;
136 PushButton* mpPBChangeEffect;
137 PushButton* mpPBRemoveEffect;
138 FixedLine* mpFLEffect;
139 FixedText* mpFTStart;
140 ListBox* mpLBStart;
141 FixedText* mpFTProperty;
142 PropertyControl* mpLBProperty;
143 PushButton* mpPBPropertyMore;
144 FixedText* mpFTSpeed;
145 ComboBox* mpCBSpeed;
146 CustomAnimationList* mpCustomAnimationList;
147 FixedText* mpFTChangeOrder;
148 PushButton* mpPBMoveUp;
149 PushButton* mpPBMoveDown;
150 FixedLine* mpFLSeperator1;
151 PushButton* mpPBPlay;
152 PushButton* mpPBSlideShow;
153 FixedLine* mpFLSeperator2;
154 CheckBox* mpCBAutoPreview;
156 String maStrModify;
157 String maStrProperty;
159 sal_Int32 mnPropertyType;
161 Size maMinSize;
163 EffectSequence maListSelection;
164 ::com::sun::star::uno::Any maViewSelection;
166 MainSequencePtr mpMainSequence;
168 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > mxCurrentPage;
169 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawView > mxView;
170 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxModel;
172 /** The mpCustomAnimationPresets is initialized either on demand or
173 after a short time after the construction of a new object of this
174 class. This timer is responsible for the later.
176 Timer maLateInitTimer;
178 /** This method initializes the mpCustomAnimationPresets on demand and
179 returns a reference to the list.
181 const CustomAnimationPresets& getPresets (void);
183 MotionPathTagVector maMotionPathTags;
185 ScopeLock maSelectionLock;
190 #endif // _SD_CUSTOMANIMATIONPANE_HXX