#ifndef MICROBEAMMANIPULATION_HPP_INCLUDED
#define MICROBEAMMANIPULATION_HPP_INCLUDED

#include <iostream>
#include <memory>
#include <optional>
#include <set>
#include <string>
#include <vector>
#include <NBO/NBO/ExperimenterRef.h>
#include <NBO/NBO/LightSourceSettings.h>
#include <NBO/NBO/MicrobeamManipulationID_Type.h>
#include <NBO/NBO/MicrobeamManipulationType_Type.h>
#include <NBO/NBO/ROIRef.h>
#include <NBO/NBO/Reference_Type.h>
#include <NBO/NBO/ENBOType.h>
#include <NBO/NBOGlobal.h>
#include <NBO/Shared/Base/NBOBaseClass.h>


namespace Inscoper::NBO {

/*!
* \brief Represents the XML element MicrobeamManipulation.
*
* Defines a microbeam operation and the region of the image it was applied to. The LightSourceSettingsRef element is a reference to the LightSourceSettings that were used in this case, including a reference to the light source that was used for this micromanipulation experiment (e.g....................... a laser used for photobleaching).
*/
class NBO_EXPORT MicrobeamManipulation : public NBOBaseClass {

public:
	/*!
	* \brief Represents the XML element Description.
	*
	* No description available in the XSD standard.
	*/
	class NBO_EXPORT InlineDescription : public NBOBaseClass {
	
	public:
		
		InlineDescription();
		~InlineDescription();
	
		/*!
		* \brief Cast a NBOBaseClass to a InlineDescription.
		*
		* \param base The base class to cast
		* \return The casted element, or nullptr if the cast fails
		*/
		static std::shared_ptr<InlineDescription> fromBase(NBOBaseClassPtr base);
	
		/*!
		* \brief Returns the class type name.
		*
		* \return The class type name
		*/
		std::string getTypeName() const override;
	
		/*!
		* \brief Returns the XML element name corresponding to this class.
		*
		* \return The XML element name
		*/
		std::string getXMLName() const override;
	
		/*!
		* \brief Returns the NBO Type corresponding to this class.
		*
		* \return The NBO Type value
		*/
		ENBOType getNBOType() const override;
	
		/*!
		* \brief Returns a list of all classes derived from this class.
		*
		* \return The list of derived classes
		*/
		std::vector<NBOBaseClassPtr> getChildren() const override;
	
		/*!
		* \brief Returns a list of all child elements contained in this class.
		*
		* \return The list of child classes
		*/
		std::vector<NBOBaseClassPtr> getSubElements() const override;
	
		/*!
		* \brief Populates this object from a JSON file.
		*
		* \param path The path to the JSON file
		* \param validate If true, validates constraints on value. Default is true.
		*/
		void fromJsonFile(const std::string& path, bool validate = true);
	
		/*!
		* \brief Populates this object from a JSON string.
		*
		* \param json_string The JSON content as a string
		* \param validate If true, validates constraints on value. Default is true.
		*/
		void fromJsonString(const std::string& json_string, bool validate = true);
	
		/*!
		* \brief Populates this object from a XML file.
		*
		* \param path The path to the XML file
		* \param validate If true, validates constraints on value. Default is true.
		*/
		void fromXmlFile(const std::string& path, bool validate = true);
	
		/*!
		* \brief Populates this object from a XML string.
		*
		* \param xml_string The XML content as a string
		* \param validate If true, validates constraints on value. Default is true.
		*/
		void fromXmlString(const std::string& xml_string, bool validate = true);
	
		/*!
		* \brief Serializes this object to an XML file.
		*
		* \param filename The path to the output XML file
		* \param validate If true, validates constraints on value. Default is true.
		*/
		void toXmlFile(const std::string& filename, bool validate = true) const;
	
		/*!
		* \brief Serializes this object to an XML string.
		*
		* \param validate If true, validates constraints on value. Default is true.
		* \return A string containing the XML representation of this object
		*/
		std::string toXmlString(bool validate = true) const;
	
		/*!
		* \brief Assigns a new value to this object (= operator operator).
		*
		* \param v The value to set
		*/
		InlineDescription& operator=(const std::string& v);
	
		/*!
		* \brief Returns the value of this object  (generic conversion operator overload).
		*
		* \return The value of the object
		*/
		operator std::string() const;
	
		/*!
		* \brief Assigns a new value to this object.
		*
		* \param v The value to set
		* \param validate If true, validates constraints on value. Default is true.
		*/
		void set(const std::string& v, bool validate = true);
	
		/*!
		* \brief Returns the value of this object.
		*
		* \return The value of the object
		*/
		std::string get() const;
	
		/*!
		* \brief Returns the allowed values for this object.
		*
		* \return The list of allowed values
		*/
		static const std::set<std::string>& getAllowedValues();
	
		/*!
		* \brief Returns the pattern for this object.
		*
		* \return The pattern
		*/
		static const std::string& getPattern();
	
	private:
		std::string value;
	
		static const std::set<std::string> allowedValues;
		static const std::string validationPattern;
		friend std::ostream& operator<<(std::ostream& os, const InlineDescription& u);
	
	
	private:
		class Impl;
		std::unique_ptr<Impl> pImpl;
	};
	
	/*! Shared pointer for InlineDescription*/
	typedef std::shared_ptr<InlineDescription> InlineDescriptionPtr;
	
	/*!
	* \brief Represents the XML element AnnotationRef.
	*
	* This is a simple multi-line comment or annotation describing this component.
	*/
	class NBO_EXPORT InlineAnnotationRef : public Reference_Type {
	
	public:
		
		InlineAnnotationRef();
		~InlineAnnotationRef();
	
		/*!
		* \brief Cast a NBOBaseClass to a InlineAnnotationRef.
		*
		* \param base The base class to cast
		* \return The casted element, or nullptr if the cast fails
		*/
		static std::shared_ptr<InlineAnnotationRef> fromBase(NBOBaseClassPtr base);
	
		/*!
		* \brief Returns the class type name.
		*
		* \return The class type name
		*/
		std::string getTypeName() const override;
	
		/*!
		* \brief Returns the XML element name corresponding to this class.
		*
		* \return The XML element name
		*/
		std::string getXMLName() const override;
	
		/*!
		* \brief Returns the NBO Type corresponding to this class.
		*
		* \return The NBO Type value
		*/
		ENBOType getNBOType() const override;
	
		/*!
		* \brief Returns a list of all classes derived from this class.
		*
		* \return The list of derived classes
		*/
		std::vector<NBOBaseClassPtr> getChildren() const override;
	
		/*!
		* \brief Returns a list of all child elements contained in this class.
		*
		* \return The list of child classes
		*/
		std::vector<NBOBaseClassPtr> getSubElements() const override;
	
		/*!
		* \brief Populates this object from a JSON file.
		*
		* \param path The path to the JSON file
		* \param validate If true, validates constraints on value. Default is true.
		*/
		void fromJsonFile(const std::string& path, bool validate = true);
	
		/*!
		* \brief Populates this object from a JSON string.
		*
		* \param json_string The JSON content as a string
		* \param validate If true, validates constraints on value. Default is true.
		*/
		void fromJsonString(const std::string& json_string, bool validate = true);
	
		/*!
		* \brief Populates this object from a XML file.
		*
		* \param path The path to the XML file
		* \param validate If true, validates constraints on value. Default is true.
		*/
		void fromXmlFile(const std::string& path, bool validate = true);
	
		/*!
		* \brief Populates this object from a XML string.
		*
		* \param xml_string The XML content as a string
		* \param validate If true, validates constraints on value. Default is true.
		*/
		void fromXmlString(const std::string& xml_string, bool validate = true);
	
		/*!
		* \brief Serializes this object to an XML file.
		*
		* \param filename The path to the output XML file
		* \param validate If true, validates constraints on value. Default is true.
		*/
		void toXmlFile(const std::string& filename, bool validate = true) const;
	
		/*!
		* \brief Serializes this object to an XML string.
		*
		* \param validate If true, validates constraints on value. Default is true.
		* \return A string containing the XML representation of this object
		*/
		std::string toXmlString(bool validate = true) const;
	
	
	private:
		class Impl;
		std::unique_ptr<Impl> pImpl;
	
	};
	
	/*! Shared pointer for InlineAnnotationRef*/
	typedef std::shared_ptr<InlineAnnotationRef> InlineAnnotationRefPtr;
	
	
	MicrobeamManipulation();
	~MicrobeamManipulation();

	/*!
	* \brief Cast a NBOBaseClass to a MicrobeamManipulation.
	*
	* \param base The base class to cast
	* \return The casted element, or nullptr if the cast fails
	*/
	static std::shared_ptr<MicrobeamManipulation> fromBase(NBOBaseClassPtr base);

	/*!
	* \brief Returns the class type name.
	*
	* \return The class type name
	*/
	std::string getTypeName() const override;

	/*!
	* \brief Returns the XML element name corresponding to this class.
	*
	* \return The XML element name
	*/
	std::string getXMLName() const override;

	/*!
	* \brief Returns the NBO Type corresponding to this class.
	*
	* \return The NBO Type value
	*/
	ENBOType getNBOType() const override;

