LibreOffice Module sd (master) 1
IconCache.hxx
Go to the documentation of this file.
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 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include <memory>
24#include <vcl/image.hxx>
25
26namespace sd
27{
37class IconCache final : public SdGlobalResource
38{
39public:
43 static IconCache& Instance();
44
51 Image GetIcon(const OUString& rResourceId);
52
53private:
54 class Implementation;
55 ::std::unique_ptr<Implementation> mpImpl;
56
61 IconCache();
62
65 virtual ~IconCache() override;
66};
67
68} // end of namespace sd
69
70/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This simple class stores frequently used icons so that the classes that use the icons do not have to ...
Definition: IconCache.hxx:38
Image GetIcon(const OUString &rResourceId)
Return the icon with the given resource id.
Definition: IconCache.cxx:92
static IconCache & Instance()
The lifetime of the returned reference is limited to that of the sd module.
Definition: IconCache.cxx:68
virtual ~IconCache() override
This destructor is called by SdGlobalResourceContainer.
Definition: IconCache.cxx:99
IconCache()
The constructor creates the one instance of the cache and registers it at the SdGlobalResourceContain...
Definition: IconCache.cxx:94
::std::unique_ptr< Implementation > mpImpl
Definition: IconCache.hxx:54