/////////////////////////////////////////////////////////////////////////////// // 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 _ODPRC_HOSTAPPLICATIONSERVICES_INCLUDED_ #define _ODPRC_HOSTAPPLICATIONSERVICES_INCLUDED_ #include "TD_PackPush.h" #include "DbBaseHostAppServices.h" #include "StringArray.h" class OdPrcFile; typedef OdSmartPtr OdPrcFilePtr; class wrTriangulationParams; /** \details This class is the base class for platform-specific operations within PRC SDK. */ class ODRX_ABSTRACT PRC_TOOLKIT OdPrcHostAppServices : public OdDbBaseHostAppServices { public: //DOM-IGNORE-BEGIN ODRX_DECLARE_MEMBERS(OdPrcHostAppServices); //DOM-IGNORE-END /** \details Creates platform-specific operations services for PRC file functionality. */ OdPrcHostAppServices(); /** \details Enumeration for default database content initialization modes. */ enum DatabaseDefaultContent { /** Database content is not to be initialized.*/ kDbNotInitialized = 0, /** Default database content initialization mode.*/ kDbDefault = 1 }; /** \details Requests the static OdRxClass description object associated with the database. \returns The result of the OdPrcFile::desc() method inherited from the OdRxObject object. */ virtual OdRxClass* databaseClass() const; /** \details Creates an instance of the class. \param defaultContent [in] A default database content flag. It determines whether the newly created database is populated with the default set of objects. If the parameter value is equal to kNotInitialized, the database default content is not initialized. \returns The smart pointer to the newly created database. \remarks This HostAppServices object will be associated with the newly created database. */ virtual OdPrcFilePtr createDatabase( DatabaseDefaultContent defaultContent = kDbDefault) const; /** \details Requests the fully qualified path to the specified file. \param filename [in] A name of the file to find. \param pDb [in] A pointer to the database context. If the parameter value is equal to NULL, the file search is not related to a database. \param hint [in] A hint that indicates the type of file that is required. \returns A string that contains the full path to the file. \remarks The method returns an empty string if the file is not found. This method is called by PRC SDK when access is needed to a file, such as a font file, a template file, etc. If the pDb parameter value is not equal to NULL, call pDb->getFilename() to determine the path to the PRC file associated with the database. The typical search order is as follows: # The file name itself. # The current directory. # The drawing directory (for shx font, image, and xref files). # The Windows fonts directory (only for TTF fonts on Windows). The hint parameter must be one of the following: Name Value Description Extension kDefault 0 Any file. any kFontFile 1 Can be either SHX or TTF file. SHX or TTF kCompiledShapeFile 2 SHX file. SHX kTrueTypeFontFile 3 TTF file. TTF kEmbeddedImageFile 4 Image file. ISM kXRefDrawing 5 External reference file. kPatternFile 6 Pattern file (PAT) PAT kDRXApplication 7 DRX application file. DRX kFontMapFile 8 FontMap file. FMP
*/ virtual OdString findFile( const OdString& filename, OdDbBaseDatabase* pDb = 0, FindFileHint hint = kDefault); /** \details Requests the current name of the client program. This method is typically used for populating the "About" information. \returns A string that contains the current name of the client program. \remarks The default implementation of this method returns the result of oddgGetLibraryInfo() ->getLibName(). */ virtual const OdString program(); /** \details Requests the current name of the client product. This method is typically used for populating the "About" information. \returns A string that contains the current name of the client product. \remarks The default implementation of this method returns the result of the method of the class. */ virtual const OdString product(); /** \details Requests the current name of the client company. This method is typically used for populating the "About" information. \returns A string that contains the current name of the client company. \remarks The default implementation of this method returns the result of oddgGetLibraryInfo() ->getCompanyName(). */ virtual const OdString companyName(); /** \details Requests the major and minor release version numbers of the client application in string form. \returns A string that contains the major and minor release version numbers of the client application. \remarks The default implementation of this method returns the result of oddgGetLibraryInfo() ->getLibVersion(). */ virtual const OdString releaseMajorMinorString(); /** \details Requests a string that contains the release version of the client application. \returns A string that contains the release version information of the client application. \remarks The default implementation of this method returns the result of oddgGetLibraryInfo() ->getLibVersion(). */ virtual const OdString versionString(); /** \details Generates a string that contains a formatted message corresponding to the specified error code(s). \returns A string that contains the formatted error message. \param errorCode [in] An error code. The method accepts multiple error codes as well, but at least one. */ virtual OdString formatMessage( unsigned int errorCode,...); /** \details Requests the path to an alternate font file to be used when a given font file is not found by PRC SDK. \returns A string that contains the full path to the file that contains the alternate font. \remarks The default implementation of this method returns an empty string. \sa */ virtual OdString getAlternateFontName() const; /** \details Requests the name of the font mapping file used by the method. \returns A string that contains the full path to the font mapping file. \remarks The default implementation of this method returns an empty string. \sa */ virtual OdString getFontMapFileName() const; /** \details Requests the preferred font name for the specified font name and type. \param fontName [in] A font name. \param fontType [in] A font type. \returns A string that contains the preferred font name. \remarks The fontType parameter value must be one of the following: Name Value Description kFontTypeUnknown 0 Unknown. kFontTypeShx 1 SHX font. kFontTypeTrueType 2 TrueType font. kFontTypeShape 3 Shape file. kFontTypeBig 4 BigFont file.
The default implementation of this method returns an empty string. \sa */ virtual OdString getPreferableFont( const OdString& fontName, OdFontType fontType); /** \details Requests the name of the substitute font to be used when the specified font is not found. \param fontName [in] A font name. \param fontType [in] A font type. \returns A string that contains the substitute font name. \remarks The fontType parameter value must be one of the following: Name Value Description kFontTypeUnknown 0 Unknown. kFontTypeShx 1 SHX font. kFontTypeTrueType 2 TrueType font. kFontTypeShape 3 Shape file. kFontTypeBig 4 BigFont file.
The default implementation of this method returns an empty string. \sa */ virtual OdString getSubstituteFont( const OdString& fontName, OdFontType fontType); /** \details Requests the typeface name of the substitute TrueType font that contains the specified character when a specified font is not found by the operating system. \param pFont [in] The current font. \param unicodeChar [in] The symbol (Unicode) that should be found in the substitute font. \param pDb [in] A pointer to the database context. \returns A string that contains the typeface name of the substitute font. \remarks The default implementation uses Windows API for getting the font. \sa */ virtual OdString getSubstituteFontByChar( const OdFont& pFont, OdChar unicodeChar, OdDbBaseDatabase *pDb); /** \details Requests the bitmap device associated with this object. \param pViewObj [in] An OdAbstractViewPE-compatible object (for example, OdGsView, etc.). \param pDb [in] A pointer to the database context. \param flags [in] An unsigned 32-bit integer that contains the bitmap device flags. \returns A smart pointer to the OdGsDevice object. */ virtual OdGsDevicePtr gsBitmapDevice( OdRxObject* pViewObj = NULL, OdDbBaseDatabase* pDb = NULL, OdUInt32 flags = 0); /** \details Reads PRC file content from a specified stream and returns a smart pointer to the created object. \param pFileBuff [in] A raw pointer to a stream to read data from. \returns A smart pointer to an object that contains the read data. */ virtual OdPrcFilePtr readFile(OdStreamBuf* pFileBuff); /** \details Reads content from a specified PRC file, creates a new object, and returns a smart pointer to it. \param file [in] A path to the file to read data from. \returns A smart pointer to an object that contains the read data. */ virtual OdPrcFilePtr readFile(const OdString &file); /** \details Sets a new global setting of the B-Rep triangulation. \param params [out] An object that contains the settings to be applied. \returns eOk if the new settings were successfully set; otherwise, the method returns an appropriate error code. */ virtual OdResult setTriangulationParams(const wrTriangulationParams ¶ms); /** \details Retrieves the global setting of the B-Rep triangulation. \param params [out] A placeholder for the global settings of the B-Rep triangulation. \returns eOk if the settings were successfully returned; otherwise, the method returns an appropriate error code. */ virtual OdResult getTriangulationParams(wrTriangulationParams ¶ms); /** \details Initializes a B-Rep Builder object with a product-specific implementation. \param bbuilder [in] A placeholder for the instance of the B-Rep builder class. \param bbType [in] A type of B-Rep object. \returns The eOk value if the B-Rep builder object was successfully initialized; otherwise, the method returns an appropriate error code. \remarks The method returns eNotImplementedYet by default. */ virtual OdResult brepBuilder(OdBrepBuilder& bbuilder, BrepType bbType); }; #include "TD_PackPop.h" #endif /* _ODPRC_HOSTAPPLICATIONSERVICES_INCLUDED_ */