	/*!
	* \brief Returns a list of all classes derived from this class.
	*
	* \return The list of derived classes
	*/
	std::vector<NBOBaseClassPtr> getChildren() const override;

	/*!
	* \brief Returns a list of all child elements contained in this class.
	*
	* \return The list of child classes
	*/
	std::vector<NBOBaseClassPtr> getSubElements() const override;

	/*!
	* \brief Populates this object from a JSON file.
	*
	* \param path The path to the JSON file
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void fromJsonFile(const std::string& path, bool validate = true);

	/*!
	* \brief Populates this object from a JSON string.
	*
	* \param json_string The JSON content as a string
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void fromJsonString(const std::string& json_string, bool validate = true);

	/*!
	* \brief Populates this object from a XML file.
	*
	* \param path The path to the XML file
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void fromXmlFile(const std::string& path, bool validate = true);

	/*!
	* \brief Populates this object from a XML string.
	*
	* \param xml_string The XML content as a string
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void fromXmlString(const std::string& xml_string, bool validate = true);

	/*!
	* \brief Serializes this object to an XML file.
	*
	* \param filename The path to the output XML file
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void toXmlFile(const std::string& filename, bool validate = true) const;

	/*!
	* \brief Serializes this object to an XML string.
	*
	* \param validate If true, validates constraints on value. Default is true.
	* \return A string containing the XML representation of this object
	*/
	std::string toXmlString(bool validate = true) const;

	/*!
	* \brief Sets the value of the ID attribute.
	*
	* A Unique Identifier for this MicrobeamManipulation hardware component.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setID(const Inscoper::NBO::MicrobeamManipulationID_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the ID attribute.
	*
	* A Unique Identifier for this MicrobeamManipulation hardware component.
	*
	* \return The value of the attribute
	*/
	MicrobeamManipulationID_TypePtr getID() const;

	/*!
	* \brief Resets the ID attribute to an unset state.
	*
	* A Unique Identifier for this MicrobeamManipulation hardware component.
	*/
	void resetID();

	/*!
	* \brief Checks whether the optional ID attribute is present.
	*
	* A Unique Identifier for this MicrobeamManipulation hardware component.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasID() const;

	/*!
	* \brief Sets the value of the Type attribute.
	*
	* This field defines the type of micromanipulation performed.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setType(const Inscoper::NBO::MicrobeamManipulationType_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the Type attribute.
	*
	* This field defines the type of micromanipulation performed.
	*
	* \return The value of the attribute
	*/
	MicrobeamManipulationType_TypePtr getType() const;

	/*!
	* \brief Resets the Type attribute to an unset state.
	*
	* This field defines the type of micromanipulation performed.
	*/
	void resetType();

	/*!
	* \brief Checks whether the optional Type attribute is present.
	*
	* This field defines the type of micromanipulation performed.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasType() const;

	/*!
	* \brief Sets the list of ExperimenterRef elements.
	*
	* No description available in the XSD standard.
	*
	* \param value The new list of ExperimenterRef elements
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setExperimenterRef_List(const std::vector<Inscoper::NBO::ExperimenterRefPtr>& value, bool validate = true);

	/*!
	* \brief Returns the list of ExperimenterRef elements.
	*
	* No description available in the XSD standard.
	*
	* \return The list of ExperimenterRef elements
	*/
	std::vector<Inscoper::NBO::ExperimenterRefPtr> getExperimenterRef_List() const;

	/*!
	* \brief Adds a new ExperimenterRef element to this object.
	*
	* No description available in the XSD standard.
	*
	* \param value The element to add
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void addToExperimenterRef_List(const Inscoper::NBO::ExperimenterRefPtr& value, bool validate = true);

	/*!
	* \brief Clear the list of ExperimenterRef.
	*
	* No description available in the XSD standard.
	*/
	void clearExperimenterRef_List();

	/*!
	* \brief Sets the list of ROIRef elements.
	*
	* This empty element refers to the predefined four dimensional ROI (Region of Interest) that was used for this micromanipulation experiment.
	*
	* \param value The new list of ROIRef elements
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setROIRef_List(const std::vector<Inscoper::NBO::ROIRefPtr>& value, bool validate = true);

	/*!
	* \brief Returns the list of ROIRef elements.
	*
	* This empty element refers to the predefined four dimensional ROI (Region of Interest) that was used for this micromanipulation experiment.
	*
	* \return The list of ROIRef elements
	*/
	std::vector<Inscoper::NBO::ROIRefPtr> getROIRef_List() const;

