bump product version to 4.1.6.2
[LibreOffice.git] / sd / source / ui / inc / animobjs.hxx
blobe46cf30ebd27caa17fd30e8b0e1304c28bd87d36
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 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"
40 class SdDrawDocument;
41 class BitmapEx;
43 namespace sd {
45 class AnimationControllerItem;
46 class View;
48 //------------------------------------------------------------------------
50 enum BitmapAdjustment
52 BA_LEFT_UP,
53 BA_LEFT,
54 BA_LEFT_DOWN,
55 BA_UP,
56 BA_CENTER,
57 BA_DOWN,
58 BA_RIGHT_UP,
59 BA_RIGHT,
60 BA_RIGHT_DOWN
63 //------------------------------------------------------------------------
65 class SdDisplay : public Control
67 private:
68 BitmapEx aBitmapEx;
69 Fraction aScale;
71 public:
72 SdDisplay( ::Window* pWin, SdResId Id );
73 ~SdDisplay();
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;
90 public:
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 );
100 protected:
101 virtual sal_Bool Close();
102 virtual void Resize();
103 virtual void FillInfo( SfxChildWinInfo& ) const;
105 private:
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;
120 FixedText aFtCount;
121 FixedInfo aFiCount;
122 FixedLine aGrpAnimation;
124 RadioButton aRbtGroup;
125 RadioButton aRbtBitmap;
126 FixedText aFtAdjustment;
127 ListBox aLbAdjustment;
128 PushButton aBtnCreateGroup;
130 HelpButton aBtnHelp;
133 ::Window* pWin;
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;
139 Size aSize;
140 Size aFltWinSize;
141 Size aDisplaySize;
142 Size aBmpSize;
143 sal_Bool bMovie;
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);
164 void ResetAttrs();
165 void WaitInEffect( sal_uLong nMilliSeconds, sal_uLong nTime,
166 SfxProgress* pStbMgr ) const;
167 Fraction GetScale();
171 * ControllerItem for Animator
173 class AnimationControllerItem : public SfxControllerItem
176 public:
177 AnimationControllerItem( sal_uInt16, AnimationWindow*, SfxBindings* );
179 protected:
180 virtual void StateChanged( sal_uInt16 nSId, SfxItemState eState,
181 const SfxPoolItem* pState );
182 private:
183 AnimationWindow* pAnimationWin;
186 } // end of namespace sd
188 #endif
190 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */