/////////////////////////////////////////////////////////////////////////////// // 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. /////////////////////////////////////////////////////////////////////////////// #if !defined(ODA_ODMVDXMLLINK_H_INCLUDED_) #define ODA_ODMVDXMLLINK_H_INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "MvdXmlElement.h" /** \details Contains declarations related to Model View Definition (MVD) functionality. */ namespace OdMvdXml { SMARTPTR(OdMvdXmlLink); /** \details A class that implements a Link element within MVDXML format. A Link element stores and operates links to the additional documentation content. */ class MVDXML_EXPORT OdMvdXmlLink : public OdMvdXmlElement { ODRX_DECLARE_MEMBERS(OdMvdXmlLink); public: /** \details Retrieves the language of the Link element. \returns A string that contains the language identifier base on the RFC 1766 language codes (for example, ‘en’, ‘de’, ‘en-GB’, ’de-CH’). */ OdString& getLang() { return m_lang; }; /** \details Sets the language of the Link element. \param value [in] A string that contains the language identifier base on the RFC 1766 language codes (for example, ‘en’, ‘de’, ‘en-GB’, ’de-CH’). */ void setLang(OdString &value) { m_lang = value; }; /** \details Retrieves the Link element title. \returns A string that contains the title of the Link element. */ OdString& getTitle() { return m_title; }; /** \details Sets the title of the Link element. \param value [in] A string that contains the title of the Link element. */ void setTitle(OdString &value) { m_title = value; }; /** \details Retrieves the category of the linked content (like one of the following: definition, agreement, diagram, instantiation, example). \returns A string that contains the text representing the category of the linked content. */ OdString& getCategory() { return m_category; }; /** \details Sets the category of the linked content (like one of the following: definition, agreement, diagram, instantiation, example). \param value [in] A string that contains the text representing the category of the linked content. */ void setCategory(OdString &value) { m_category = value; }; /** \details Retrieves the URL that refers to the linked content. \returns A string that contains the URL to the linked content. */ OdString& getHREF() { return m_href; }; /** \details Sets the URL that refers to the linked content. \param value [in] A string that contains the URL to the linked content. */ void setHREF(OdString &value) { m_href = value; }; /** \details Retrieves the Link element value. The value of the Link element contains the HTML-formatted description in the specified language. \return A string that contains the Link element value. */ OdString& getValue() { return m_value; }; /** \details Sets the new Link element's value. The value of the Link element contains the HTML-formatted description in the specified language. \param value [in] A string that contains the Link element value. */ void setValue(OdString &value) { m_value = value; }; /** \details Assignment operator for Link elements. \param other [in] Another OdMvdXmlLink object to be assigned (right-hand operand of the assignment operation). \returns The Link element modified by the assignment operation. */ OdMvdXmlLink& operator=(const OdMvdXmlLink& other); protected: /** \details Copy data from the other element. \param other [in] Object to copy from. */ void assign(const OdMvdXmlLink* other); /** \details Retrieves the name of the element. This name is used to write the element to a file. \returns The name of the element. */ virtual OdAnsiString getElementName(); /** \details Reads attributes from a xml element. \param pItem [in] Pointer to a xml element containing attributes. \returns eOk if the data was successfully read; otherwise, the method returns an appropriate error code. */ virtual OdResult inAttributes(TiXmlElement* pItem) override; /** \details Writing attributes to the xml element. \param pItem [in] Pointer to the xml element to which you want to add attributes. \returns eOk if the data was written successfully; otherwise, the method returns an appropriate error code. */ virtual OdResult outAttributes(TiXmlElement* pItem) override; private: /** \details Locale identifier based on RFC 1766 language codes to indicate the default locale. Examples are ‘en’, ‘de’, ‘en - GB’, ’de - CH’. */ OdString m_lang; /** \details Human readable name. This is used as the header of the link content and entry within table of contents when generating documentation. */ OdString m_title; /** \details Indication about the category of the linked content. */ OdString m_category; /** \details URL to referenced content. */ OdString m_href; /** \details HTML-formatted description in specified language. */ OdString m_value; }; } #endif // !defined(ODA_ODMVDXMLLINK_H_INCLUDED_)