LibreOffice Module writerfilter (master) 1
WrapPolygonHandler.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#pragma once
21
22#include <com/sun/star/drawing/PointSequenceSequence.hpp>
23#include "LoggedResources.hxx"
24#include <tools/fract.hxx>
25#include <vector>
26
28{
29struct GraphicCrop;
30}
31
33{
35class WrapPolygon final : public virtual SvRefBase
36{
37public:
38 typedef std::vector<css::awt::Point> Points_t;
39 typedef ::tools::SvRef<WrapPolygon> Pointer_t;
40
41private:
43
44public:
46 ~WrapPolygon() override;
47
48 void addPoint(const css::awt::Point& rPoint);
49
50 Points_t::const_iterator begin() const;
51 Points_t::const_iterator end() const;
52
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;
60};
61
63{
64public:
66 virtual ~WrapPolygonHandler() override;
67
68 const WrapPolygon::Pointer_t& getPolygon() const { return mpPolygon; }
69
70private:
72
73 sal_Int32 mnX;
74 sal_Int32 mnY;
75
76 // Properties
77 virtual void lcl_attribute(Id Name, Value& val) override;
78 virtual void lcl_sprm(Sprm& sprm) override;
79};
80}
81
82/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void sprm(Sprm &sprm) override
Receives a SPRM.
An SPRM: Section, Paragraph and Run Modifier.
virtual void lcl_sprm(Sprm &sprm) override
virtual void lcl_attribute(Id Name, Value &val) override
const WrapPolygon::Pointer_t & getPolygon() const
Handles <wp:wrapPolygon> from DOCX and the pWrapPolygonVertices shape property from RTF.
WrapPolygon::Pointer_t correctCrop(const css::awt::Size &rGraphicSize, const css::text::GraphicCrop &rGraphicCrop) const
Points_t::const_iterator end() const
WrapPolygon::Pointer_t correctWordWrapPolygonPixel(const css::awt::Size &rSrcSize) const
::tools::SvRef< WrapPolygon > Pointer_t
WrapPolygon::Pointer_t correctWordWrapPolygon(const css::awt::Size &rSrcSize) const
WrapPolygon::Pointer_t scale(const Fraction &rFractionX, const Fraction &rFractionY) const
Points_t::const_iterator begin() const
void addPoint(const css::awt::Point &rPoint)
css::drawing::PointSequenceSequence getPointSequenceSequence() const
std::vector< css::awt::Point > Points_t
WrapPolygon::Pointer_t move(const css::awt::Point &rMove) const
sal_uInt32 Id