LibreOffice Module sd (master) 1
animobjs.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <sfx2/dockwin.hxx>
23#include <tools/fract.hxx>
24#include <sfx2/ctrlitem.hxx>
25#include <sfx2/progress.hxx>
26#include <misc/scopelock.hxx>
27#include <vcl/bitmapex.hxx>
28#include <vcl/customweld.hxx>
29#include <vcl/weld.hxx>
30#include <vcl/weldutils.hxx>
31
32class SdDrawDocument;
33
34namespace sd {
35
36class AnimationControllerItem;
37class View;
38
40{
50};
51
53{
54private:
57
58public:
59 SdDisplay();
60 virtual ~SdDisplay() override;
61
62 virtual void Paint( vcl::RenderContext& rRenderContext, const ::tools::Rectangle& rRect ) override;
63
64 void SetBitmapEx( BitmapEx const * pBmpEx );
65 void SetScale( const Fraction& rFrac );
66
67 virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
68};
69
71{
74
75public:
77 virtual ~AnimationWindow() override;
78 virtual void dispose() override;
79
80 void AddObj( ::sd::View& rView );
81 void CreateAnimObj( ::sd::View& rView );
82
83 virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
84
85protected:
86 virtual bool Close() override;
87 virtual void Resize() override;
88
89private:
90 std::unique_ptr<SdDisplay> m_xCtlDisplay;
91 std::unique_ptr<weld::CustomWeld> m_xCtlDisplayWin;
92 std::unique_ptr<weld::Button> m_xBtnFirst;
93 std::unique_ptr<weld::Button> m_xBtnReverse;
94 std::unique_ptr<weld::Button> m_xBtnStop;
95 std::unique_ptr<weld::Button> m_xBtnPlay;
96 std::unique_ptr<weld::Button> m_xBtnLast;
97 std::unique_ptr<weld::SpinButton> m_xNumFldBitmap;
98 std::unique_ptr<weld::FormattedSpinButton> m_xTimeField;
99 std::unique_ptr<weld::TimeFormatter> m_xFormatter;
100 std::unique_ptr<weld::ComboBox> m_xLbLoopCount;
101 std::unique_ptr<weld::Button> m_xBtnGetOneObject;
102 std::unique_ptr<weld::Button> m_xBtnGetAllObjects;
103 std::unique_ptr<weld::Button> m_xBtnRemoveBitmap;
104 std::unique_ptr<weld::Button> m_xBtnRemoveAll;
105 std::unique_ptr<weld::Label> m_xFiCount;
106
107 std::unique_ptr<weld::RadioButton> m_xRbtGroup;
108 std::unique_ptr<weld::RadioButton> m_xRbtBitmap;
109 std::unique_ptr<weld::Label> m_xFtAdjustment;
110 std::unique_ptr<weld::ComboBox> m_xLbAdjustment;
111 std::unique_ptr<weld::Button> m_xBtnCreateGroup;
112 std::unique_ptr<weld::Button> m_xBtnHelp;
113
114 ::std::vector< ::std::pair<BitmapEx, ::tools::Time> > m_FrameList;
115 static const size_t EMPTY_FRAMELIST;
117 std::unique_ptr<SdDrawDocument> pMyDoc;
118
119 bool bMovie;
121
122 std::unique_ptr<AnimationControllerItem> pControllerItem;
123
125
126 DECL_LINK( ClickFirstHdl, weld::Button&, void );
127 DECL_LINK( ClickStopHdl, weld::Button&, void );
128 DECL_LINK( ClickPlayHdl, weld::Button&, void );
129 DECL_LINK( ClickLastHdl, weld::Button&, void );
130 DECL_LINK( ClickGetObjectHdl, weld::Button&, void );
131 DECL_LINK( ClickRemoveBitmapHdl, weld::Button&, void );
132 DECL_LINK( ClickRbtHdl, weld::Toggleable&, void );
133 DECL_LINK( ClickHelpHdl, weld::Button&, void );
134 DECL_LINK( ClickCreateGroupHdl, weld::Button&, void );
135 DECL_LINK( ModifyBitmapHdl, weld::SpinButton&, void );
136 DECL_LINK( ModifyTimeHdl, weld::FormattedSpinButton&, void );
137
138 void UpdateControl(bool bDisableCtrls = false);
139 void ResetAttrs();
140 void WaitInEffect( sal_uLong nMilliSeconds, sal_uLong nTime,
141 SfxProgress* pStbMgr ) const;
143};
144
149{
150
151public:
153
154protected:
155 virtual void StateChangedAtToolBoxControl( sal_uInt16 nSId, SfxItemState eState,
156 const SfxPoolItem* pState ) override;
157private:
159};
160
161} // end of namespace sd
162
163/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxBindings * pBindings
ControllerItem for Animator.
Definition: animobjs.hxx:149
AnimationControllerItem(sal_uInt16, AnimationWindow *, SfxBindings *)
ControllerItem for Animator.
Definition: animobjs.cxx:1099
virtual void StateChangedAtToolBoxControl(sal_uInt16 nSId, SfxItemState eState, const SfxPoolItem *pState) override
Definition: animobjs.cxx:1108
VclPtr< AnimationWindow > pAnimationWin
Definition: animobjs.hxx:158
std::unique_ptr< weld::RadioButton > m_xRbtBitmap
Definition: animobjs.hxx:108
std::unique_ptr< weld::ComboBox > m_xLbLoopCount
Definition: animobjs.hxx:100
DECL_LINK(ClickStopHdl, weld::Button &, void)
void WaitInEffect(sal_uLong nMilliSeconds, sal_uLong nTime, SfxProgress *pStbMgr) const
Definition: animobjs.cxx:614
virtual bool Close() override
Definition: animobjs.cxx:666
void CreateAnimObj(::sd::View &rView)
Definition: animobjs.cxx:865
std::unique_ptr< weld::Button > m_xBtnStop
Definition: animobjs.hxx:94
std::unique_ptr< weld::Button > m_xBtnRemoveAll
Definition: animobjs.hxx:104
std::unique_ptr< AnimationControllerItem > pControllerItem
Definition: animobjs.hxx:122
virtual void Resize() override
Definition: animobjs.cxx:659
void UpdateControl(bool bDisableCtrls=false)
Definition: animobjs.cxx:505
DECL_LINK(ClickLastHdl, weld::Button &, void)
DECL_LINK(ClickGetObjectHdl, weld::Button &, void)
std::unique_ptr< weld::SpinButton > m_xNumFldBitmap
Definition: animobjs.hxx:97
std::unique_ptr< weld::ComboBox > m_xLbAdjustment
Definition: animobjs.hxx:110
std::unique_ptr< SdDrawDocument > pMyDoc
Definition: animobjs.hxx:117
DECL_LINK(ModifyTimeHdl, weld::FormattedSpinButton &, void)
DECL_LINK(ClickCreateGroupHdl, weld::Button &, void)
std::unique_ptr< weld::Button > m_xBtnFirst
Definition: animobjs.hxx:92
std::unique_ptr< SdDisplay > m_xCtlDisplay
Definition: animobjs.hxx:90
std::unique_ptr< weld::RadioButton > m_xRbtGroup
Definition: animobjs.hxx:107
std::unique_ptr< weld::Button > m_xBtnRemoveBitmap
Definition: animobjs.hxx:103
std::unique_ptr< weld::TimeFormatter > m_xFormatter
Definition: animobjs.hxx:99
DECL_LINK(ClickRemoveBitmapHdl, weld::Button &, void)
std::unique_ptr< weld::Button > m_xBtnReverse
Definition: animobjs.hxx:93
std::unique_ptr< weld::Label > m_xFiCount
Definition: animobjs.hxx:105
virtual void dispose() override
Definition: animobjs.cxx:197
::std::vector< ::std::pair< BitmapEx, ::tools::Time > > m_FrameList
Definition: animobjs.hxx:114
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
Definition: animobjs.cxx:1086
void AddObj(::sd::View &rView)
Definition: animobjs.cxx:686
std::unique_ptr< weld::FormattedSpinButton > m_xTimeField
Definition: animobjs.hxx:98
std::unique_ptr< weld::Button > m_xBtnPlay
Definition: animobjs.hxx:95
DECL_LINK(ClickPlayHdl, weld::Button &, void)
std::unique_ptr< weld::Button > m_xBtnGetAllObjects
Definition: animobjs.hxx:102
AnimationWindow(SfxBindings *pBindings, SfxChildWindow *pCW, vcl::Window *pParent)
AnimationWindow - FloatingWindow.
Definition: animobjs.cxx:124
std::unique_ptr< weld::Button > m_xBtnCreateGroup
Definition: animobjs.hxx:111
std::unique_ptr< weld::Button > m_xBtnGetOneObject
Definition: animobjs.hxx:101
DECL_LINK(ClickRbtHdl, weld::Toggleable &, void)
virtual ~AnimationWindow() override
Definition: animobjs.cxx:192
DECL_LINK(ClickHelpHdl, weld::Button &, void)
std::unique_ptr< weld::Button > m_xBtnLast
Definition: animobjs.hxx:96
DECL_LINK(ModifyBitmapHdl, weld::SpinButton &, void)
ScopeLock maPlayLock
Definition: animobjs.hxx:124
Fraction GetScale()
Definition: animobjs.cxx:633
std::unique_ptr< weld::Label > m_xFtAdjustment
Definition: animobjs.hxx:109
static const size_t EMPTY_FRAMELIST
Definition: animobjs.hxx:115
DECL_LINK(ClickFirstHdl, weld::Button &, void)
std::unique_ptr< weld::CustomWeld > m_xCtlDisplayWin
Definition: animobjs.hxx:91
std::unique_ptr< weld::Button > m_xBtnHelp
Definition: animobjs.hxx:112
void SetBitmapEx(BitmapEx const *pBmpEx)
Definition: animobjs.cxx:66
void SetScale(const Fraction &rFrac)
Definition: animobjs.cxx:106
SdDisplay()
SdDisplay - Control.
Definition: animobjs.cxx:57
virtual ~SdDisplay() override
Definition: animobjs.cxx:62
virtual void Paint(vcl::RenderContext &rRenderContext, const ::tools::Rectangle &rRect) override
Definition: animobjs.cxx:80
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
Definition: animobjs.cxx:111
BitmapEx aBitmapEx
Definition: animobjs.hxx:55
Fraction aScale
Definition: animobjs.hxx:56
BitmapAdjustment
Definition: animobjs.hxx:40
@ BA_LEFT
Definition: animobjs.hxx:42
@ BA_UP
Definition: animobjs.hxx:44
@ BA_RIGHT_DOWN
Definition: animobjs.hxx:49
@ BA_RIGHT
Definition: animobjs.hxx:48
@ BA_RIGHT_UP
Definition: animobjs.hxx:47
@ BA_LEFT_DOWN
Definition: animobjs.hxx:43
@ BA_DOWN
Definition: animobjs.hxx:46
@ BA_CENTER
Definition: animobjs.hxx:45
@ BA_LEFT_UP
Definition: animobjs.hxx:41
SfxItemState
sal_uIntPtr sal_uLong