	/*!
	* \brief Adds a new ROIRef element to this object.
	*
	* This empty element refers to the predefined four dimensional ROI (Region of Interest) that was used for this micromanipulation experiment.
	*
	* \param value The element to add
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void addToROIRef_List(const Inscoper::NBO::ROIRefPtr& value, bool validate = true);

	/*!
	* \brief Clear the list of ROIRef.
	*
	* This empty element refers to the predefined four dimensional ROI (Region of Interest) that was used for this micromanipulation experiment.
	*/
	void clearROIRef_List();

	/*!
	* \brief Sets the list of LightSourceSettings elements.
	*
	* This holds a reference to the LightSource (i.e. the ID attribute) that was used in this case as well as the setting that were applied to in in this case.
	*
	* \param value The new list of LightSourceSettings elements
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setLightSourceSettings_List(const std::vector<Inscoper::NBO::LightSourceSettingsPtr>& value, bool validate = true);

	/*!
	* \brief Returns the list of LightSourceSettings elements.
	*
	* This holds a reference to the LightSource (i.e. the ID attribute) that was used in this case as well as the setting that were applied to in in this case.
	*
	* \return The list of LightSourceSettings elements
	*/
	std::vector<Inscoper::NBO::LightSourceSettingsPtr> getLightSourceSettings_List() const;

	/*!
	* \brief Adds a new LightSourceSettings element to this object.
	*
	* This holds a reference to the LightSource (i.e. the ID attribute) that was used in this case as well as the setting that were applied to in in this case.
	*
	* \param value The element to add
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void addToLightSourceSettings_List(const Inscoper::NBO::LightSourceSettingsPtr& value, bool validate = true);

	/*!
	* \brief Clear the list of LightSourceSettings.
	*
	* This holds a reference to the LightSource (i.e. the ID attribute) that was used in this case as well as the setting that were applied to in in this case.
	*/
	void clearLightSourceSettings_List();

	/*!
	* \brief Sets the value of the Description element.
	*
	* A description for the Microbeam Manipulation. [plain-text multi-line string] 
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setDescription(const Inscoper::NBO::MicrobeamManipulation::InlineDescriptionPtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the Description element.
	*
	* A description for the Microbeam Manipulation. [plain-text multi-line string] 
	*
	* \return The value of the element
	*/
	Inscoper::NBO::MicrobeamManipulation::InlineDescriptionPtr getDescription() const;

	/*!
	* \brief Resets the Description element to an unset state.
	*
	* A description for the Microbeam Manipulation. [plain-text multi-line string] 
	*/
	void resetDescription();

	/*!
	* \brief Checks whether the optional Description element is present.
	*
	* A description for the Microbeam Manipulation. [plain-text multi-line string] 
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasDescription() const;

	/*!
	* \brief Sets the list of AnnotationRef elements.
	*
	* This is a simple multi-line comment or annotation describing this component.
	*
	* \param value The new list of AnnotationRef elements
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setAnnotationRef_List(const std::vector<Inscoper::NBO::MicrobeamManipulation::InlineAnnotationRefPtr>& value, bool validate = true);

	/*!
	* \brief Returns the list of AnnotationRef elements.
	*
	* This is a simple multi-line comment or annotation describing this component.
	*
	* \return The list of AnnotationRef elements
	*/
	std::vector<Inscoper::NBO::MicrobeamManipulation::InlineAnnotationRefPtr> getAnnotationRef_List() const;

	/*!
	* \brief Adds a new AnnotationRef element to this object.
	*
	* This is a simple multi-line comment or annotation describing this component.
	*
	* \param value The element to add
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void addToAnnotationRef_List(const Inscoper::NBO::MicrobeamManipulation::InlineAnnotationRefPtr& value, bool validate = true);

	/*!
	* \brief Clear the list of AnnotationRef.
	*
	* This is a simple multi-line comment or annotation describing this component.
	*/
	void clearAnnotationRef_List();


private:
	class Impl;
	std::unique_ptr<Impl> pImpl;

	MicrobeamManipulationID_TypePtr ID = nullptr; // Required attribute
	MicrobeamManipulationType_TypePtr Type = nullptr; // Required attribute
    std::vector<Inscoper::NBO::ExperimenterRefPtr> ExperimenterRef_List;
    std::vector<Inscoper::NBO::ROIRefPtr> ROIRef_List;
    std::vector<Inscoper::NBO::LightSourceSettingsPtr> LightSourceSettings_List;
    Inscoper::NBO::MicrobeamManipulation::InlineDescriptionPtr Description = nullptr;
    std::vector<Inscoper::NBO::MicrobeamManipulation::InlineAnnotationRefPtr> AnnotationRef_List;
};

/*! Shared pointer for MicrobeamManipulation*/
typedef std::shared_ptr<MicrobeamManipulation> MicrobeamManipulationPtr;

} // namespace Inscoper::NBO

#endif // MICROBEAMMANIPULATION_HPP_INCLUDED