Coverage Report

Created: 2026-05-16 09:25

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/vcl/pdf/PDFAnnotationMarker.hxx
Line
Count
Source
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
 */
10
11
#pragma once
12
13
#include <vcl/dllapi.h>
14
#include <tools/color.hxx>
15
#include <basegfx/polygon/b2dpolygon.hxx>
16
#include <basegfx/point/b2dpoint.hxx>
17
#include <vcl/bitmap.hxx>
18
19
namespace vcl::pdf
20
{
21
/** PDF Annotation marker
22
 *
23
 * All units in 100th mm.
24
 */
25
struct VCL_DLLPUBLIC PDFAnnotationMarker
26
{
27
    float mnWidth = 0.0;
28
    Color maFillColor = COL_TRANSPARENT;
29
};
30
31
/** Stamp annotation marker - arbitrary bitmap as annotation */
32
struct VCL_DLLPUBLIC PDFAnnotationMarkerStamp : public PDFAnnotationMarker
33
{
34
    Bitmap maBitmap;
35
};
36
37
/** Free text annotation marker - showing text of the annotation in the document */
38
struct VCL_DLLPUBLIC PDFAnnotationMarkerFreeText : public PDFAnnotationMarker
39
{
40
    OUString maDefaultStyle;
41
    OUString maRichContent;
42
};
43
44
struct VCL_DLLPUBLIC PDFAnnotationMarkerCircle : public PDFAnnotationMarker
45
{
46
};
47
48
struct VCL_DLLPUBLIC PDFAnnotationMarkerSquare : public PDFAnnotationMarker
49
{
50
};
51
52
struct VCL_DLLPUBLIC PDFAnnotationMarkerInk : public PDFAnnotationMarker
53
{
54
    std::vector<basegfx::B2DPolygon> maStrokes;
55
};
56
57
struct VCL_DLLPUBLIC PDFAnnotationMarkerPolygon : public PDFAnnotationMarker
58
{
59
    basegfx::B2DPolygon maPolygon;
60
};
61
62
struct VCL_DLLPUBLIC PDFAnnotationMarkerLine : public PDFAnnotationMarker
63
{
64
    basegfx::B2DPoint maLineStart;
65
    basegfx::B2DPoint maLineEnd;
66
};
67
68
enum class PDFTextMarkerType
69
{
70
    Highlight,
71
    Underline,
72
    Squiggly,
73
    StrikeOut
74
};
75
76
struct VCL_DLLPUBLIC PDFAnnotationMarkerHighlight : public PDFAnnotationMarker
77
{
78
    std::vector<basegfx::B2DPolygon> maQuads;
79
    PDFTextMarkerType meTextMarkerType;
80
81
    PDFAnnotationMarkerHighlight(PDFTextMarkerType eTextMarkerType)
82
3
        : meTextMarkerType(eTextMarkerType)
83
3
    {
84
3
    }
85
};
86
87
} // namespace vcl::pdf
88
89
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */