1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef SD_ANIMOBJS_HXX
21 #define SD_ANIMOBJS_HXX
23 #include <sfx2/dockwin.hxx>
24 #include <vcl/fixed.hxx>
25 #include <svtools/stdctrl.hxx>
26 #include <vcl/group.hxx>
27 #include <sfx2/ctrlitem.hxx>
29 #include <vcl/button.hxx>
30 #include <vcl/field.hxx>
31 #include <svx/dlgctrl.hxx>
32 #include <sfx2/progress.hxx>
35 #include <vcl/lstbox.hxx>
37 #include "sdresid.hxx"
38 #include "misc/scopelock.hxx"
45 class AnimationControllerItem
;
48 //------------------------------------------------------------------------
63 //------------------------------------------------------------------------
65 class SdDisplay
: public Control
72 SdDisplay( ::Window
* pWin
, SdResId Id
);
75 virtual void Paint( const Rectangle
& rRect
);
77 void SetBitmapEx( BitmapEx
* pBmpEx
);
78 void SetScale( const Fraction
& rFrac
);
80 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
83 //------------------------------------------------------------------------
85 class AnimationWindow
: public SfxDockingWindow
87 friend class AnimationChildWindow
;
88 friend class AnimationControllerItem
;
91 AnimationWindow( SfxBindings
* pBindings
, SfxChildWindow
*pCW
,
92 ::Window
* pParent
, const SdResId
& rSdResId
);
93 virtual ~AnimationWindow();
95 void AddObj( ::sd::View
& rView
);
96 void CreateAnimObj( ::sd::View
& rView
);
98 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
101 virtual sal_Bool
Close();
102 virtual void Resize();
103 virtual void FillInfo( SfxChildWinInfo
& ) const;
106 SdDisplay aCtlDisplay
;
107 ImageButton aBtnFirst
;
108 ImageButton aBtnReverse
;
109 ImageButton aBtnStop
;
110 ImageButton aBtnPlay
;
111 ImageButton aBtnLast
;
112 NumericField aNumFldBitmap
;
113 TimeField aTimeField
;
114 ListBox aLbLoopCount
;
115 FixedLine aGrpBitmap
;
116 ImageButton aBtnGetOneObject
;
117 ImageButton aBtnGetAllObjects
;
118 ImageButton aBtnRemoveBitmap
;
119 ImageButton aBtnRemoveAll
;
122 FixedLine aGrpAnimation
;
124 RadioButton aRbtGroup
;
125 RadioButton aRbtBitmap
;
126 FixedText aFtAdjustment
;
127 ListBox aLbAdjustment
;
128 PushButton aBtnCreateGroup
;
134 ::std::vector
< ::std::pair
<BitmapEx
*, Time
*> > m_FrameList
;
135 static const size_t EMPTY_FRAMELIST
= ULONG_MAX
;
136 size_t m_nCurrentFrame
;
137 SdDrawDocument
* pMyDoc
;
144 sal_Bool bAllObjects
;
146 SfxBindings
* pBindings
;
147 AnimationControllerItem
* pControllerItem
;
149 ScopeLock maPlayLock
;
150 //------------------------------------
152 DECL_LINK( ClickFirstHdl
, void * );
153 DECL_LINK( ClickStopHdl
, void * );
154 DECL_LINK( ClickPlayHdl
, void * );
155 DECL_LINK( ClickLastHdl
, void * );
156 DECL_LINK( ClickGetObjectHdl
, void * );
157 DECL_LINK( ClickRemoveBitmapHdl
, void * );
158 DECL_LINK( ClickRbtHdl
, void * );
159 DECL_LINK( ClickCreateGroupHdl
, void * );
160 DECL_LINK( ModifyBitmapHdl
, void * );
161 DECL_LINK( ModifyTimeHdl
, void * );
163 void UpdateControl(bool bDisableCtrls
= false);
165 void WaitInEffect( sal_uLong nMilliSeconds
, sal_uLong nTime
,
166 SfxProgress
* pStbMgr
) const;
171 * ControllerItem for Animator
173 class AnimationControllerItem
: public SfxControllerItem
177 AnimationControllerItem( sal_uInt16
, AnimationWindow
*, SfxBindings
* );
180 virtual void StateChanged( sal_uInt16 nSId
, SfxItemState eState
,
181 const SfxPoolItem
* pState
);
183 AnimationWindow
* pAnimationWin
;
186 } // end of namespace sd
190 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */