Coverage Report

Created: 2025-11-16 09:57

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