TGUI
=
=
Download
Tutorials
1.x
0.9
0.8
Documentation
1.x
0.9
0.8
Examples
1.x
0.9
0.8
Community
TGUI
1.11
Loading...
Searching...
No Matches
include
TGUI
FileDialogIconLoader.hpp
1
2
//
3
// TGUI - Texus' Graphical User Interface
4
// Copyright (C) 2012-2025 Bruno Van de Velde (vdv_b@tgui.eu)
5
//
6
// This software is provided 'as-is', without any express or implied warranty.
7
// In no event will the authors be held liable for any damages arising from the use of this software.
8
//
9
// Permission is granted to anyone to use this software for any purpose,
10
// including commercial applications, and to alter it and redistribute it freely,
11
// subject to the following restrictions:
12
//
13
// 1. The origin of this software must not be misrepresented;
14
// you must not claim that you wrote the original software.
15
// If you use this software in a product, an acknowledgment
16
// in the product documentation would be appreciated but is not required.
17
//
18
// 2. Altered source versions must be plainly marked as such,
19
// and must not be misrepresented as being the original software.
20
//
21
// 3. This notice may not be removed or altered from any source distribution.
22
//
24
25
#ifndef TGUI_FILE_DIALOG_ICON_LOADER_HPP
26
#define TGUI_FILE_DIALOG_ICON_LOADER_HPP
27
28
#include <TGUI/Texture.hpp>
29
#include <TGUI/Filesystem.hpp>
30
31
#include <memory>
32
#include <vector>
33
35
36
namespace
tgui
37
{
42
class
TGUI_API
FileDialogIconLoader
43
{
44
public
:
45
49
virtual
~FileDialogIconLoader
() =
default
;
50
60
TGUI_NODISCARD
static
std::shared_ptr<FileDialogIconLoader>
createInstance
();
61
67
TGUI_NODISCARD
virtual
bool
update
();
68
74
TGUI_NODISCARD
virtual
bool
supportsSystemIcons
()
const
;
75
83
TGUI_NODISCARD
virtual
bool
hasGenericIcons
()
const
;
84
92
TGUI_NODISCARD
virtual
Texture
getGenericFileIcon
(
const
Filesystem::FileInfo
& file);
93
102
virtual
void
requestFileIcons
(
const
std::vector<Filesystem::FileInfo>& files);
103
109
TGUI_NODISCARD
virtual
std::vector<Texture>
retrieveFileIcons
();
110
112
protected
:
113
117
FileDialogIconLoader
() =
default
;
118
};
119
}
120
122
123
#endif
// TGUI_FILE_DIALOG_ICON_LOADER_HPP
tgui::FileDialogIconLoader::supportsSystemIcons
virtual bool supportsSystemIcons() const
Returns whether this icon loader does something or whether its functions are no-ops.
tgui::FileDialogIconLoader::retrieveFileIcons
virtual std::vector< Texture > retrieveFileIcons()
Access the file icons that where loaded in the thread that was started in requestFileIcons()
tgui::FileDialogIconLoader::hasGenericIcons
virtual bool hasGenericIcons() const
Returns whether generic icons (one folder and one file icon) are available.
tgui::FileDialogIconLoader::requestFileIcons
virtual void requestFileIcons(const std::vector< Filesystem::FileInfo > &files)
Starts a thread to load the icons for all given files.
tgui::FileDialogIconLoader::createInstance
static std::shared_ptr< FileDialogIconLoader > createInstance()
Returns the shared instance to the loader (and creates it if it didn't exist yet).
tgui::FileDialogIconLoader::~FileDialogIconLoader
virtual ~FileDialogIconLoader()=default
Default virtual destructor.
tgui::FileDialogIconLoader::FileDialogIconLoader
FileDialogIconLoader()=default
Protected constructor, the createInstance() function should be used to construct the icon loader.
tgui::FileDialogIconLoader::update
virtual bool update()
Called every frame to check if the background thread has finished.
tgui::FileDialogIconLoader::getGenericFileIcon
virtual Texture getGenericFileIcon(const Filesystem::FileInfo &file)
Returns the generic file/folder icon, which is used until the file-specific icons are finished loadin...
tgui::Texture
Texture wrapper that internally reuses resources when multiple Texture objects are loaded from the sa...
Definition
Texture.hpp:52
tgui
Namespace that contains all TGUI functions and classes.
Definition
AbsoluteOrRelativeValue.hpp:36
tgui::Filesystem::FileInfo
Information about a file or directory, used to return data from the listFilesInDirectory function.
Definition
Filesystem.hpp:245
Generated on
for TGUI by
1.14.0