Coverage Report

Created: 2026-11-06 11:29

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/framework/source/uiconfiguration/CommandImageResolver.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
#pragma once
11
12
#include <vcl/image.hxx>
13
#include <vcl/vclenum.hxx>
14
15
#include <com/sun/star/uno/Sequence.hxx>
16
17
#include "ImageList.hxx"
18
19
#include <memory>
20
#include <unordered_map>
21
#include <vector>
22
#include <map>
23
#include <tuple>
24
25
namespace vcl
26
{
27
class CommandImageResolver final
28
{
29
private:
30
    typedef std::unordered_map<OUString, OUString> CommandToImageNameMap;
31
32
    CommandToImageNameMap m_aCommandToImageNameMap;
33
    std::vector<OUString> m_aImageCommandNameVector;
34
    std::vector<OUString> m_aImageNameVector;
35
36
    std::map<std::tuple<ImageType, ImageWritingDirection>, std::unique_ptr<ImageList>> m_pImageList;
37
    OUString m_sIconTheme;
38
39
    ImageList* getImageList(ImageType nImageType, ImageWritingDirection nImageDir);
40
41
public:
42
    CommandImageResolver();
43
    ~CommandImageResolver();
44
45
    void registerCommands(const css::uno::Sequence<OUString>& aCommandSequence);
46
    Image getImageFromCommandURL(ImageType nImageType, ImageWritingDirection nImageDir,
47
                                 const OUString& rCommandURL);
48
49
0
    std::vector<OUString>& getCommandNames() { return m_aImageCommandNameVector; }
50
51
    bool hasImage(const OUString& rCommandURL);
52
};
53
54
} // end namespace vcl
55
56
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */