GUIFramework 1.1.0
Framework for desktop GUI applications in C++.
Loading...
Searching...
No Matches
gui_framework::utility::BaseLoadableHolder Class Referenceabstract

Base class for all visual asset loaders. More...

#include <BaseLoadableHolder.h>

Inheritance diagram for gui_framework::utility::BaseLoadableHolder:
gui_framework::interfaces::IIterable< std::filesystem::path, iterators::loadable_forward_iterator, iterators::loadable_const_forward_iterator > gui_framework::interfaces::ISerializable gui_framework::utility::CursorsHolder gui_framework::utility::IconsHolder gui_framework::utility::ImagesHolder

Classes

struct  imageData
 

Public Types

enum class  imageType : uint32_t { bitmap , icon , cursor }
 

Public Member Functions

 BaseLoadableHolder (uint16_t imagesWidth, uint16_t imagesHeight, size_t count=standard_sizes::defaultImagesCount)
 
virtual uint16_t addImage (const std::filesystem::path &pathToImage)=0
 
virtual void removeImage (const std::filesystem::path &pathToImage) final
 
virtual void removeImage (uint16_t imageIndex) final
 
virtual bool contains (const std::filesystem::path &pathToImage) const final
 
virtual uint16_t getImagesWidth () const final
 
virtual uint16_t getImagesHeight () const final
 
virtual uint16_t getImageIndex (const std::filesystem::path &pathToImage) const final
 
virtual imageType getImageType (const std::filesystem::path &pathToImage) const final
 
virtual imageType getImageType (uint16_t imageIndex) const final
 
virtual HIMAGELIST getImageList () const final
 
virtual uint16_t operator[] (const std::filesystem::path &pathToImage) const final
 
virtual std::filesystem::path operator[] (uint16_t index) const final
 
virtual iterators::loadable_forward_iterator begin () noexcept final override
 Can't be modified.
 
virtual iterators::loadable_const_forward_iterator cbegin () const noexcept final override
 
virtual iterators::loadable_forward_iterator end () noexcept final override
 
virtual iterators::loadable_const_forward_iterator cend () const noexcept final override
 
virtual std::pair< std::string, json::utility::jsonObject::variantType > & loadBaseLoadableHolderStructure (json::utility::jsonObject &current) const final
 
virtual ~BaseLoadableHolder ()
 
- Public Member Functions inherited from gui_framework::interfaces::IIterable< std::filesystem::path, iterators::loadable_forward_iterator, iterators::loadable_const_forward_iterator >
 IIterable ()=default
 
virtual ~IIterable ()=default
 
- Public Member Functions inherited from gui_framework::interfaces::ISerializable
 ISerializable ()=default
 
virtual ~ISerializable ()=default
 

Protected Member Functions

virtual uint16_t insertImage (const std::filesystem::path &pathToImage, imageType type) final
 

Protected Attributes

HIMAGELIST imageList
 
std::unordered_map< std::wstring, imageDataimages
 
uint16_t imagesWidth
 
uint16_t imagesHeight
 

Additional Inherited Members

- Static Public Member Functions inherited from gui_framework::interfaces::ISerializable
static uint32_t getCodepage ()
 

Detailed Description

Base class for all visual asset loaders.

Definition at line 19 of file BaseLoadableHolder.h.

Member Enumeration Documentation

◆ imageType

Enumerator
bitmap 
icon 
cursor 

Definition at line 24 of file BaseLoadableHolder.h.

Constructor & Destructor Documentation

◆ BaseLoadableHolder()

gui_framework::utility::BaseLoadableHolder::BaseLoadableHolder ( uint16_t imagesWidth,
uint16_t imagesHeight,
size_t count = standard_sizes::defaultImagesCount )

Definition at line 141 of file BaseLoadableHolder.cpp.

◆ ~BaseLoadableHolder()

gui_framework::utility::BaseLoadableHolder::~BaseLoadableHolder ( )
virtual

Definition at line 280 of file BaseLoadableHolder.cpp.

Member Function Documentation

◆ addImage()

virtual uint16_t gui_framework::utility::BaseLoadableHolder::addImage ( const std::filesystem::path & pathToImage)
pure virtual

◆ begin()

iterators::loadable_forward_iterator gui_framework::utility::BaseLoadableHolder::begin ( )
finaloverridevirtualnoexcept

◆ cbegin()

◆ cend()

◆ contains()

bool gui_framework::utility::BaseLoadableHolder::contains ( const std::filesystem::path & pathToImage) const
finalvirtual

Definition at line 176 of file BaseLoadableHolder.cpp.

◆ end()

◆ getImageIndex()

uint16_t gui_framework::utility::BaseLoadableHolder::getImageIndex ( const std::filesystem::path & pathToImage) const
finalvirtual
Parameters
pathToImage
Returns
Exceptions
std::out_of_range

Definition at line 191 of file BaseLoadableHolder.cpp.

◆ getImageList()

HIMAGELIST gui_framework::utility::BaseLoadableHolder::getImageList ( ) const
finalvirtual

Definition at line 214 of file BaseLoadableHolder.cpp.

◆ getImagesHeight()

uint16_t gui_framework::utility::BaseLoadableHolder::getImagesHeight ( ) const
finalvirtual

Definition at line 186 of file BaseLoadableHolder.cpp.

◆ getImagesWidth()

uint16_t gui_framework::utility::BaseLoadableHolder::getImagesWidth ( ) const
finalvirtual

Definition at line 181 of file BaseLoadableHolder.cpp.

◆ getImageType() [1/2]

virtual imageType gui_framework::utility::BaseLoadableHolder::getImageType ( const std::filesystem::path & pathToImage) const
finalvirtual

◆ getImageType() [2/2]

BaseLoadableHolder::imageType gui_framework::utility::BaseLoadableHolder::getImageType ( uint16_t imageIndex) const
finalvirtual
Parameters
imageIndex
Returns
Exceptions
std::out_of_range

Definition at line 201 of file BaseLoadableHolder.cpp.

◆ insertImage()

uint16_t gui_framework::utility::BaseLoadableHolder::insertImage ( const std::filesystem::path & pathToImage,
imageType type )
finalprotectedvirtual

Definition at line 110 of file BaseLoadableHolder.cpp.

◆ loadBaseLoadableHolderStructure()

pair< string, json::utility::jsonObject::variantType > & gui_framework::utility::BaseLoadableHolder::loadBaseLoadableHolderStructure ( json::utility::jsonObject & current) const
finalvirtual

Definition at line 275 of file BaseLoadableHolder.cpp.

◆ operator[]() [1/2]

virtual uint16_t gui_framework::utility::BaseLoadableHolder::operator[] ( const std::filesystem::path & pathToImage) const
finalvirtual
Parameters
pathToImage
Returns
Exceptions
std::out_of_range

◆ operator[]() [2/2]

filesystem::path gui_framework::utility::BaseLoadableHolder::operator[] ( uint16_t index) const
finalvirtual
Parameters
index
Returns
Exceptions
std::out_of_range

Definition at line 224 of file BaseLoadableHolder.cpp.

◆ removeImage() [1/2]

virtual void gui_framework::utility::BaseLoadableHolder::removeImage ( const std::filesystem::path & pathToImage)
finalvirtual

◆ removeImage() [2/2]

void gui_framework::utility::BaseLoadableHolder::removeImage ( uint16_t imageIndex)
finalvirtual

Definition at line 161 of file BaseLoadableHolder.cpp.

Member Data Documentation

◆ imageList

HIMAGELIST gui_framework::utility::BaseLoadableHolder::imageList
protected

Definition at line 55 of file BaseLoadableHolder.h.

◆ images

std::unordered_map<std::wstring, imageData> gui_framework::utility::BaseLoadableHolder::images
protected

Definition at line 56 of file BaseLoadableHolder.h.

◆ imagesHeight

uint16_t gui_framework::utility::BaseLoadableHolder::imagesHeight
protected

Definition at line 58 of file BaseLoadableHolder.h.

◆ imagesWidth

uint16_t gui_framework::utility::BaseLoadableHolder::imagesWidth
protected

Definition at line 57 of file BaseLoadableHolder.h.


The documentation for this class was generated from the following files: