Coverage Report

Created: 2026-05-16 09:25

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/svx/sxcecitm.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
 * 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
#ifndef INCLUDED_SVX_SXCECITM_HXX
20
#define INCLUDED_SVX_SXCECITM_HXX
21
22
#include <svl/eitem.hxx>
23
#include <svx/svddef.hxx>
24
#include <svx/sdynitm.hxx>
25
#include <svx/sdmetitm.hxx>
26
#include <svx/svxdllapi.h>
27
28
enum class SdrCaptionEscDir { Horizontal, Vertical, BestFit };
29
30
31
// class SdrCaptionEscDirItem
32
33
class SVXCORE_DLLPUBLIC SdrCaptionEscDirItem final : public SfxEnumItem<SdrCaptionEscDir> {
34
public:
35
    DECLARE_ITEM_TYPE_FUNCTION(SdrCaptionEscDirItem)
36
    SdrCaptionEscDirItem(SdrCaptionEscDir eDir=SdrCaptionEscDir::Horizontal)
37
19.7k
        : SfxEnumItem(SDRATTR_CAPTIONESCDIR, eDir) {}
38
    SAL_DLLPRIVATE virtual SdrCaptionEscDirItem* Clone(SfxItemPool* pPool=nullptr) const override;
39
40
    SAL_DLLPRIVATE static OUString GetValueTextByPos(sal_uInt16 nPos);
41
42
    SAL_DLLPRIVATE virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString& rText, const IntlWrapper&) const override;
43
};
44
45
46
// class SdrCaptionEscIsRelItem
47
// sal_True = line escape position is relative
48
// sal_False = line escape position is absolute
49
50
class SVXCORE_DLLPUBLIC SdrCaptionEscIsRelItem final : public SdrYesNoItem {
51
public:
52
    DECLARE_ITEM_TYPE_FUNCTION(SdrCaptionEscIsRelItem)
53
19
    SdrCaptionEscIsRelItem(bool bRel=true): SdrYesNoItem(SDRATTR_CAPTIONESCISREL,bRel) {}
54
    virtual ~SdrCaptionEscIsRelItem() override;
55
    virtual SdrCaptionEscIsRelItem* Clone(SfxItemPool* pPool=nullptr) const override;
56
57
0
    SdrCaptionEscIsRelItem(SdrCaptionEscIsRelItem const &) = default;
58
    SdrCaptionEscIsRelItem(SdrCaptionEscIsRelItem &&) = default;
59
    SdrCaptionEscIsRelItem & operator =(SdrCaptionEscIsRelItem const &) = delete; // due to SdrYesNoItem
60
    SdrCaptionEscIsRelItem & operator =(SdrCaptionEscIsRelItem &&) = delete; // due to SdrYesNoItem
61
};
62
63
64
// class SdrCaptionEscRelItem
65
// relative line escape
66
//     0 =   0.00% = up resp. left,
67
// 10000 = 100.00% = right resp. down
68
// only when SdrCaptionEscIsRelItem=TRUE
69
70
class SVXCORE_DLLPUBLIC SdrCaptionEscRelItem final : public SfxInt32Item {
71
public:
72
    DECLARE_ITEM_TYPE_FUNCTION(SdrCaptionEscRelItem)
73
19
    SdrCaptionEscRelItem(sal_Int32 nEscRel=5000): SfxInt32Item(SDRATTR_CAPTIONESCREL, nEscRel) {}
74
    virtual ~SdrCaptionEscRelItem() override;
75
    virtual SdrCaptionEscRelItem* Clone(SfxItemPool* pPool=nullptr) const override;
76
77
0
    SdrCaptionEscRelItem(SdrCaptionEscRelItem const &) = default;
78
    SdrCaptionEscRelItem(SdrCaptionEscRelItem &&) = default;
79
    SdrCaptionEscRelItem & operator =(SdrCaptionEscRelItem const &) = delete; // due to SfxInt32Item
80
    SdrCaptionEscRelItem & operator =(SdrCaptionEscRelItem &&) = delete; // due to SfxInt32Item
81
};
82
83
84
// class SdrCaptionEscAbsItem
85
// absolute line escape
86
// 0  = up resp. left,
87
// >0 = in direction right resp. down
88
// only when SdrCaptionEscIsRelItem=FALSE
89
90
class SdrCaptionEscAbsItem final : public SdrMetricItem {
91
public:
92
    DECLARE_ITEM_TYPE_FUNCTION(SdrCaptionEscAbsItem)
93
19
    SdrCaptionEscAbsItem(tools::Long nEscAbs=0): SdrMetricItem(SDRATTR_CAPTIONESCABS, nEscAbs) {}
94
    virtual SdrCaptionEscAbsItem* Clone(SfxItemPool*) const override
95
0
    {
96
0
        return new SdrCaptionEscAbsItem(*this);
97
0
    }
98
};
99
100
#endif
101
102
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */