Class Item

Inheritance Relationships

Derived Types

Class Documentation

class Item

Subclassed by portal::content_browser::DirectoryItem, portal::content_browser::ResourceItem

Public Types

enum class Type : uint8_t

Values:

enumerator Directory
enumerator Resource

Public Functions

Item(Type type, const StringId &resource_id, const std::string &name, const EditorIcon &icon)
virtual ~Item() = default
void on_render_begin() const
Action on_render(Entity selection_context, ItemList &item_list, EditorContext &editor_context)
void on_render_end() const
inline virtual void del()
inline virtual bool move(std::filesystem::path &destination)
inline StringId get_resource_id() const
inline Type get_type() const
inline const std::string &get_display_name() const
inline EditorIcon get_icon() const
void start_renaming()
void stop_renaming()
inline bool is_renaming() const
void rename(const std::string &new_name)
void set_display_name_from_file_name()

Protected Functions

inline virtual void on_renamed(const std::string &new_name)
inline virtual void render_custom_context_items()
inline virtual void update_drop(ItemList&, Action&)
void on_context_menu_open(Entity selection_context, Action &result)

Protected Attributes

Type type = {}
StringId resource_id
std::string display_name
std::string file_name
EditorIcon icon
bool renaming = false
bool dragging = false
bool just_selected = false