/** * @file XTPGridRecordItemConstraint.h * * @copyright * (c) 1998-2025 Codejock Software, All Rights Reserved. * * This source file is the property of Codejock Software and must not be * redistributed by any means without the explicit written permission of * Codejock Software. * * The use of this source code is governed by the terms and conditions specified * in the Toolkit Pro license agreement. Codejock Software grants you, as a * single software developer, the limited right to use this software on one * computer only. * * Contact Information: * support@codejock.com * http://www.codejock.com * */ /** @cond */ #if !defined(__XTPGRIDRECORDITEMCONSTRAINT_H__) # define __XTPGRIDRECORDITEMCONSTRAINT_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * CXTPGridRecordItemConstraint is a CXTPCmdTarget derived class. * It represents a single item constraint. */ class _XTP_EXT_CLASS CXTPGridRecordItemConstraint : public CXTPCmdTarget { DECLARE_DYNAMIC(CXTPGridRecordItemConstraint); public: /** * @brief * Constructs a CXTPPropertyGridItemConstraint object. */ CXTPGridRecordItemConstraint(); public: /** * @brief * Retrieve the index of this constraint within the collection of constraints. * @return * The index of this constraint within the collection of constraints. */ int GetIndex() const; public: CString m_strConstraint; /**< Caption text of this constraint. This is the text displayed for this constraint. */ DWORD_PTR m_dwData; /**< The 32-bit value associated with the item. */ protected: int m_nIndex; /**< Index of the constraint. */ private: # ifdef _XTP_ACTIVEX /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPGridRecordItemConstraint); /** @endcond */ # endif friend class CXTPGridRecordItemConstraints; friend class CXTPGridRecordItemEditOptions; }; /** * @brief * CXTPGridRecordItemConstraints is a CXTPCmdTarget derived class. * It represents the item constraints collection. */ class _XTP_EXT_CLASS CXTPGridRecordItemConstraints : public CXTPCmdTarget { public: /** * @brief * Constructs a CXTPGridRecordItemConstraints object. */ CXTPGridRecordItemConstraints(); /** * @brief * Destroys a CXTPPropertyGridItemConstraints object, * handles cleanup and deallocation */ ~CXTPGridRecordItemConstraints(); public: /** * @brief * Determines the total number of constraints in the list. * @return * The total number of constraints added to the * GridRecordItem and/or GridColumn. */ int GetCount() const; /** * @brief * Removes all constraints from the list of constraints. */ void RemoveAll(); /** * @brief * Retrieves the constraint at a specified index from the collection * of constraints. * @param nIndex Index of the constraint to retrieve. * @return * A pointer to the constraint at the specified index in the collection * of constraints. */ CXTPGridRecordItemConstraint* GetAt(int nIndex) const; protected: CArray m_arrConstraints; /**< Collection of constraints */ private: # ifdef _XTP_ACTIVEX /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPGridRecordItemConstraints); int OleGetItemCount(); afx_msg LPDISPATCH OleGetItem(long nIndex); afx_msg void OleAdd(LPCTSTR lpszCaption, long dwData); DECLARE_ENUM_VARIANT(CXTPGridRecordItemConstraints) enum { dispidCount = 1L, dispidAdd = 2L, }; /** @endcond */ # endif friend class CXTPGridRecordItemEditOptions; }; /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPGRIDRECORDITEMCONSTRAINT_H__) /** @endcond */