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/.
10 #ifndef INCLUDED_VCL_COMMANDICONRESOLVER_HXX
11 #define INCLUDED_VCL_COMMANDICONRESOLVER_HXX
13 #include <vcl/image.hxx>
14 #include <o3tl/enumarray.hxx>
16 #include <com/sun/star/uno/Sequence.hxx>
18 #include "ImageList.hxx"
21 #include <unordered_map>
27 class CommandImageResolver final
30 typedef std::unordered_map
<OUString
, OUString
> CommandToImageNameMap
;
32 CommandToImageNameMap m_aCommandToImageNameMap
;
33 std::vector
<OUString
> m_aImageCommandNameVector
;
34 std::vector
<OUString
> m_aImageNameVector
;
36 o3tl::enumarray
<ImageType
, std::unique_ptr
<ImageList
>> m_pImageList
;
37 OUString m_sIconTheme
;
39 ImageList
* getImageList(ImageType nImageType
);
42 CommandImageResolver();
43 ~CommandImageResolver();
45 void registerCommands(css::uno::Sequence
<OUString
>& aCommandSequence
);
46 Image
getImageFromCommandURL(ImageType nImageType
, const OUString
& rCommandURL
);
48 std::vector
<OUString
>& getCommandNames()
50 return m_aImageCommandNameVector
;
53 bool hasImage(const OUString
& rCommandURL
);
56 } // end namespace vcl
58 #endif // INCLUDED_VCL_COMMANDICONRESOLVER_HXX
60 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */