Add XCUI expansion state and coverage tests
This commit is contained in:
30
engine/include/XCEngine/UI/Widgets/UIExpansionModel.h
Normal file
30
engine/include/XCEngine/UI/Widgets/UIExpansionModel.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <unordered_set>
|
||||
|
||||
namespace XCEngine {
|
||||
namespace UI {
|
||||
namespace Widgets {
|
||||
|
||||
class UIExpansionModel {
|
||||
public:
|
||||
bool HasExpandedItems() const;
|
||||
std::size_t GetExpandedCount() const;
|
||||
bool IsExpanded(std::string_view id) const;
|
||||
|
||||
bool SetExpanded(std::string itemId, bool expanded);
|
||||
bool Expand(std::string itemId);
|
||||
bool Collapse(std::string itemId);
|
||||
bool ToggleExpanded(std::string itemId);
|
||||
bool Clear();
|
||||
|
||||
private:
|
||||
std::unordered_set<std::string> m_expandedIds = {};
|
||||
};
|
||||
|
||||
} // namespace Widgets
|
||||
} // namespace UI
|
||||
} // namespace XCEngine
|
||||
Reference in New Issue
Block a user