XDGKit v1.0.0-1
C++ XDG Utilities
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
XDGIcon Class Reference

Properties of an icon. More...

#include <XDGIcon.h>

Public Types

enum  Extension : uint32_t
 Enumeration of supported file extensions for icons. More...
 

Public Member Functions

XDGKitkit () const noexcept
 Handle to the parent kit.
 
uint32_t extensions () const noexcept
 Retrieves the bitset of file extensions found for this icon.
 
const std::string_view & name () const noexcept
 Retrieves the name of the icon.
 
std::filesystem::path getPath (Extension ext) const noexcept
 Retrieves the absolute path of the icon for a specified file extension.
 
XDGIconDirectorydirectory () const noexcept
 Retrieves the directory to which this icon belongs.
 
bool usingCache () const noexcept
 Indicates whether the parent theme was loaded from cache.
 

Detailed Description

Properties of an icon.

This class provides information about an icon, including its name, file extensions, paths, and the directory to which it belongs.

Note
Most of the icon properties can be found in its respective directory()

Member Enumeration Documentation

◆ Extension

enum Extension : uint32_t

Enumeration of supported file extensions for icons.

Enumerator
PNG 

PNG file format.

SVG 

SVG file format.

XPM 

XPM file format.

Member Function Documentation

◆ kit()

XDGKit & kit ( ) const
noexcept

Handle to the parent kit.

◆ extensions()

uint32_t extensions ( ) const
inlinenoexcept

Retrieves the bitset of file extensions found for this icon.

Each bit in the bitset corresponds to a supported file extension.

Returns
A bitset of file extensions (e.g., PNG, SVG, XPM).

◆ name()

const std::string_view & name ( ) const
inlinenoexcept

Retrieves the name of the icon.

Returns
A constant reference to the icon's name.

◆ getPath()

std::filesystem::path getPath ( Extension  ext) const
noexcept

Retrieves the absolute path of the icon for a specified file extension.

The provided extension must exist in the set of extensions returned by extensions().

Parameters
extThe file extension for which to retrieve the icon's path.
Returns
The absolute path of the icon file with the specified extension.

◆ directory()

XDGIconDirectory & directory ( ) const
inlinenoexcept

Retrieves the directory to which this icon belongs.

The directory contains information such as size, scale, and context of the icon.

Returns
A reference to the XDGIconDirectory object representing the directory.

◆ usingCache()

bool usingCache ( ) const
noexcept

Indicates whether the parent theme was loaded from cache.