/////////////////////////////////////////////////////////////////////////////// // 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 __NWCATEGORYCONTEXT_H__ #define __NWCATEGORYCONTEXT_H__ #include "NwExport.h" #include "NwObject.h" #include "NwDataType.h" class OdString; class OdNwVariant; /** \details This template class is a specialization of the OdArray class for OdString object. */ typedef OdArray OdStringArray; /** \details This class represents a category context of attribute. */ class NWDBEXPORT OdNwCategoryContext : public OdNwObject { //DOM-IGNORE-BEGIN ODRX_DECLARE_MEMBERS(OdNwCategoryContext); //DOM-IGNORE-END protected: /** \details Default constructor. Creates a new object of the OdNwCategoryContext class. */ OdNwCategoryContext(); public: /** \details Destructor. Frees allocated resources. */ virtual ~OdNwCategoryContext(); public: /** \details Returns the display name of the category. \returns Display name of the category as a string. \remarks Display name is a localized name. */ virtual OdString getCategory() const = 0; /** \details Returns the all possible properties of the category. \param resCode [out] Receives eOk if the category properties obtaining is successfully, otherwise an appropriate error code. \returns String array with category's properties display names. \remarks Display name is a localized name. */ virtual OdStringArray getProperties(OdResult& resCode) = 0; /** \details Returns the top hierarchy level model item nodes with this category. \param resCode [out] Receives eOk if the category selection obtaining is successfully, otherwise an appropriate error code. \returns OdNwObjectIdArray with model item, where each object id has OdNwModelItem object. */ virtual OdNwObjectIdArray getSelected(OdResult& resCode) = 0; /** \details Returns the all possible property values of the category with specified property. \param sProperty [in] String with the display property name. \param resCode [out] Receives eOk if the property values obtaining is successfully, otherwise an appropriate error code. \returns String array with category's property values. */ virtual OdStringArray getPropertyValues(const OdString& sProperty, OdResult& resCode) = 0; /** \details Returns the all possible property values of the category with specified property. \param sProperty [in] String with the display property name. \param resCode [out] Receives eOk if the property values obtaining is successfully, otherwise an appropriate error code. \returns Variant array with category's property values. */ virtual OdArray getPropertyVariantValues(const OdString& sProperty, OdResult& resCode) = 0; /** \details Returns the type of property value of the category with specified property. \param sProperty [in] String with the display property name. \param resCode [out] Receives eOk if the property values obtaining is successfully, otherwise an appropriate error code. \returns value type of selected property as enumeration type. \remarks Type can be one of the following: Name Value Description NwDataType::dt_NONE 0 Default value type. NwDataType::dt_DOUBLE 0x01 Double value type. NwDataType::dt_INT32 0x02 32-bit integer value type. NwDataType::dt_BOOL 0x03 Boolean value type. NwDataType::dt_DISPLAY_STRING 0x04 Display end-user string value type. NwDataType::dt_DATETIME 0x05 Date time value type. NwDataType::dt_DOUBLE_LENGTH 0x06 Double value type for length (in length's units). NwDataType::dt_DOUBLE_ANGLE 0x07 Double value type for angle (in radians). NwDataType::dt_NAME 0x08 Name value type (with pointer to OdNwName object). NwDataType::dt_IDENTIFIER_STRING 0x09 Programmatic identifier string value type. NwDataType::dt_DOUBLE_AREA 0x0A Double value type for area. NwDataType::dt_DOUBLE_VOLUME 0x0B Double value type for volume. NwDataType::dt_POINT3D 0x0C Point3d value type. NwDataType::dt_POINT2D 0x0D Point2d value type.
*/ virtual NwDataType::Enum getPropertyValueType(const OdString& sProperty, OdResult& resCode) = 0; /** \details Returns the top hierarchy level model item nodes with this category and specified property. \param sProperty [in] String with the display property name. \param resCode [out] Receives eOk if the property selection obtaining is successfully, otherwise an appropriate error code. \returns OdNwObjectIdArray with model item, where each object id has OdNwModelItem object. */ virtual OdNwObjectIdArray getPropertySelected(const OdString& sProperty, OdResult& resCode) = 0; /** \details Returns the top hierarchy level model item nodes with this category and specified property and value. \param sProperty [in] String with the display property name. \param sValue [in] String with the display value. \param resCode [out] Receives eOk if the property value selection obtaining is successfully, otherwise an appropriate error code. \returns OdNwObjectIdArray with model item, where each object id has OdNwModelItem object. */ virtual OdNwObjectIdArray getPropertyValueSelected(const OdString& sProperty, const OdString& sValue, OdResult& resCode) = 0; /** \details Returns the top hierarchy level model item nodes with this category and specified property and value. \param sProperty [in] String with the display property name. \param varValue [in] OdNwVariant with the display value. \param resCode [out] Receives eOk if the property value selection obtaining is successfully, otherwise an appropriate error code. \returns OdNwObjectIdArray with model item, where each object id has OdNwModelItem object. */ virtual OdNwObjectIdArray getPropertyValueSelected(const OdString& sProperty, const OdNwVariant& varValue, OdResult& resCode) = 0; }; /** \details This template class is a specialization of the OdSmartPtr class for OdNwCategoryContext object pointers. */ typedef OdSmartPtr OdNwCategoryContextPtr; #endif //__NWCATEGORYCONTEXT_H__