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 <tools/fract.hxx>
26 #include <sfx2/ctrlitem.hxx>
27 #include <sfx2/progress.hxx>
29 #include <vcl/button.hxx>
30 #include <vcl/field.hxx>
32 #include <vcl/lstbox.hxx>
34 #include <misc/scopelock.hxx>
40 class AnimationControllerItem
;
56 class SdDisplay
: public Control
63 SdDisplay(vcl::Window
* pWin
);
64 virtual ~SdDisplay() override
;
66 virtual void Paint( vcl::RenderContext
& rRenderContext
, const ::tools::Rectangle
& rRect
) override
;
68 void SetBitmapEx( BitmapEx
const * pBmpEx
);
69 void SetScale( const Fraction
& rFrac
);
71 virtual void DataChanged( const DataChangedEvent
& rDCEvt
) override
;
72 virtual Size
GetOptimalSize() const override
;
75 class AnimationWindow
: public SfxDockingWindow
77 friend class AnimationChildWindow
;
78 friend class AnimationControllerItem
;
81 AnimationWindow(SfxBindings
* pBindings
, SfxChildWindow
*pCW
, vcl::Window
* pParent
);
82 virtual ~AnimationWindow() override
;
83 virtual void dispose() override
;
85 void AddObj( ::sd::View
& rView
);
86 void CreateAnimObj( ::sd::View
& rView
);
88 virtual void DataChanged( const DataChangedEvent
& rDCEvt
) override
;
91 virtual bool Close() override
;
92 virtual void Resize() override
;
95 VclPtr
<SdDisplay
> m_pCtlDisplay
;
96 VclPtr
<PushButton
> m_pBtnFirst
;
97 VclPtr
<PushButton
> m_pBtnReverse
;
98 VclPtr
<PushButton
> m_pBtnStop
;
99 VclPtr
<PushButton
> m_pBtnPlay
;
100 VclPtr
<PushButton
> m_pBtnLast
;
101 VclPtr
<NumericField
> m_pNumFldBitmap
;
102 VclPtr
<TimeField
> m_pTimeField
;
103 VclPtr
<ListBox
> m_pLbLoopCount
;
104 VclPtr
<PushButton
> m_pBtnGetOneObject
;
105 VclPtr
<PushButton
> m_pBtnGetAllObjects
;
106 VclPtr
<PushButton
> m_pBtnRemoveBitmap
;
107 VclPtr
<PushButton
> m_pBtnRemoveAll
;
108 VclPtr
<FixedText
> m_pFiCount
;
110 VclPtr
<RadioButton
> m_pRbtGroup
;
111 VclPtr
<RadioButton
> m_pRbtBitmap
;
112 VclPtr
<FixedText
> m_pFtAdjustment
;
113 VclPtr
<ListBox
> m_pLbAdjustment
;
114 VclPtr
<PushButton
> m_pBtnCreateGroup
;
116 ::std::vector
< ::std::pair
<BitmapEx
, ::tools::Time
> > m_FrameList
;
117 static const size_t EMPTY_FRAMELIST
;
118 size_t m_nCurrentFrame
;
119 std::unique_ptr
<SdDrawDocument
> pMyDoc
;
124 std::unique_ptr
<AnimationControllerItem
> pControllerItem
;
126 ScopeLock maPlayLock
;
128 DECL_LINK( ClickFirstHdl
, Button
*, void );
129 DECL_LINK( ClickStopHdl
, Button
*, void );
130 DECL_LINK( ClickPlayHdl
, Button
*, void );
131 DECL_LINK( ClickLastHdl
, Button
*, void );
132 DECL_LINK( ClickGetObjectHdl
, Button
*, void );
133 DECL_LINK( ClickRemoveBitmapHdl
, Button
*, void );
134 DECL_LINK( ClickRbtHdl
, Button
*, void );
135 DECL_LINK( ClickCreateGroupHdl
, Button
*, void );
136 DECL_LINK( ModifyBitmapHdl
, Edit
&, void );
137 DECL_LINK( ModifyTimeHdl
, Edit
&, void );
139 void UpdateControl(bool bDisableCtrls
= false);
141 void WaitInEffect( sal_uLong nMilliSeconds
, sal_uLong nTime
,
142 SfxProgress
* pStbMgr
) const;
147 * ControllerItem for Animator
149 class AnimationControllerItem
: public SfxControllerItem
153 AnimationControllerItem( sal_uInt16
, AnimationWindow
*, SfxBindings
* );
156 virtual void StateChanged( sal_uInt16 nSId
, SfxItemState eState
,
157 const SfxPoolItem
* pState
) override
;
159 VclPtr
<AnimationWindow
> pAnimationWin
;
162 } // end of namespace sd
166 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */