android: Update app-specific/MIME type icons
[LibreOffice.git] / writerfilter / source / dmapper / WrapPolygonHandler.hxx
blob8d3e1a3d8493825a189762eab0b08e405dbadff0
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 #pragma once
22 #include <com/sun/star/drawing/PointSequenceSequence.hpp>
23 #include "LoggedResources.hxx"
24 #include <tools/fract.hxx>
25 #include <vector>
27 namespace com::sun::star::text
29 struct GraphicCrop;
32 namespace writerfilter::dmapper
34 /// Handles <wp:wrapPolygon> from DOCX and the pWrapPolygonVertices shape property from RTF.
35 class WrapPolygon final : public virtual SvRefBase
37 public:
38 typedef std::vector<css::awt::Point> Points_t;
39 typedef ::tools::SvRef<WrapPolygon> Pointer_t;
41 private:
42 Points_t mPoints;
44 public:
45 WrapPolygon();
46 ~WrapPolygon() override;
48 void addPoint(const css::awt::Point& rPoint);
50 Points_t::const_iterator begin() const;
51 Points_t::const_iterator end() const;
53 WrapPolygon::Pointer_t move(const css::awt::Point& rMove) const;
54 WrapPolygon::Pointer_t scale(const Fraction& rFractionX, const Fraction& rFractionY) const;
55 WrapPolygon::Pointer_t correctWordWrapPolygon(const css::awt::Size& rSrcSize) const;
56 WrapPolygon::Pointer_t correctWordWrapPolygonPixel(const css::awt::Size& rSrcSize) const;
57 WrapPolygon::Pointer_t correctCrop(const css::awt::Size& rGraphicSize,
58 const css::text::GraphicCrop& rGraphicCrop) const;
59 css::drawing::PointSequenceSequence getPointSequenceSequence() const;
62 class WrapPolygonHandler : public LoggedProperties
64 public:
65 WrapPolygonHandler();
66 virtual ~WrapPolygonHandler() override;
68 const WrapPolygon::Pointer_t& getPolygon() const { return mpPolygon; }
70 private:
71 WrapPolygon::Pointer_t mpPolygon;
73 sal_Int32 mnX;
74 sal_Int32 mnY;
76 // Properties
77 virtual void lcl_attribute(Id Name, Value& val) override;
78 virtual void lcl_sprm(Sprm& sprm) override;
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */