API Documentation
Public Member Functions | List of all members
nkWinUi::CursorManager Class Referencefinal

Manages the recorded cursors living in the component. More...

Inheritance diagram for nkWinUi::CursorManager:

Public Member Functions

SystemgetSystem () const
 
CursorcreateOrRetrieve (nkMemory::StringView name)
 
Cursorrecord (nkMemory::StringView name, nkMemory::UniquePtr< Cursor > resource)
 
Cursorget (nkMemory::StringView name) const
 
CursorgetByIndex (unsigned int index) const
 
void rename (nkMemory::StringView currentName, nkMemory::StringView newName)
 
void erase (nkMemory::StringView name)
 
nkMemory::UniquePtr< Cursorrelinquish (nkMemory::StringView name)
 
void setActiveCursor (Cursor *cursor)
 

Detailed Description

Manages the recorded cursors living in the component.

Member Function Documentation

◆ getSystem()

System* nkWinUi::CursorManager::getSystem ( ) const
Returns
The system the manager is living in.

◆ createOrRetrieve()

Cursor* nkWinUi::CursorManager::createOrRetrieve ( nkMemory::StringView  name)

Creates (if unavailable) or retrieves (if available) a resource attached to passed name.

Parameters
nameThe name, aka identifier, of the resource to create or retrieve.
Returns
The resource attached to passed name. The Manager is the owner of the memory returned.

◆ record()

Cursor* nkWinUi::CursorManager::record ( nkMemory::StringView  name,
nkMemory::UniquePtr< Cursor resource 
)

Records an already existing resource in the manager, passing its ownership around.

Parameters
nameThe name under which the resource should be recorded.
resourceThe resource to record.
Returns
A raw pointer over the resource, now recorded in the manager.

◆ get()

Cursor* nkWinUi::CursorManager::get ( nkMemory::StringView  name) const

Returns a resource attached to a name, if available.

Parameters
nameThe name of the resource that should be retrieved.
Returns
The resource if existing, nullptr else.

◆ getByIndex()

Cursor* nkWinUi::CursorManager::getByIndex ( unsigned int  index) const

Returns the resource at given index, if available.

Parameters
indexThe index of the resource to retrieve.
Returns
The resource attached to given index.
Remarks
An index refers to the index in the manager's container, so one index can be attached through different resources depending on allocations. This method is meant to loop on all resources in one go, because of this.

◆ rename()

void nkWinUi::CursorManager::rename ( nkMemory::StringView  currentName,
nkMemory::StringView  newName 
)

Renames a resource.

Parameters
currentNameThe name of the resource to rename.
newNameThe name to reassign to the resource.

◆ erase()

void nkWinUi::CursorManager::erase ( nkMemory::StringView  name)

Erases a resource. Memory attached to it will be freed.

Parameters
nameThe name identifying the resource to erase.

◆ relinquish()

nkMemory::UniquePtr<Cursor> nkWinUi::CursorManager::relinquish ( nkMemory::StringView  name)

Requests the manager to relinquish the ownership of a resource and pass it around.

Parameters
nameThe name of the recorded resource to relinquish.
Returns
The ownership over the resource requested if available, nullptr otherwise.

◆ setActiveCursor()

void nkWinUi::CursorManager::setActiveCursor ( Cursor cursor)

Sets the active cursor.

Parameters
cursorThe cursor to activate and use.

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