/////////////////////////////////////////////////////////////////////////////// // 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. /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// // // PdfPublishText.h // /////////////////////////////////////////////////////////////////////////////// #ifndef _PDF_PUBLISH_TEXT_INCLUDED_ #define _PDF_PUBLISH_TEXT_INCLUDED_ #include "PdfPublishBaseObject.h" #include "PdfPublish2dGeometryLayer.h" #include "PdfPublishTextMarkupAnnotation.h" #include "PdfPublishCaretAnnotation.h" #include "UInt16Array.h" /** \details Contains declarations for Publish SDK. */ namespace OdPdfPublish{ /** \details This class implements a text label for .pdf documents created with Publish SDK. Text label options consist of two parts: text content and formatting parameters (font type, size, color). */ class PDFPUBLISH_TOOLKIT OdText : public OdObject { //DOM-IGNORE-BEGIN protected: OdText(); //DOM-IGNORE-END public: //DOM-IGNORE-BEGIN ODRX_DECLARE_MEMBERS(OdText); ODRX_HEAP_OPERATORS(); //DOM-IGNORE-END /** \details Destroys a text label. */ ~OdText() override; /** \details Sets the label text. \param text [in] New label text. */ void setText(const OdString& text); /** \details Sets the text label font type from the list of . \param fontType [in] A new value. \sa . */ void setFont(Text::StandardFontsType fontType); /** \details Sets font parameters for the text label. \param fontName [in] A new font name for the text label. \param fontStyle [in] A new . \param language [in] A new for the text label. \param embed [in] A flag that determines whether the font is embedded. \remarks This method can set a font that is not in the list of . By default the is used. \sa . */ void setFont(const OdString& fontName, Text::FontStyle fontStyle = Text::kRegular, Text::Language language = Text::kDefault, bool embed = false); /** \details Sets the text label font size. \param size [in] A new font size value. */ void setSize(OdUInt16 size); /** \details Sets the text label foreground color. \param color [in] A new color value. */ void setColor(ODCOLORREF color); /** \details Adds a object to the . \param annot [in] A smart pointer to a object. \sa . */ void addTextMarkupAnnotation(const OdTextMarkupAnnotationPtr& annot); /** \details Adds a object to the at the specified character position. \param annot [in] A smart pointer to a object. \param position [in] A character position after which the annotation is inserted. If the value exceeds the number of characters in the text, the annotation is inserted after the last character. \sa . */ void addCaretAnnotation(const OdCaretAnnotationPtr& annot, const OdUInt16 position); /** \details Returns the text label content. The method fills a passed string object with label text and returns this string to a calling subroutine. \param text [out] A placeholder for the label text. */ void getText(OdString& text) const; /** \details Returns the text label font type. The method fills a passed font type value and returns this string to a calling subroutine. \param storageType [out] A placeholder for the value. \param fontType [out] A placeholder for the that should be used for text object. \param fontName [out] A placeholder for the font name that should be used for text object. \param fontStyle [out] A placeholder for the . \param language [out] A placeholder for the font that should be used for text object. \param embed [out] A placeholder for the font embedding flag. \sa */ void getFont(Text::StorageType& storageType, Text::StandardFontsType& fontType, OdString& fontName, Text::FontStyle& fontStyle, Text::Language& language, bool& embed) const; /** \details Returns the text label font size. The method fills a passed value and returns it to a calling subroutine. \param size [out] A placeholder for the font size value. */ void getSize(OdUInt16& size) const; /** \details Returns the text label color. The method fills a passed ODCOLORREF value and returns it to a calling subroutine. \param color [out] A placeholder for the text label color value. */ void getColor(ODCOLORREF& color) const; /** \details Sets a PDF layer object for the text object. \param layer [in] A smart pointer to a PDF layer object. \remarks If the smart pointer to a PDF layer object is null, it means that the text object doesn't belong to any layer. */ void setLayer(const Od2dGeometryLayerPtr& layer); /** \details Returns the current PDF layer object for the text object. The method fills a passed value and returns it to a calling subroutine. \param layer [out] A placeholder for a smart pointer to PDF layer object. \remarks The method fills a passed value and returns it to a calling subroutine. */ void getLayer(Od2dGeometryLayerPtr& layer) const; /** \details Returns an array of which the contains. The method fills array with smart pointers to objects, then returns these array to a calling subroutine. \param annots [out] A placeholder for the array of smart pointers to . */ void getTextMarkupAnnotations(OdTextMarkupAnnotationPtrArray annots) const; /** \details Returns an array of which the contains. The method fills arrays with smart pointers to objects and their corresponding character positions, then returns these arrays to a calling subroutine. \param annots [out] A placeholder for the array of smart pointers to objects. \param positions [out] A placeholder for the array of character positions after which each annotation is inserted. */ void getCaretAnnotations(OdCaretAnnotationPtrArray annots, OdUInt16Array& positions) const; }; /** \details A data type that represents a smart pointer to an object. */ SMARTPTR(OdText); } #endif // _PDF_PUBLISH_TEXT_INCLUDED_