Coverage Report

Created: 2025-12-08 09:28

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/svx/sidebar/LinePropertyPanelBase.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_SOURCE_SIDEBAR_LINE_LINEPROPERTYPANELBASE_HXX
20
#define INCLUDED_SVX_SOURCE_SIDEBAR_LINE_LINEPROPERTYPANELBASE_HXX
21
22
#include <vcl/weld.hxx>
23
#include <memory>
24
#include <svl/poolitem.hxx>
25
#include <sfx2/sidebar/PanelLayout.hxx>
26
#include <svx/sidebar/LineWidthPopup.hxx>
27
#include <svx/svxdllapi.h>
28
#include <com/sun/star/frame/XFrame.hpp>
29
30
class ToolbarUnoDispatcher;
31
class XLineWidthItem;
32
class XLineTransparenceItem;
33
34
namespace svx::sidebar
35
{
36
class LineStyleNoneChange;
37
38
class UNLESS_MERGELIBS(SVX_DLLPUBLIC) LinePropertyPanelBase : public PanelLayout
39
{
40
public:
41
    virtual ~LinePropertyPanelBase() override;
42
43
    void SetWidth(tools::Long nWidth);
44
    void SetWidthIcon(int n);
45
    void SetWidthIcon();
46
47
    void EndLineWidthPopup();
48
49
    // constructor/destructor
50
    LinePropertyPanelBase(weld::Widget* pParent,
51
                          const css::uno::Reference<css::frame::XFrame>& rxFrame);
52
53
    virtual void setLineWidth(const XLineWidthItem& rItem) = 0;
54
55
    void SetNoneLineStyle(bool bNoneLineStyle)
56
0
    {
57
0
        if (bNoneLineStyle != mbNoneLineStyle)
58
0
        {
59
0
            mbNoneLineStyle = bNoneLineStyle;
60
0
            ActivateControls();
61
0
        }
62
0
    }
63
64
protected:
65
    void ActivateControls();
66
67
    virtual void setLineTransparency(const XLineTransparenceItem& rItem) = 0;
68
69
    void updateLineTransparence(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
70
    virtual void updateLineWidth(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
71
72
    void setMapUnit(MapUnit eMapUnit);
73
74
    void enableArrowHead();
75
    void disableArrowHead();
76
77
protected:
78
    std::unique_ptr<weld::Toolbar> mxTBColor;
79
    std::unique_ptr<ToolbarUnoDispatcher> mxColorDispatch;
80
81
    std::unique_ptr<weld::Toolbar> mxLineStyleTB;
82
    std::unique_ptr<ToolbarUnoDispatcher> mxLineStyleDispatch;
83
84
    sal_Int32 mnWidthCoreValue;
85
86
private:
87
    //ui controls
88
    std::unique_ptr<weld::Label> mxFTWidth;
89
    std::unique_ptr<weld::Toolbar> mxTBWidth;
90
    std::unique_ptr<weld::Label> mxFTTransparency;
91
    std::unique_ptr<weld::MetricSpinButton> mxMFTransparent;
92
    std::unique_ptr<weld::Label> mxArrowHeadStyleFT;
93
    std::unique_ptr<weld::Toolbar> mxArrowHeadStyleTB;
94
    std::unique_ptr<ToolbarUnoDispatcher> mxArrowHeadStyleDispatch;
95
    //popup windows
96
    std::unique_ptr<LineWidthPopup> mxLineWidthPopup;
97
98
    std::unique_ptr<LineStyleNoneChange> mxLineStyleNoneChange;
99
100
    sal_uInt16 mnTrans;
101
    MapUnit meMapUnit;
102
103
    // images from resource
104
    OUString maIMGNone;
105
106
    // multi-images
107
    Bitmap maIMGWidthIcon[8];
108
109
    bool mbWidthValuable : 1;
110
    bool mbArrowSupported;
111
    bool mbNoneLineStyle;
112
113
    void Initialize();
114
115
    DECL_DLLPRIVATE_LINK(ToolboxWidthSelectHdl, const OUString&, void);
116
    DECL_DLLPRIVATE_LINK(ToolboxWidthToggleMenuHdl, const OUString&, void);
117
    DECL_DLLPRIVATE_LINK(ChangeTransparentHdl, weld::MetricSpinButton&, void);
118
};
119
120
} // end of namespace svx::sidebar
121
122
#endif
123
124
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */