1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
12 #include <vcl/image.hxx>
13 #include <o3tl/enumarray.hxx>
15 #include <com/sun/star/uno/Sequence.hxx>
17 #include "ImageList.hxx"
20 #include <unordered_map>
25 class CommandImageResolver final
28 typedef std::unordered_map
<OUString
, OUString
> CommandToImageNameMap
;
30 CommandToImageNameMap m_aCommandToImageNameMap
;
31 std::vector
<OUString
> m_aImageCommandNameVector
;
32 std::vector
<OUString
> m_aImageNameVector
;
34 o3tl::enumarray
<ImageType
, std::unique_ptr
<ImageList
>> m_pImageList
;
35 OUString m_sIconTheme
;
37 ImageList
* getImageList(ImageType nImageType
);
40 CommandImageResolver();
41 ~CommandImageResolver();
43 void registerCommands(const css::uno::Sequence
<OUString
>& aCommandSequence
);
44 Image
getImageFromCommandURL(ImageType nImageType
, const OUString
& rCommandURL
);
46 std::vector
<OUString
>& getCommandNames() { return m_aImageCommandNameVector
; }
48 bool hasImage(const OUString
& rCommandURL
);
51 } // end namespace vcl
53 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */