Bump version to 6.0-36
[LibreOffice.git] / slideshow / source / engine / shapes / gdimtftools.hxx
blobf33dcc93fa151455bde3b1f08ba495e00402163e
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 INCLUDED_SLIDESHOW_SOURCE_ENGINE_SHAPES_GDIMTFTOOLS_HXX
21 #define INCLUDED_SLIDESHOW_SOURCE_ENGINE_SHAPES_GDIMTFTOOLS_HXX
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>
28 #include <basegfx/range/b2drectangle.hxx>
30 #include <tools.hxx>
32 #include <vector>
34 class MetaAction;
35 class GDIMetaFile;
36 class Graphic;
39 namespace slideshow
41 namespace internal
43 /// meta file loading specialities:
44 enum mtf_load_flags {
45 /// no flags
46 MTF_LOAD_NONE = 0,
47 /// the source of the metafile might be a foreign
48 /// application. The metafile is checked against unsupported
49 /// content, and, if necessary, returned as a pre-rendererd
50 /// bitmap.
51 MTF_LOAD_FOREIGN_SOURCE = 2,
52 /// retrieve a meta file for the page background only
53 MTF_LOAD_BACKGROUND_ONLY = 4,
54 /// retrieve the drawing layer scroll text metafile
55 MTF_LOAD_SCROLL_TEXT_MTF = 8
58 // Animation info
59 // ==============
61 struct MtfAnimationFrame
63 MtfAnimationFrame( const GDIMetaFileSharedPtr& rMtf,
64 double nDuration ) :
65 mpMtf( rMtf ),
66 mnDuration( nDuration )
70 /// Enables STL algos to be used for duration extraction
71 double getDuration() const
73 return mnDuration;
76 GDIMetaFileSharedPtr mpMtf;
77 double mnDuration;
80 typedef ::std::vector< MtfAnimationFrame > VectorOfMtfAnimationFrames;
83 /** Retrieve a meta file for the given shape
85 @param xShape
86 XShape to retrieve a metafile for.
88 @param xContainingPage
89 The page that contains this shape. Needed for proper
90 import (currently, the UnoGraphicExporter needs this
91 information).
94 GDIMetaFileSharedPtr getMetaFile( const css::uno::Reference< css::lang::XComponent >& xSource,
95 const css::uno::Reference< css::drawing::XDrawPage >& xContainingPage,
96 int mtfLoadFlags,
97 const css::uno::Reference< css::uno::XComponentContext >& rxContext );
99 /** Gets the next action offset for iterating meta actions which is most
100 often returns 1.
102 sal_Int32 getNextActionOffset( MetaAction * pCurrAct );
104 /** Extract a vector of animation frames from given Graphic.
106 @param o_rFrames
107 Resulting vector of animated metafiles
109 @param o_rLoopCount
110 Number of times the bitmap animation shall be repeated
112 @param rGraphic
113 Input graphic object, to extract animations from
115 bool getAnimationFromGraphic(VectorOfMtfAnimationFrames& o_rFrames,
116 sal_uInt32& o_rLoopCount,
117 const Graphic& rGraphic);
119 /** Retrieve scroll text animation rectangles from given metafile
121 @return true, if both rectangles have been found, false
122 otherwise.
124 bool getRectanglesFromScrollMtf( ::basegfx::B2DRectangle& o_rScrollRect,
125 ::basegfx::B2DRectangle& o_rPaintRect,
126 const GDIMetaFileSharedPtr& rMtf );
130 #endif // INCLUDED_SLIDESHOW_SOURCE_ENGINE_SHAPES_GDIMTFTOOLS_HXX
132 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */