xref: /trunk/main/sd/source/ui/inc/animobjs.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef SD_ANIMOBJS_HXX
29*cdf0e10cSrcweir #define SD_ANIMOBJS_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include <sfx2/dockwin.hxx>
32*cdf0e10cSrcweir #include <vcl/fixed.hxx>
33*cdf0e10cSrcweir #include <svtools/stdctrl.hxx>
34*cdf0e10cSrcweir #include <vcl/group.hxx>
35*cdf0e10cSrcweir #include <sfx2/ctrlitem.hxx>
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir #ifndef _SV_BUTTON_HXX //autogen
38*cdf0e10cSrcweir #include <vcl/button.hxx>
39*cdf0e10cSrcweir #endif
40*cdf0e10cSrcweir #include <vcl/field.hxx>
41*cdf0e10cSrcweir #include <svx/dlgctrl.hxx>
42*cdf0e10cSrcweir #include <sfx2/progress.hxx>
43*cdf0e10cSrcweir 
44*cdf0e10cSrcweir 
45*cdf0e10cSrcweir #include <vcl/lstbox.hxx>
46*cdf0e10cSrcweir 
47*cdf0e10cSrcweir #ifndef _SD_SDRESID_HXX
48*cdf0e10cSrcweir #include "sdresid.hxx"
49*cdf0e10cSrcweir #endif
50*cdf0e10cSrcweir #include "misc/scopelock.hxx"
51*cdf0e10cSrcweir 
52*cdf0e10cSrcweir class SdDrawDocument;
53*cdf0e10cSrcweir class BitmapEx;
54*cdf0e10cSrcweir 
55*cdf0e10cSrcweir namespace sd {
56*cdf0e10cSrcweir 
57*cdf0e10cSrcweir class AnimationControllerItem;
58*cdf0e10cSrcweir class View;
59*cdf0e10cSrcweir 
60*cdf0e10cSrcweir //------------------------------------------------------------------------
61*cdf0e10cSrcweir 
62*cdf0e10cSrcweir enum BitmapAdjustment
63*cdf0e10cSrcweir {
64*cdf0e10cSrcweir     BA_LEFT_UP,
65*cdf0e10cSrcweir     BA_LEFT,
66*cdf0e10cSrcweir     BA_LEFT_DOWN,
67*cdf0e10cSrcweir     BA_UP,
68*cdf0e10cSrcweir     BA_CENTER,
69*cdf0e10cSrcweir     BA_DOWN,
70*cdf0e10cSrcweir     BA_RIGHT_UP,
71*cdf0e10cSrcweir     BA_RIGHT,
72*cdf0e10cSrcweir     BA_RIGHT_DOWN
73*cdf0e10cSrcweir };
74*cdf0e10cSrcweir 
75*cdf0e10cSrcweir //------------------------------------------------------------------------
76*cdf0e10cSrcweir 
77*cdf0e10cSrcweir class SdDisplay : public Control
78*cdf0e10cSrcweir {
79*cdf0e10cSrcweir private:
80*cdf0e10cSrcweir     BitmapEx    aBitmapEx;
81*cdf0e10cSrcweir     Fraction    aScale;
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir public:
84*cdf0e10cSrcweir     SdDisplay( ::Window* pWin, SdResId Id );
85*cdf0e10cSrcweir     ~SdDisplay();
86*cdf0e10cSrcweir 
87*cdf0e10cSrcweir     virtual void Paint( const Rectangle& rRect );
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir     void    SetBitmapEx( BitmapEx* pBmpEx );
90*cdf0e10cSrcweir     void    SetScale( const Fraction& rFrac );
91*cdf0e10cSrcweir 
92*cdf0e10cSrcweir     virtual void DataChanged( const DataChangedEvent& rDCEvt );
93*cdf0e10cSrcweir };
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir //------------------------------------------------------------------------
96*cdf0e10cSrcweir 
97*cdf0e10cSrcweir class AnimationWindow : public SfxDockingWindow
98*cdf0e10cSrcweir {
99*cdf0e10cSrcweir  friend class AnimationChildWindow;
100*cdf0e10cSrcweir  friend class AnimationControllerItem;
101*cdf0e10cSrcweir 
102*cdf0e10cSrcweir public:
103*cdf0e10cSrcweir     AnimationWindow( SfxBindings* pBindings, SfxChildWindow *pCW,
104*cdf0e10cSrcweir         ::Window* pParent, const SdResId& rSdResId );
105*cdf0e10cSrcweir     virtual ~AnimationWindow();
106*cdf0e10cSrcweir 
107*cdf0e10cSrcweir     void    AddObj( ::sd::View& rView );
108*cdf0e10cSrcweir     void    CreateAnimObj( ::sd::View& rView );
109*cdf0e10cSrcweir 
110*cdf0e10cSrcweir     virtual void DataChanged( const DataChangedEvent& rDCEvt );
111*cdf0e10cSrcweir 
112*cdf0e10cSrcweir protected:
113*cdf0e10cSrcweir     virtual sal_Bool    Close();
114*cdf0e10cSrcweir     virtual void    Resize();
115*cdf0e10cSrcweir     virtual void    FillInfo( SfxChildWinInfo& ) const;
116*cdf0e10cSrcweir 
117*cdf0e10cSrcweir private:
118*cdf0e10cSrcweir     SdDisplay       aCtlDisplay;
119*cdf0e10cSrcweir     ImageButton     aBtnFirst;
120*cdf0e10cSrcweir     ImageButton     aBtnReverse;
121*cdf0e10cSrcweir     ImageButton     aBtnStop;
122*cdf0e10cSrcweir     ImageButton     aBtnPlay;
123*cdf0e10cSrcweir     ImageButton     aBtnLast;
124*cdf0e10cSrcweir     NumericField    aNumFldBitmap;
125*cdf0e10cSrcweir     TimeField       aTimeField;
126*cdf0e10cSrcweir     ListBox         aLbLoopCount;
127*cdf0e10cSrcweir     FixedLine       aGrpBitmap;
128*cdf0e10cSrcweir     ImageButton     aBtnGetOneObject;
129*cdf0e10cSrcweir     ImageButton     aBtnGetAllObjects;
130*cdf0e10cSrcweir     ImageButton     aBtnRemoveBitmap;
131*cdf0e10cSrcweir     ImageButton     aBtnRemoveAll;
132*cdf0e10cSrcweir     FixedText       aFtCount;
133*cdf0e10cSrcweir     FixedInfo       aFiCount;
134*cdf0e10cSrcweir     FixedLine       aGrpAnimation;
135*cdf0e10cSrcweir 
136*cdf0e10cSrcweir     RadioButton     aRbtGroup;
137*cdf0e10cSrcweir     RadioButton     aRbtBitmap;
138*cdf0e10cSrcweir     FixedText       aFtAdjustment;
139*cdf0e10cSrcweir     ListBox         aLbAdjustment;
140*cdf0e10cSrcweir     PushButton      aBtnCreateGroup;
141*cdf0e10cSrcweir 
142*cdf0e10cSrcweir     ::Window*       pWin;
143*cdf0e10cSrcweir     List            aBmpExList;
144*cdf0e10cSrcweir     List            aTimeList;
145*cdf0e10cSrcweir     SdDrawDocument* pMyDoc;
146*cdf0e10cSrcweir     BitmapEx*       pBitmapEx;
147*cdf0e10cSrcweir 
148*cdf0e10cSrcweir     Size            aSize;
149*cdf0e10cSrcweir     Size            aFltWinSize;
150*cdf0e10cSrcweir     Size            aDisplaySize;
151*cdf0e10cSrcweir     Size            aBmpSize;
152*cdf0e10cSrcweir     sal_Bool            bMovie;
153*cdf0e10cSrcweir     sal_Bool            bAllObjects;
154*cdf0e10cSrcweir 
155*cdf0e10cSrcweir     SfxBindings*                pBindings;
156*cdf0e10cSrcweir     AnimationControllerItem*    pControllerItem;
157*cdf0e10cSrcweir 
158*cdf0e10cSrcweir     ScopeLock       maPlayLock;
159*cdf0e10cSrcweir     //------------------------------------
160*cdf0e10cSrcweir 
161*cdf0e10cSrcweir     DECL_LINK( ClickFirstHdl, void * );
162*cdf0e10cSrcweir     DECL_LINK( ClickStopHdl, void * );
163*cdf0e10cSrcweir     DECL_LINK( ClickPlayHdl, void * );
164*cdf0e10cSrcweir     DECL_LINK( ClickLastHdl, void * );
165*cdf0e10cSrcweir     DECL_LINK( ClickGetObjectHdl, void * );
166*cdf0e10cSrcweir     DECL_LINK( ClickRemoveBitmapHdl, void * );
167*cdf0e10cSrcweir     DECL_LINK( ClickRbtHdl, void * );
168*cdf0e10cSrcweir     DECL_LINK( ClickCreateGroupHdl, void * );
169*cdf0e10cSrcweir     DECL_LINK( ModifyBitmapHdl, void * );
170*cdf0e10cSrcweir     DECL_LINK( ModifyTimeHdl, void * );
171*cdf0e10cSrcweir 
172*cdf0e10cSrcweir     void            UpdateControl( sal_uLong nPos, sal_Bool bDisableCtrls = sal_False );
173*cdf0e10cSrcweir     void            ResetAttrs();
174*cdf0e10cSrcweir     void            WaitInEffect( sal_uLong nMilliSeconds, sal_uLong nTime,
175*cdf0e10cSrcweir                                         SfxProgress* pStbMgr ) const;
176*cdf0e10cSrcweir     Fraction        GetScale();
177*cdf0e10cSrcweir };
178*cdf0e10cSrcweir 
179*cdf0e10cSrcweir /*************************************************************************
180*cdf0e10cSrcweir |*
181*cdf0e10cSrcweir |* ControllerItem fuer Animator
182*cdf0e10cSrcweir |*
183*cdf0e10cSrcweir \************************************************************************/
184*cdf0e10cSrcweir 
185*cdf0e10cSrcweir class AnimationControllerItem : public SfxControllerItem
186*cdf0e10cSrcweir {
187*cdf0e10cSrcweir 
188*cdf0e10cSrcweir public:
189*cdf0e10cSrcweir     AnimationControllerItem( sal_uInt16, AnimationWindow*, SfxBindings* );
190*cdf0e10cSrcweir 
191*cdf0e10cSrcweir protected:
192*cdf0e10cSrcweir     virtual void StateChanged( sal_uInt16 nSId, SfxItemState eState,
193*cdf0e10cSrcweir         const SfxPoolItem* pState );
194*cdf0e10cSrcweir private:
195*cdf0e10cSrcweir     AnimationWindow* pAnimationWin;
196*cdf0e10cSrcweir };
197*cdf0e10cSrcweir 
198*cdf0e10cSrcweir } // end of namespace sd
199*cdf0e10cSrcweir 
200*cdf0e10cSrcweir #endif
201*cdf0e10cSrcweir 
202