LibreOffice Module slideshow (master) 1
gdimtftools.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_ENGINE_SHAPES_GDIMTFTOOLS_HXX
21#define INCLUDED_SLIDESHOW_SOURCE_ENGINE_SHAPES_GDIMTFTOOLS_HXX
22
23#include <com/sun/star/uno/Reference.hxx>
24#include <com/sun/star/uno/XComponentContext.hpp>
25#include <com/sun/star/lang/XComponent.hpp>
26#include <com/sun/star/drawing/XDrawPage.hpp>
27
29
30#include <tools.hxx>
31
32#include <utility>
33#include <vector>
34
35class MetaAction;
36class GDIMetaFile;
37class Graphic;
38
39
40namespace slideshow::internal
41 {
55 };
56
57 // Animation info
58 // ==============
59
61 {
63 double nDuration ) :
64 mpMtf(std::move( xMtf )),
65 mnDuration( nDuration )
66 {
67 }
68
70 double getDuration() const
71 {
72 return mnDuration;
73 }
74
76 double mnDuration;
77 };
78
79 typedef ::std::vector< MtfAnimationFrame > VectorOfMtfAnimationFrames;
80
81
93 GDIMetaFileSharedPtr getMetaFile( const css::uno::Reference< css::lang::XComponent >& xSource,
94 const css::uno::Reference< css::drawing::XDrawPage >& xContainingPage,
95 int mtfLoadFlags,
96 const css::uno::Reference< css::uno::XComponentContext >& rxContext );
97
101 sal_Int32 getNextActionOffset( MetaAction * pCurrAct );
102
115 sal_uInt32& o_rLoopCount,
116 const Graphic& rGraphic);
117
124 ::basegfx::B2DRectangle& o_rPaintRect,
125 const GDIMetaFileSharedPtr& rMtf );
126}
127
128#endif // INCLUDED_SLIDESHOW_SOURCE_ENGINE_SHAPES_GDIMTFTOOLS_HXX
129
130/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
mtf_load_flags
meta file loading specialities:
Definition: gdimtftools.hxx:43
@ MTF_LOAD_FOREIGN_SOURCE
the source of the metafile might be a foreign application.
Definition: gdimtftools.hxx:50
@ MTF_LOAD_BACKGROUND_ONLY
retrieve a meta file for the page background only
Definition: gdimtftools.hxx:52
@ MTF_LOAD_NONE
no flags
Definition: gdimtftools.hxx:45
@ MTF_LOAD_SCROLL_TEXT_MTF
retrieve the drawing layer scroll text metafile
Definition: gdimtftools.hxx:54
std::shared_ptr< GDIMetaFile > GDIMetaFileSharedPtr
Definition: tools.hxx:63
bool getRectanglesFromScrollMtf(::basegfx::B2DRectangle &o_rScrollRect, ::basegfx::B2DRectangle &o_rPaintRect, const GDIMetaFileSharedPtr &rMtf)
Retrieve scroll text animation rectangles from given metafile.
bool getAnimationFromGraphic(VectorOfMtfAnimationFrames &o_rFrames, sal_uInt32 &o_rLoopCount, const Graphic &rGraphic)
Extract a vector of animation frames from given Graphic.
::std::vector< MtfAnimationFrame > VectorOfMtfAnimationFrames
Definition: gdimtftools.hxx:79
GDIMetaFileSharedPtr getMetaFile(const uno::Reference< lang::XComponent > &xSource, const uno::Reference< drawing::XDrawPage > &xContainingPage, int mtfLoadFlags, const uno::Reference< uno::XComponentContext > &rxContext)
sal_Int32 getNextActionOffset(MetaAction *pCurrAct)
Gets the next action offset for iterating meta actions which is most often returns 1.
double getDuration() const
Enables STL algos to be used for duration extraction.
Definition: gdimtftools.hxx:70
MtfAnimationFrame(GDIMetaFileSharedPtr xMtf, double nDuration)
Definition: gdimtftools.hxx:62