bump product version to 5.0.4.1
[LibreOffice.git] / sd / source / ui / inc / animobjs.hxx
blob4a02d194040f7c7e73c3a174169f2421f18d97c5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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"
40 class SdDrawDocument;
41 class BitmapEx;
43 namespace sd {
45 class AnimationControllerItem;
46 class View;
48 enum BitmapAdjustment
50 BA_LEFT_UP,
51 BA_LEFT,
52 BA_LEFT_DOWN,
53 BA_UP,
54 BA_CENTER,
55 BA_DOWN,
56 BA_RIGHT_UP,
57 BA_RIGHT,
58 BA_RIGHT_DOWN
61 class SdDisplay : public Control
63 private:
64 BitmapEx aBitmapEx;
65 Fraction aScale;
67 public:
68 SdDisplay(vcl::Window* pWin);
69 virtual ~SdDisplay();
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;
85 public:
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;
95 protected:
96 virtual bool Close() SAL_OVERRIDE;
97 virtual void Resize() SAL_OVERRIDE;
98 virtual void FillInfo( SfxChildWinInfo& ) const SAL_OVERRIDE;
100 private:
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;
128 bool bMovie;
129 bool bAllObjects;
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);
148 void ResetAttrs();
149 void WaitInEffect( sal_uLong nMilliSeconds, sal_uLong nTime,
150 SfxProgress* pStbMgr ) const;
151 Fraction GetScale();
155 * ControllerItem for Animator
157 class AnimationControllerItem : public SfxControllerItem
160 public:
161 AnimationControllerItem( sal_uInt16, AnimationWindow*, SfxBindings* );
163 protected:
164 virtual void StateChanged( sal_uInt16 nSId, SfxItemState eState,
165 const SfxPoolItem* pState ) SAL_OVERRIDE;
166 private:
167 VclPtr<AnimationWindow> pAnimationWin;
170 } // end of namespace sd
172 #endif
174 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */