xref: /AOO41X/main/svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx (revision 414a0e15e815c63b516e4c585a9b911a100c756a)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SDR_OVERLAY_OVERLAYANIMATEDBITMAPEX_HXX
25 #define _SDR_OVERLAY_OVERLAYANIMATEDBITMAPEX_HXX
26 
27 #include <svx/sdr/overlay/overlayobject.hxx>
28 #include <vcl/bitmapex.hxx>
29 
30 //////////////////////////////////////////////////////////////////////////////
31 
32 namespace sdr
33 {
34     namespace overlay
35     {
36         class SVX_DLLPUBLIC OverlayAnimatedBitmapEx : public OverlayObjectWithBasePosition
37         {
38         protected:
39             // the Bitmaps
40             BitmapEx                                maBitmapEx1;
41             BitmapEx                                maBitmapEx2;
42 
43             // position of the basePosition inside the Bitmaps, in pixels
44             sal_uInt16                              mnCenterX1;
45             sal_uInt16                              mnCenterY1;
46             sal_uInt16                              mnCenterX2;
47             sal_uInt16                              mnCenterY2;
48 
49             // #i53216# added CursorBlinkTime (in ms)
50             sal_uInt32                              mnBlinkTime;
51 
52             // optional shear and rotation
53             double                                  mfShearX;
54             double                                  mfRotation;
55 
56             /// bitfield
57             // Flag to remember which state to draw. Inited with false (0)
58             bool                                    mbOverlayState : 1;
59 
60             // geometry creation for OverlayObject
61             virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
62 
63         public:
64             OverlayAnimatedBitmapEx(
65                 const basegfx::B2DPoint& rBasePos,
66                 const BitmapEx& rBitmapEx1,
67                 const BitmapEx& rBitmapEx2,
68                 sal_uInt32 nBlinkTime = 500,
69                 sal_uInt16 nCenX1 = 0,
70                 sal_uInt16 nCenY1 = 0,
71                 sal_uInt16 nCenX2 = 0,
72                 sal_uInt16 nCenY2 = 0,
73                 double fShearX = 0.0,
74                 double fRotation = 0.0);
75             virtual ~OverlayAnimatedBitmapEx();
76 
getBitmapEx1() const77             const BitmapEx& getBitmapEx1() const { return maBitmapEx1; }
getBitmapEx2() const78             const BitmapEx& getBitmapEx2() const { return maBitmapEx2; }
79             void setBitmapEx1(const BitmapEx& rNew);
80             void setBitmapEx2(const BitmapEx& rNew);
81 
getCenterX1() const82             sal_uInt16 getCenterX1() const { return mnCenterX1; }
getCenterY1() const83             sal_uInt16 getCenterY1() const { return mnCenterY1; }
getCenterX2() const84             sal_uInt16 getCenterX2() const { return mnCenterX2; }
getCenterY2() const85             sal_uInt16 getCenterY2() const { return mnCenterY2; }
86             void setCenterXY1(sal_uInt16 nNewX, sal_uInt16 nNewY);
87             void setCenterXY2(sal_uInt16 nNewX, sal_uInt16 nNewY);
88 
89             // #i53216# added CursorBlinkTime (in ms)
getBlinkTime() const90             sal_uInt32 getBlinkTime() const { return mnBlinkTime; }
91             void setBlinkTime(sal_uInt32 nNew);
92 
93             // execute event from base class ::sdr::animation::Event. Default
94             // implementation does nothing and does not create a new event.
95             virtual void Trigger(sal_uInt32 nTime);
96 
97             // get shearX and rotation
getShearX() const98             double getShearX() const { return mfShearX; }
getRotation() const99             double getRotation() const { return mfRotation; }
100         };
101     } // end of namespace overlay
102 } // end of namespace sdr
103 
104 //////////////////////////////////////////////////////////////////////////////
105 
106 #endif //_SDR_OVERLAY_OVERLAYANIMATEDBITMAPEX_HXX
107 
108 // eof
109