1 // Copyright (C) 2002-2012 Nikolaus Gebhardt
\r
2 // This file is part of the "Irrlicht Engine".
\r
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
\r
5 #ifndef __I_ATTRIBUTE_EXCHANGING_OBJECT_H_INCLUDED__
\r
6 #define __I_ATTRIBUTE_EXCHANGING_OBJECT_H_INCLUDED__
\r
8 #include "IReferenceCounted.h"
\r
19 //! Enumeration flags passed through SAttributeReadWriteOptions to the IAttributeExchangingObject object
\r
20 enum E_ATTRIBUTE_READ_WRITE_FLAGS
\r
22 //! Serialization/Deserializion is done for an xml file
\r
23 EARWF_FOR_FILE = 0x00000001,
\r
25 //! Serialization/Deserializion is done for an editor property box
\r
26 EARWF_FOR_EDITOR = 0x00000002,
\r
28 //! When writing filenames, relative paths should be used
\r
29 EARWF_USE_RELATIVE_PATHS = 0x00000004
\r
33 //! struct holding data describing options
\r
34 struct SAttributeReadWriteOptions
\r
37 SAttributeReadWriteOptions()
\r
38 : Flags(0), Filename(0)
\r
42 //! Combination of E_ATTRIBUTE_READ_WRITE_FLAGS or other, custom ones
\r
45 //! Optional filename
\r
46 const fschar_t* Filename;
\r
50 //! An object which is able to serialize and deserialize its attributes into an attributes object
\r
51 class IAttributeExchangingObject : virtual public IReferenceCounted
\r
55 //! Writes attributes of the object.
\r
56 /** Implement this to expose the attributes of your scene node animator for
\r
57 scripting languages, editors, debuggers or xml serialization purposes. */
\r
58 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const {}
\r
60 //! Reads attributes of the object.
\r
61 /** Implement this to set the attributes of your scene node animator for
\r
62 scripting languages, editors, debuggers or xml deserialization purposes. */
\r
63 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) {}
\r
67 } // end namespace io
\r
68 } // end namespace irr
\r