/** * wWidgets - Lightweight UI Toolkit. * Copyright (C) 2009-2011 Evgeny Andreeshchev * Alexander Kotliar * * This code is distributed under the MIT License: * http://www.opensource.org/licenses/MIT */ #ifndef CRYINCLUDE_EDITORCOMMON_QPROPERTYTREE_PROPERTYTREEOPERATOR_H #define CRYINCLUDE_EDITORCOMMON_QPROPERTYTREE_PROPERTYTREEOPERATOR_H #pragma once #include #include "Serialization/Pointers.h" namespace Serialization{ class IArchive; } class PropertyRow; struct TreePathLeaf { int index; TreePathLeaf(int _index = -1) : index(_index) { } bool operator==(const TreePathLeaf& rhs) const{ return index == rhs.index; } bool operator!=(const TreePathLeaf& rhs) const{ return index != rhs.index; } }; bool Serialize(Serialization::IArchive& ar, TreePathLeaf& value, const char* name, const char* label); typedef std::vector TreePath; typedef std::vector TreePathes; class PropertyTreeOperator { public: enum Type{ NONE, REPLACE, ADD, REMOVE }; PropertyTreeOperator(); ~PropertyTreeOperator(); PropertyTreeOperator(const TreePath& path, PropertyRow* row); void Serialize(Serialization::IArchive& ar); private: Type type_; TreePath path_; Serialization::SharedPtr row_; int index_; friend class PropertyTreeModel; }; #endif // CRYINCLUDE_EDITORCOMMON_QPROPERTYTREE_PROPERTYTREEOPERATOR_H