android: Update app-specific/MIME type icons
[LibreOffice.git] / slideshow / source / engine / shapes / gdimtftools.hxx
blob8395efeb00a2a3a28268361b459b3c2a5bdc4b1f
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 <utility>
33 #include <vector>
35 class MetaAction;
36 class GDIMetaFile;
37 class Graphic;
40 namespace slideshow::internal
42 /// meta file loading specialities:
43 enum mtf_load_flags {
44 /// no flags
45 MTF_LOAD_NONE = 0,
46 /// the source of the metafile might be a foreign
47 /// application. The metafile is checked against unsupported
48 /// content, and, if necessary, returned as a pre-rendered
49 /// bitmap.
50 MTF_LOAD_FOREIGN_SOURCE = 2,
51 /// retrieve a meta file for the page background only
52 MTF_LOAD_BACKGROUND_ONLY = 4,
53 /// retrieve the drawing layer scroll text metafile
54 MTF_LOAD_SCROLL_TEXT_MTF = 8
57 // Animation info
58 // ==============
60 struct MtfAnimationFrame
62 MtfAnimationFrame( GDIMetaFileSharedPtr xMtf,
63 double nDuration ) :
64 mpMtf(std::move( xMtf )),
65 mnDuration( nDuration )
69 /// Enables STL algos to be used for duration extraction
70 double getDuration() const
72 return mnDuration;
75 GDIMetaFileSharedPtr mpMtf;
76 double mnDuration;
79 typedef ::std::vector< MtfAnimationFrame > VectorOfMtfAnimationFrames;
82 /** Retrieve a meta file for the given shape
84 @param xShape
85 XShape to retrieve a metafile for.
87 @param xContainingPage
88 The page that contains this shape. Needed for proper
89 import (currently, the UnoGraphicExporter needs this
90 information).
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 );
98 /** Gets the next action offset for iterating meta actions which is most
99 often returns 1.
101 sal_Int32 getNextActionOffset( MetaAction * pCurrAct );
103 /** Extract a vector of animation frames from given Graphic.
105 @param o_rFrames
106 Resulting vector of animated metafiles
108 @param o_rLoopCount
109 Number of times the bitmap animation shall be repeated
111 @param rGraphic
112 Input graphic object, to extract animations from
114 bool getAnimationFromGraphic(VectorOfMtfAnimationFrames& o_rFrames,
115 sal_uInt32& o_rLoopCount,
116 const Graphic& rGraphic);
118 /** Retrieve scroll text animation rectangles from given metafile
120 @return true, if both rectangles have been found, false
121 otherwise.
123 bool getRectanglesFromScrollMtf( ::basegfx::B2DRectangle& o_rScrollRect,
124 ::basegfx::B2DRectangle& o_rPaintRect,
125 const GDIMetaFileSharedPtr& rMtf );
128 #endif // INCLUDED_SLIDESHOW_SOURCE_ENGINE_SHAPES_GDIMTFTOOLS_HXX
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */