Coverage Report

Created: 2026-11-06 11:29

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/starmath/inc/ElementsDockingWindow.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
20
#pragma once
21
22
#include <sfx2/dockwin.hxx>
23
#include <vcl/weld/IconView.hxx>
24
#include <vcl/weld/customweld.hxx>
25
#include <unotools/resmgr.hxx>
26
27
#include "node.hxx"
28
#include "parsebase.hxx"
29
30
#include <memory>
31
#include <vector>
32
33
class SmDocShell;
34
struct ElementData;
35
36
class SmElementsControl
37
{
38
    std::unique_ptr<AbstractSmParser> maParser;
39
40
    SmDocShell*   mpDocShell;
41
    SmFormat      maFormat;
42
    int           mnCurrentSetIndex;
43
    sal_Int16     m_nSmSyntaxVersion;
44
    bool          m_bAllowDelete;
45
46
    std::vector<std::unique_ptr<ElementData>> maItemDatas;
47
    std::unique_ptr<weld::IconView> mpIconView;
48
    std::unique_ptr<weld::Menu> mxPopup;
49
50
    Link<const OUString&, void> maSelectHdlLink;
51
52
    void addElement(const OUString& aElementVisual, const OUString& aElementSource, const OUString& aHelpText);
53
    void addElements(int nCategory);
54
55
    void build();
56
57
    DECL_LINK(ElementActivatedHandler, const weld::TreeIter&, bool);
58
    DECL_LINK(CommandHdl, const CommandEvent&, bool);
59
60
    static OUString GetElementSource(const OUString& itemId);
61
    static OUString GetElementHelpText(const OUString& itemId);
62
63
public:
64
65
    explicit SmElementsControl(std::unique_ptr<weld::IconView> pIconView,
66
                               std::unique_ptr<weld::Menu> pMenu);
67
    ~SmElementsControl();
68
69
    static const std::vector<TranslateId>& categories();
70
    void setElementSetIndex(int nSetIndex, bool bForceBuild = false);
71
72
    void setSmSyntaxVersion(sal_Int16 nSmSyntaxVersion);
73
74
0
    void SetSelectHdl(const Link<const OUString&, void>& rLink) { maSelectHdlLink = rLink; }
75
76
0
    void SetAllowDelete(bool bAllow) { m_bAllowDelete = bAllow; }
77
78
    static Color GetTextColor();
79
    static Color GetControlBackground();
80
};
81
82
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */