LibreOffice Module slideshow (master) 1
animatedsprite.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#ifndef INCLUDED_SLIDESHOW_SOURCE_INC_ANIMATEDSPRITE_HXX
21#define INCLUDED_SLIDESHOW_SOURCE_INC_ANIMATEDSPRITE_HXX
22
27
28#include "viewlayer.hxx"
29
30#include <optional>
31#include <memory>
32
33
34/* Definition of AnimatedSprite class */
35
36namespace slideshow::internal
37 {
46 {
47 public:
64 const ::basegfx::B2DSize& rSpriteSizePixel,
65 double nSpritePrio );
68
74 void resize( const ::basegfx::B2DSize& rSpriteSizePixel );
75
82 void setPixelOffset( const ::basegfx::B2DSize& rPixelOffset );
83
85 void show();
86
88 void hide();
89
102
108 void movePixel( const ::basegfx::B2DPoint& rNewPos );
109
115 void setAlpha( double rAlpha );
116
122 void clip( const ::basegfx::B2DPolyPolygon& rClip );
123
129 void clip();
130
136 void transform( const ::basegfx::B2DHomMatrix& rTransform );
137
138 private:
140
144
146 double mnAlpha;
147 ::std::optional< ::basegfx::B2DPoint > maPosPixel;
148 ::std::optional< ::basegfx::B2DPolyPolygon > maClip;
149
151 };
152
153 typedef ::std::shared_ptr< AnimatedSprite > AnimatedSpriteSharedPtr;
154
155}
156
157#endif // INCLUDED_SLIDESHOW_SOURCE_INC_ANIMATEDSPRITE_HXX
158
159/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This class provides the sprite for animated shapes.
::cppcanvas::CustomSpriteSharedPtr mpSprite
void setPixelOffset(const ::basegfx::B2DSize &rPixelOffset)
Set an offset for the content output in pixel.
AnimatedSprite & operator=(const AnimatedSprite &)=delete
void resize(const ::basegfx::B2DSize &rSpriteSizePixel)
Resize the sprite.
void movePixel(const ::basegfx::B2DPoint &rNewPos)
Move the sprite in device pixel space.
::cppcanvas::CanvasSharedPtr getContentCanvas() const
Query the content canvas for the current sprite.
void transform(const ::basegfx::B2DHomMatrix &rTransform)
Set a sprite transformation.
AnimatedSprite(const AnimatedSprite &)=delete
void setAlpha(double rAlpha)
Set the alpha value of the sprite.
::std::optional< ::basegfx::B2DPoint > maPosPixel
AnimatedSprite(ViewLayerSharedPtr xViewLayer, const ::basegfx::B2DSize &rSpriteSizePixel, double nSpritePrio)
Create a new AnimatedSprite, for the given metafile shape.
::basegfx::B2DSize maEffectiveSpriteSizePixel
void clip()
Clears a sprite clip.
::std::optional< ::basegfx::B2DPolyPolygon > maClip
std::shared_ptr< ::cppcanvas::CustomSprite > CustomSpriteSharedPtr
std::shared_ptr< Canvas > CanvasSharedPtr
std::shared_ptr< ViewLayer > ViewLayerSharedPtr
Definition: viewlayer.hxx:168
::std::shared_ptr< AnimatedSprite > AnimatedSpriteSharedPtr