Extract XCUI selection model and layout lab click selection
This commit is contained in:
26
engine/include/XCEngine/UI/Widgets/UISelectionModel.h
Normal file
26
engine/include/XCEngine/UI/Widgets/UISelectionModel.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
namespace XCEngine {
|
||||
namespace UI {
|
||||
namespace Widgets {
|
||||
|
||||
class UISelectionModel {
|
||||
public:
|
||||
bool HasSelection() const;
|
||||
const std::string& GetSelectedId() const;
|
||||
bool IsSelected(std::string_view id) const;
|
||||
|
||||
bool SetSelection(std::string selectionId);
|
||||
bool ClearSelection();
|
||||
bool ToggleSelection(std::string selectionId);
|
||||
|
||||
private:
|
||||
std::string m_selectedId = {};
|
||||
};
|
||||
|
||||
} // namespace Widgets
|
||||
} // namespace UI
|
||||
} // namespace XCEngine
|
||||
Reference in New Issue
Block a user