soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SobjectApi.h
1 //! Add reference
2 /*!
3 * @brief Increments the reference count of the object.
4 *
5 * @return long The new reference count.
6 */
7 STDMETHOD_(long, AddRef)(THIS) PURE;
8
9 //! Release reference
10 /*!
11 * @brief Decrements the reference count of the object.
12 *
13 * @return long The new reference count.
14 */
15 STDMETHOD_(long, Release)(THIS) PURE;
16
17 //! Final release of the object
18 /*!
19 * @brief Final release of the object, performing cleanup if necessary.
20 */
21 STDMETHOD_(void, OnFinalRelease)(THIS) PURE;
22
23 /**
24 * @brief Checks if the object is of a specified class type.
25 *
26 * @param lpszName Name of the class type to test.
27 * @return BOOL TRUE if the object is of the specified class type, FALSE otherwise.
28 */
29 STDMETHOD_(BOOL, IsClass)(CTHIS_ LPCWSTR lpszName) SCONST PURE;
30
31 /**
32 * @brief Retrieves the class name of the object.
33 *
34 * @return LPCWSTR Class name of the object.
35 *
36 * @details This is a virtual function. Note the difference between this and GetClassName.
37 */
38 STDMETHOD_(LPCWSTR, GetObjectClass)(CTHIS) SCONST PURE;
39
40 /**
41 * @brief Retrieves the type of the object.
42 *
43 * @return int Type of the object.
44 *
45 * @details This is a virtual function. Note the difference between this and GetClassType.
46 */
47 STDMETHOD_(int, GetObjectType)(CTHIS) SCONST PURE;
48
49 /**
50 * @brief Retrieves the ID of the object.
51 *
52 * @return int ID of the object.
53 */
54 STDMETHOD_(int, GetID)(CTHIS) SCONST PURE;
55
56 /**
57 * @brief Sets the ID of the object.
58 *
59 * @param nID ID to set for the object.
60 */
61 STDMETHOD_(void, SetID)(THIS_ int nID) PURE;
62
63 /**
64 * @brief Retrieves the name of the object.
65 *
66 * @return LPCWSTR Name of the object.
67 */
68 STDMETHOD_(LPCWSTR, GetName)(CTHIS) SCONST PURE;
69
70 /**
71 * @brief Retrieves the name of the object as an ANSI string.
72 *
73 * @return LPCSTR Name of the object.
74 */
75 STDMETHOD_(LPCSTR, GetNameA)(CTHIS) SCONST PURE;
76
77 /**
78 * @brief Sets the name of the object.
79 *
80 * @param pszName Name to set for the object.
81 */
82 STDMETHOD_(void, SetName)(THIS_ LPCWSTR pszName) PURE;
83
84 /**
85 * @brief Initializes the object from an XML node.
86 *
87 * @param xmlNode XML node containing the initialization data.
88 * @return BOOL TRUE if initialization is successful, FALSE otherwise.
89 */
90 STDMETHOD_(BOOL, InitFromXml)(THIS_ IXmlNode *xmlNode) PURE;
91
92 /**
93 * @brief Handles the completion of attribute initialization.
94 *
95 * @param xmlNode XML node containing the attribute data.
96 */
97 STDMETHOD_(void, OnInitFinished)(THIS_ IXmlNode *xmlNode) PURE;
98
99 /**
100 * @brief Sets an attribute of the object.
101 *
102 * @param strAttribName Name of the attribute.
103 * @param strValue Value of the attribute.
104 * @param bLoading Flag indicating if the object is being created by the system.
105 * @return HRESULT Result of the attribute setting operation.
106 */
107 STDMETHOD_(HRESULT, ISetAttribute)
108 (THIS_ const IStringW *strAttribName, const IStringW *strValue, BOOL bLoading) PURE;
109
110 /**
111 * @brief Sets an attribute of the object using ANSI strings.
112 *
113 * @param pszAttr Name of the attribute.
114 * @param pszValue Value of the attribute.
115 * @param bLoading Flag indicating if the object is being created by the system.
116 * @return HRESULT Result of the attribute setting operation.
117 */
118 STDMETHOD_(HRESULT, SetAttributeA)(THIS_ LPCSTR pszAttr, LPCSTR pszValue, BOOL bLoading DEF_VAL(FALSE)) PURE;
119
120 /**
121 * @brief Sets an attribute of the object using wide strings.
122 *
123 * @param pszAttr Name of the attribute.
124 * @param pszValue Value of the attribute.
125 * @param bLoading Flag indicating if the object is being created by the system.
126 * @return HRESULT Result of the attribute setting operation.
127 */
128 STDMETHOD_(HRESULT, SetAttribute)(THIS_ LPCWSTR pszAttr, LPCWSTR pszValue, BOOL bLoading DEF_VAL(FALSE)) PURE;
129
130 /**
131 * @brief Retrieves the value of an attribute by its name.
132 *
133 * @param strAttr Name of the attribute.
134 * @param pValue Pointer to receive the attribute value.
135 * @return BOOL TRUE if the attribute is successfully retrieved, FALSE otherwise.
136 */
137 STDMETHOD_(BOOL, GetAttribute)(CTHIS_ LPCWSTR strAttr, IStringW *pValue) SCONST PURE;
138
139 /**
140 * @brief Handles the completion of attribute processing.
141 *
142 * @param pszAttr Name of the attribute.
143 * @param pszValue Value of the attribute.
144 * @param bLoading Flag indicating if the object is being created by the system.
145 * @param hr Result of the attribute processing.
146 * @return HRESULT Result of the attribute processing.
147 */
148 STDMETHOD_(HRESULT, AfterAttribute)
149 (THIS_ LPCWSTR pszAttr, LPCWSTR pszValue, BOOL bLoading, HRESULT hr) PURE;
150
151 /**
152 * @brief Sets the attribute handler callback function.
153 *
154 * @param attrHandler Callback function for attribute handling.
155 */
156 STDMETHOD_(void, SetAttrHandler)(THIS_ FunAttrHandler attrHandler) PURE;
157
Interface for XML nodes.
Definition sxml-i.h:128