/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// #ifndef _BCF_3_0_COMMENT_H #define _BCF_3_0_COMMENT_H #include "BcfCommon.h" #include "OdGUID.h" #include "BcfElement.h" /** \details Contains declarations related to working with BCF files content. */ namespace OdBcf { class OdBcfTimeStamp; /** \details A data type that represents a smart pointer to an OdBcfTimeStamp object. */ typedef OdSmartPtr OdBcfTimeStampPtr; class OdBcfValidationContext; } /** \details Contains declarations related to working with data of the BCF format version 3.0. */ namespace OdBcf_3_0 { class OdBcfGUIDAttribute; /** \details A data type that represents a smart pointer to an OdBcfGUIDAttribute object. */ typedef OdSmartPtr OdBcfGUIDAttributePtr; class OdBcfSession; /** \details A class that stores a BCF comment metadata. */ class BCF_3_0_EXPORT OdBcfCommentData { public: /** \details Creates a new commentary data object with default parameters. */ OdBcfCommentData(); /** \details A smart pointer to the timestamp object that contains the comments' date. */ OdBcf::OdBcfTimeStampPtr m_pDate; /** \details A string that contains the comments' author. */ OdString m_author; /** \details A string that contains the comments' text. */ OdString m_comment; /** \details A smart pointer to the viewpoint guid object, which is related to the comment. */ OdBcfGUIDAttributePtr m_pViewpoint; /** \details A smart pointer to a timestamp object that contains the date and time of the comment modification. */ OdBcf::OdBcfTimeStampPtr m_pModifiedDate; /** \details A string that contains the comments' modified author. */ OdString m_modifiedAuthor; /** \details A globally unique identifier of the comment. */ OdGUID m_guid; }; /** \details A class that stores and operates comments data. */ class BCF_3_0_EXPORT OdBcfComment : public OdBcf::OdBcfElement, protected OdBcfCommentData { public: //DOM-IGNORE-BEGIN ODRX_DECLARE_MEMBERS(OdBcfComment); //DOM-IGNORE-END /** \details Reads XML data into ODA data structures. \param pParent [in] A pointer to the parent element of the data structure. \returns eOk if data is successfully read; otherwise, the method returns an appropriate error code. */ virtual OdResult inFields(TiXmlElement *pParent) ODRX_OVERRIDE; /** \details Writes data into XML structures. \param pParent [in] A pointer to the parent element of the data structure. \returns eOk if data is successfully written; otherwise, the method returns an appropriate error code. */ virtual OdResult outFields(TiXmlElement *pParent) const ODRX_OVERRIDE; /** \details Retrieves the comment's date. \returns A smart pointer to the OdBcfTimeStamp object that contains the date. \remarks The timestamp object returned by the method can't be modified in the calling subroutine. */ const OdBcf::OdBcfTimeStampPtr& getDate() const; /** \details Checks whether the comment's date is not initialized. \returns true if the date is not initialized; otherwise, the method returns false. */ bool isDateUnset() const; /** \details Retrieves the comment's author. \returns A string that contains information about the comment's author. \remarks The string with information about the author returned by the method can't be modified in the calling subroutine. */ const OdString& getAuthor() const; /** \details Checks whether the comment's author is not initialized. \returns true if the author is not initialized; otherwise, the method returns false. */ bool isAuthorUnset() const; /** \details Sets a new comment's text. \param commentValue [in] A string that contains the new comment text. */ void setComment(const OdString &commentValue); /** \details Retrieves the comment text. \returns A string that contains the comment text. \remarks The comment text returned by the method can be modified in the calling subroutine. */ OdString& getComment(); /** \details Retrieves the comment text. \returns A string that contains the comment text. \remarks The comment text returned by the method can't be modified in the calling subroutine. */ const OdString& getComment() const; /** \details Checks whether the comment text is not initialized. \returns true if the comment text is not initialized; otherwise, the method returns false. */ bool isCommentUnset() const; /** \details Sets a new viewpoint value. \param viewpointValue [in] A smart pointer to the OdBcfGUIDAttribute object that contains the new viewpoint value. */ void setViewpoint(const OdBcfGUIDAttributePtr &viewpointValue); /** \details Retrieves the comment's viewpoint value. \returns A smart pointer to the OdBcfGUIDAttribute object that represents the view point value. \remarks The viewpoint value returned by the method can be modified in the calling subroutine. */ OdBcfGUIDAttributePtr& getViewpoint(); /** \details Retrieves the comment's viewpoint value. \returns A smart pointer to the OdBcfGUIDAttribute object that represents the view point value. \remarks The viewpoint value returned by the method can't be modified in the calling subroutine. */ const OdBcfGUIDAttributePtr& getViewpoint() const; /** \details Checks whether the comment viewpoint value is not initialized. \returns true if the viewpoint value is not initialized; otherwise, the method returns false. */ bool isViewpointUnset() const; /** \details Sets a new date of the last comment text modification. \param modifiedDateValue [in] A smart pointer to the OdBcfTimeStamp object that contains the new date of modification. */ void setModifiedDate(const OdBcf::OdBcfTimeStampPtr &modifiedDateValue); /** \details Retrieves the date of the last modification of the comment text. \returns A smart pointer to the OdBcfTimeStamp object that contains the date of the last comment text modification. \remarks The timestamp object returned by the method can be modified in the calling subroutine. */ OdBcf::OdBcfTimeStampPtr& getModifiedDate(); /** \details Retrieves the date of the last modification of the comment text. \returns A smart pointer to the OdBcfTimeStamp object that contains the date of the last comment text modification. \remarks The timestamp object returned by the method can't be modified in the calling subroutine. */ const OdBcf::OdBcfTimeStampPtr& getModifiedDate() const; /** \details Checks whether the date of the last comment text modification is not initialized. \returns true if the date of the last modification is not initialized; otherwise, the method returns false. */ bool isModifiedDateUnset() const; /** \details Sets a new author of the last comment text modification. \param modifiedAuthorValue [in] A string that contains information about the author of the last comment text modification. */ void setModifiedAuthor(const OdString &modifiedAuthorValue); /** \details Retrieves the information about the author of the last modification of the comment text. \returns A string that contains the information about the author of the last comment text modification. \remarks The string returned by the method can be modified in the calling subroutine. */ OdString& getModifiedAuthor(); /** \details Retrieves the information about the author of the last modification of the comment text. \returns A string that contains the information about the author of the last comment text modification. \remarks The string returned by the method can't be modified in the calling subroutine. */ const OdString& getModifiedAuthor() const; /** \details Checks whether the information about the author of the last comment text modification is not initialized. \returns true if the author of the last modification is not initialized; otherwise, the method returns false. */ bool isModifiedAuthorUnset() const; /** \details Retrieves the global unique identifier (GUID) of the comment object. \returns An OdGUID object that contains the GUID value. \remarks The GUID returned by the method can't be modified in the calling subroutine. */ const OdGUID& getGuid() const ODRX_OVERRIDE; /** \details Checks whether the global unique identifier (GUID) of the comment object is not initialized. \returns true if the GUID is not initialized; otherwise, the method returns false. */ bool isGuidUnset() const; /** \details An assignment operator for a BCF comment object. \param val [in] Another BCF comment object that should be assigned (the right-hand operand). \returns A reference to the comment object after the modification by the assignment operator. */ OdBcfComment& operator = (const OdBcfCommentData& val); //DOM-IGNORE-BEGIN protected: /** \details Retrieves the creation date of the comment object. \returns A smart pointer to the OdBcfTimeStamp object that represents the creation date. \remarks The timestamp object returned by the method can be modified in the calling subroutine. */ OdBcf::OdBcfTimeStampPtr& getDate(); /** \details Retrieves the information about the author of the comment object. \returns A string that contains information about the author of the comment object. \remarks The string returned by the method can be modified in the calling subroutine. */ OdString& getAuthor(); /** \details Retrieves the global unique identifier (GUID) of the comment object. \returns An OdGUID object that contains the comment GUID. \remarks The GUID returned by the method can be modified in the calling subroutine. */ OdGUID& getGuid(); /** \details Sets the date of the creation of the comment object. \param dateValue [in] A new value to set represented with the OdBcfTimeStamp object. */ void setDate(const OdBcf::OdBcfTimeStampPtr &dateValue); /** \details Sets information about the author of the comment object. \param authorValue [in] A string with information about the comment author. */ void setAuthor(const OdString &authorValue); /** \details Sets the global unique identifier (GUID) for the comment object. \param guidValue [in] An OdGUID object that contains the comment GUID. */ void setGuid(const OdGUID &guidValue); /** \details Checks whether the commentary instance has all required fields initialized. \param context [in/out] A raw pointer to the validation context to store results in. \returns true if all required fields are initialized; otherwise the method returns false. */ virtual bool validateData(OdBcf::OdBcfValidationContext *context) const ODRX_OVERRIDE; friend OdBcfSession; //DOM-IGNORE-END }; /** \details A data type that represents a smart pointer to an OdBcfComment object. */ typedef OdSmartPtr OdBcfCommentPtr; } //namespace OdBcf_3_0 #endif // _BCF_3_0_COMMENT_H