Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / framework / source / uiconfiguration / CommandImageResolver.hxx
blobfe9a4ed958fec9f4c0423a83455f7a381706f13b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
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"
20 #include <memory>
21 #include <unordered_map>
22 #include <vector>
24 namespace vcl
27 class CommandImageResolver final
29 private:
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);
41 public:
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: */