xref: /aoo4110/main/sd/source/ui/inc/animobjs.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SD_ANIMOBJS_HXX
25 #define SD_ANIMOBJS_HXX
26 
27 #include <sfx2/dockwin.hxx>
28 #include <vcl/fixed.hxx>
29 #include <svtools/stdctrl.hxx>
30 #include <vcl/group.hxx>
31 #include <sfx2/ctrlitem.hxx>
32 
33 #ifndef _SV_BUTTON_HXX //autogen
34 #include <vcl/button.hxx>
35 #endif
36 #include <vcl/field.hxx>
37 #include <svx/dlgctrl.hxx>
38 #include <sfx2/progress.hxx>
39 
40 
41 #include <vcl/lstbox.hxx>
42 
43 #ifndef _SD_SDRESID_HXX
44 #include "sdresid.hxx"
45 #endif
46 #include "misc/scopelock.hxx"
47 
48 class SdDrawDocument;
49 class BitmapEx;
50 
51 namespace sd {
52 
53 class AnimationControllerItem;
54 class View;
55 
56 //------------------------------------------------------------------------
57 
58 enum BitmapAdjustment
59 {
60 	BA_LEFT_UP,
61 	BA_LEFT,
62 	BA_LEFT_DOWN,
63 	BA_UP,
64 	BA_CENTER,
65 	BA_DOWN,
66 	BA_RIGHT_UP,
67 	BA_RIGHT,
68 	BA_RIGHT_DOWN
69 };
70 
71 //------------------------------------------------------------------------
72 
73 class SdDisplay : public Control
74 {
75 private:
76 	BitmapEx 	aBitmapEx;
77 	Fraction	aScale;
78 
79 public:
80 	SdDisplay( ::Window* pWin, SdResId Id );
81 	~SdDisplay();
82 
83 	virtual void Paint( const Rectangle& rRect );
84 
85 	void	SetBitmapEx( BitmapEx* pBmpEx );
86 	void	SetScale( const Fraction& rFrac );
87 
88 	virtual void DataChanged( const DataChangedEvent& rDCEvt );
89 };
90 
91 //------------------------------------------------------------------------
92 
93 class AnimationWindow : public SfxDockingWindow
94 {
95  friend class AnimationChildWindow;
96  friend class AnimationControllerItem;
97 
98 public:
99     AnimationWindow( SfxBindings* pBindings, SfxChildWindow *pCW,
100         ::Window* pParent, const SdResId& rSdResId );
101     virtual ~AnimationWindow();
102 
103 	void	AddObj( ::sd::View& rView );
104 	void	CreateAnimObj( ::sd::View& rView );
105 
106 	virtual void DataChanged( const DataChangedEvent& rDCEvt );
107 
108 protected:
109 	virtual sal_Bool	Close();
110 	virtual void	Resize();
111 	virtual void	FillInfo( SfxChildWinInfo& ) const;
112 
113 private:
114 	SdDisplay		aCtlDisplay;
115 	ImageButton 	aBtnFirst;
116 	ImageButton 	aBtnReverse;
117 	ImageButton 	aBtnStop;
118 	ImageButton 	aBtnPlay;
119 	ImageButton 	aBtnLast;
120 	NumericField	aNumFldBitmap;
121 	TimeField		aTimeField;
122 	ListBox 		aLbLoopCount;
123 	FixedLine		aGrpBitmap;
124 	ImageButton		aBtnGetOneObject;
125 	ImageButton		aBtnGetAllObjects;
126 	ImageButton		aBtnRemoveBitmap;
127 	ImageButton		aBtnRemoveAll;
128 	FixedText		aFtCount;
129 	FixedInfo		aFiCount;
130 	FixedLine		aGrpAnimation;
131 
132 	RadioButton		aRbtGroup;
133 	RadioButton		aRbtBitmap;
134 	FixedText		aFtAdjustment;
135 	ListBox 		aLbAdjustment;
136 	PushButton		aBtnCreateGroup;
137 
138 	::Window* 		pWin;
139 	List			aBmpExList;
140 	List			aTimeList;
141 	SdDrawDocument* pMyDoc;
142 	BitmapEx* 		pBitmapEx;
143 
144 	Size			aSize;
145 	Size			aFltWinSize;
146 	Size			aDisplaySize;
147 	Size			aBmpSize;
148 	sal_Bool			bMovie;
149 	sal_Bool			bAllObjects;
150 
151 	SfxBindings*				pBindings;
152 	AnimationControllerItem*	pControllerItem;
153 
154 	ScopeLock		maPlayLock;
155 	//------------------------------------
156 
157 	DECL_LINK( ClickFirstHdl, void * );
158 	DECL_LINK( ClickStopHdl, void * );
159 	DECL_LINK( ClickPlayHdl, void * );
160 	DECL_LINK( ClickLastHdl, void * );
161 	DECL_LINK( ClickGetObjectHdl, void * );
162 	DECL_LINK( ClickRemoveBitmapHdl, void * );
163 	DECL_LINK( ClickRbtHdl, void * );
164 	DECL_LINK( ClickCreateGroupHdl, void * );
165 	DECL_LINK( ModifyBitmapHdl, void * );
166 	DECL_LINK( ModifyTimeHdl, void * );
167 
168 	void			UpdateControl( sal_uLong nPos, sal_Bool bDisableCtrls = sal_False );
169 	void			ResetAttrs();
170 	void			WaitInEffect( sal_uLong nMilliSeconds, sal_uLong nTime,
171 										SfxProgress* pStbMgr ) const;
172 	Fraction		GetScale();
173 };
174 
175 /*************************************************************************
176 |*
177 |* ControllerItem fuer Animator
178 |*
179 \************************************************************************/
180 
181 class AnimationControllerItem : public SfxControllerItem
182 {
183 
184 public:
185 	AnimationControllerItem( sal_uInt16, AnimationWindow*, SfxBindings* );
186 
187 protected:
188 	virtual void StateChanged( sal_uInt16 nSId, SfxItemState eState,
189         const SfxPoolItem* pState );
190 private:
191 	AnimationWindow* pAnimationWin;
192 };
193 
194 } // end of namespace sd
195 
196 #endif
197 
198