Update ooo320-m1
[ooovba.git] / sd / source / ui / inc / animobjs.hxx
blobfe5145983a130593562033f3fe6ada9d2c4d75ca
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: animobjs.hxx,v $
10 * $Revision: 1.9 $
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_ANIMOBJS_HXX
32 #define SD_ANIMOBJS_HXX
34 #include <sfx2/dockwin.hxx>
35 #include <vcl/fixed.hxx>
36 #include <svtools/stdctrl.hxx>
37 #include <vcl/group.hxx>
38 #include <sfx2/ctrlitem.hxx>
40 #ifndef _SV_BUTTON_HXX //autogen
41 #include <vcl/button.hxx>
42 #endif
43 #include <vcl/field.hxx>
44 #include <svx/dlgctrl.hxx>
45 #include <sfx2/progress.hxx>
48 #include <vcl/lstbox.hxx>
50 #ifndef _SD_SDRESID_HXX
51 #include "sdresid.hxx"
52 #endif
53 #include "misc/scopelock.hxx"
55 class SdDrawDocument;
56 class BitmapEx;
58 namespace sd {
60 class AnimationControllerItem;
61 class View;
63 //------------------------------------------------------------------------
65 enum BitmapAdjustment
67 BA_LEFT_UP,
68 BA_LEFT,
69 BA_LEFT_DOWN,
70 BA_UP,
71 BA_CENTER,
72 BA_DOWN,
73 BA_RIGHT_UP,
74 BA_RIGHT,
75 BA_RIGHT_DOWN
78 //------------------------------------------------------------------------
80 class SdDisplay : public Control
82 private:
83 BitmapEx aBitmapEx;
84 Fraction aScale;
86 public:
87 SdDisplay( ::Window* pWin, SdResId Id );
88 ~SdDisplay();
90 virtual void Paint( const Rectangle& rRect );
92 void SetBitmapEx( BitmapEx* pBmpEx );
93 void SetScale( const Fraction& rFrac );
95 virtual void DataChanged( const DataChangedEvent& rDCEvt );
98 //------------------------------------------------------------------------
100 class AnimationWindow : public SfxDockingWindow
102 friend class AnimationChildWindow;
103 friend class AnimationControllerItem;
105 public:
106 AnimationWindow( SfxBindings* pBindings, SfxChildWindow *pCW,
107 ::Window* pParent, const SdResId& rSdResId );
108 virtual ~AnimationWindow();
110 void AddObj( ::sd::View& rView );
111 void CreateAnimObj( ::sd::View& rView );
113 virtual void DataChanged( const DataChangedEvent& rDCEvt );
115 protected:
116 virtual BOOL Close();
117 virtual void Resize();
118 virtual void FillInfo( SfxChildWinInfo& ) const;
120 private:
121 SdDisplay aCtlDisplay;
122 ImageButton aBtnFirst;
123 ImageButton aBtnReverse;
124 ImageButton aBtnStop;
125 ImageButton aBtnPlay;
126 ImageButton aBtnLast;
127 NumericField aNumFldBitmap;
128 TimeField aTimeField;
129 ListBox aLbLoopCount;
131 ImageButton aBtnGetOneObject;
132 ImageButton aBtnGetAllObjects;
133 ImageButton aBtnRemoveBitmap;
134 ImageButton aBtnRemoveAll;
135 FixedText aFtCount;
136 FixedInfo aFiCount;
137 FixedLine aGrpBitmap;
139 RadioButton aRbtGroup;
140 RadioButton aRbtBitmap;
141 FixedText aFtAdjustment;
142 ListBox aLbAdjustment;
143 PushButton aBtnCreateGroup;
144 FixedLine aGrpAnimation;
146 ::Window* pWin;
147 List aBmpExList;
148 List aTimeList;
149 SdDrawDocument* pMyDoc;
150 BitmapEx* pBitmapEx;
152 Size aSize;
153 Size aFltWinSize;
154 Size aDisplaySize;
155 Size aBmpSize;
156 BOOL bMovie;
157 BOOL bAllObjects;
159 SfxBindings* pBindings;
160 AnimationControllerItem* pControllerItem;
162 ScopeLock maPlayLock;
163 //------------------------------------
165 DECL_LINK( ClickFirstHdl, void * );
166 DECL_LINK( ClickStopHdl, void * );
167 DECL_LINK( ClickPlayHdl, void * );
168 DECL_LINK( ClickLastHdl, void * );
169 DECL_LINK( ClickGetObjectHdl, void * );
170 DECL_LINK( ClickRemoveBitmapHdl, void * );
171 DECL_LINK( ClickRbtHdl, void * );
172 DECL_LINK( ClickCreateGroupHdl, void * );
173 DECL_LINK( ModifyBitmapHdl, void * );
174 DECL_LINK( ModifyTimeHdl, void * );
176 void UpdateControl( ULONG nPos, BOOL bDisableCtrls = FALSE );
177 void ResetAttrs();
178 void WaitInEffect( ULONG nMilliSeconds ) const;
179 void WaitInEffect( ULONG nMilliSeconds, ULONG nTime,
180 SfxProgress* pStbMgr ) const;
181 Fraction GetScale();
184 /*************************************************************************
186 |* ControllerItem fuer Animator
188 \************************************************************************/
190 class AnimationControllerItem : public SfxControllerItem
193 public:
194 AnimationControllerItem( USHORT, AnimationWindow*, SfxBindings* );
196 protected:
197 virtual void StateChanged( USHORT nSId, SfxItemState eState,
198 const SfxPoolItem* pState );
199 private:
200 AnimationWindow* pAnimationWin;
203 } // end of namespace sd
205 #endif