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 INCLUDED_SD_SOURCE_UI_INC_ANIMOBJS_HXX
21 #define INCLUDED_SD_SOURCE_UI_INC_ANIMOBJS_HXX
23 #include <sfx2/dockwin.hxx>
24 #include <vcl/fixed.hxx>
25 #include <svtools/stdctrl.hxx>
26 #include <tools/fract.hxx>
27 #include <vcl/group.hxx>
28 #include <sfx2/ctrlitem.hxx>
30 #include <vcl/button.hxx>
31 #include <vcl/field.hxx>
32 #include <svx/dlgctrl.hxx>
33 #include <sfx2/progress.hxx>
35 #include <vcl/lstbox.hxx>
37 #include "sdresid.hxx"
38 #include "misc/scopelock.hxx"
45 class AnimationControllerItem
;
61 class SdDisplay
: public Control
68 SdDisplay(vcl::Window
* pWin
);
71 virtual void Paint( vcl::RenderContext
& rRenderContext
, const Rectangle
& rRect
) SAL_OVERRIDE
;
73 void SetBitmapEx( BitmapEx
* pBmpEx
);
74 void SetScale( const Fraction
& rFrac
);
76 virtual void DataChanged( const DataChangedEvent
& rDCEvt
) SAL_OVERRIDE
;
77 virtual Size
GetOptimalSize() const SAL_OVERRIDE
;
80 class AnimationWindow
: public SfxDockingWindow
82 friend class AnimationChildWindow
;
83 friend class AnimationControllerItem
;
86 AnimationWindow(SfxBindings
* pBindings
, SfxChildWindow
*pCW
, vcl::Window
* pParent
);
87 virtual ~AnimationWindow();
88 virtual void dispose() SAL_OVERRIDE
;
90 void AddObj( ::sd::View
& rView
);
91 void CreateAnimObj( ::sd::View
& rView
);
93 virtual void DataChanged( const DataChangedEvent
& rDCEvt
) SAL_OVERRIDE
;
96 virtual bool Close() SAL_OVERRIDE
;
97 virtual void Resize() SAL_OVERRIDE
;
98 virtual void FillInfo( SfxChildWinInfo
& ) const SAL_OVERRIDE
;
101 VclPtr
<SdDisplay
> m_pCtlDisplay
;
102 VclPtr
<PushButton
> m_pBtnFirst
;
103 VclPtr
<PushButton
> m_pBtnReverse
;
104 VclPtr
<PushButton
> m_pBtnStop
;
105 VclPtr
<PushButton
> m_pBtnPlay
;
106 VclPtr
<PushButton
> m_pBtnLast
;
107 VclPtr
<NumericField
> m_pNumFldBitmap
;
108 VclPtr
<TimeField
> m_pTimeField
;
109 VclPtr
<ListBox
> m_pLbLoopCount
;
110 VclPtr
<PushButton
> m_pBtnGetOneObject
;
111 VclPtr
<PushButton
> m_pBtnGetAllObjects
;
112 VclPtr
<PushButton
> m_pBtnRemoveBitmap
;
113 VclPtr
<PushButton
> m_pBtnRemoveAll
;
114 VclPtr
<FixedText
> m_pFiCount
;
116 VclPtr
<RadioButton
> m_pRbtGroup
;
117 VclPtr
<RadioButton
> m_pRbtBitmap
;
118 VclPtr
<FixedText
> m_pFtAdjustment
;
119 VclPtr
<ListBox
> m_pLbAdjustment
;
120 VclPtr
<PushButton
> m_pBtnCreateGroup
;
122 VclPtr
<vcl::Window
> pWin
;
123 ::std::vector
< ::std::pair
<BitmapEx
*, ::tools::Time
*> > m_FrameList
;
124 static const size_t EMPTY_FRAMELIST
;
125 size_t m_nCurrentFrame
;
126 SdDrawDocument
* pMyDoc
;
131 SfxBindings
* pBindings
;
132 AnimationControllerItem
* pControllerItem
;
134 ScopeLock maPlayLock
;
136 DECL_LINK( ClickFirstHdl
, void * );
137 DECL_LINK( ClickStopHdl
, void * );
138 DECL_LINK( ClickPlayHdl
, void * );
139 DECL_LINK( ClickLastHdl
, void * );
140 DECL_LINK( ClickGetObjectHdl
, void * );
141 DECL_LINK( ClickRemoveBitmapHdl
, void * );
142 DECL_LINK( ClickRbtHdl
, void * );
143 DECL_LINK( ClickCreateGroupHdl
, void * );
144 DECL_LINK( ModifyBitmapHdl
, void * );
145 DECL_LINK( ModifyTimeHdl
, void * );
147 void UpdateControl(bool bDisableCtrls
= false);
149 void WaitInEffect( sal_uLong nMilliSeconds
, sal_uLong nTime
,
150 SfxProgress
* pStbMgr
) const;
155 * ControllerItem for Animator
157 class AnimationControllerItem
: public SfxControllerItem
161 AnimationControllerItem( sal_uInt16
, AnimationWindow
*, SfxBindings
* );
164 virtual void StateChanged( sal_uInt16 nSId
, SfxItemState eState
,
165 const SfxPoolItem
* pState
) SAL_OVERRIDE
;
167 VclPtr
<AnimationWindow
> pAnimationWin
;
170 } // end of namespace sd
174 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */