soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SGradient Class Reference

Gradient management class. More...

#include <SGradient.h>

Inheritance diagram for SGradient:
TObjRefImpl< SObjectImpl< IGradient > > SObjectImpl< IGradient >

Public Member Functions

 SGradient ()
 Constructor.
 
const GradientItem * GetGradientData () SCONST OVERRIDE
 Gets the gradient data.
 
int GetGradientLength () SCONST OVERRIDE
 Gets the length of the gradient.
 
virtual HRESULT SetAttribute (const SNS::SStringW &amp;amp;amp;amp;strAttribName, const SNS::SStringW &amp;amp;amp;amp;strValue, BOOL bLoading=FALSE)
 
- Public Member Functions inherited from TObjRefImpl< SObjectImpl< IGradient > >
 TObjRefImpl ()
 Constructor that initializes the reference count to 1.
 
virtual ~TObjRefImpl ()
 Virtual destructor.
 
long AddRef () override
 Increments the reference count.
 
long Release () override
 Decrements the reference count and deletes the object if the count reaches zero.
 
void OnFinalRelease () override
 Deletes the object.
 
- Public Member Functions inherited from SObjectImpl< IGradient >
 SObjectImpl ()
 Constructor.
 
BOOL InitFromXml (IXmlNode *pXmlNode) OVERRIDE
 Initializes the object from an XML node.
 
LPCWSTR GetName () SCONST OVERRIDE
 Retrieves the object's name.
 
LPCSTR GetNameA () SCONST OVERRIDE
 Retrieves the object's name in ANSI format.
 
void SetName (LPCWSTR pszName) OVERRIDE
 Sets the object's name.
 
int GetID () SCONST OVERRIDE
 Retrieves the object's ID.
 
void SetID (int nID) OVERRIDE
 Sets the object's ID.
 
HRESULT AfterAttribute (LPCWSTR strAttribName, LPCWSTR strValue, BOOL bLoading, HRESULT hr) OVERRIDE
 Handles attribute processing after setting an attribute.
 
HRESULT SetAttributeA (LPCSTR pszAttr, LPCSTR pszValue, BOOL bLoading) OVERRIDE
 Sets an attribute using ANSI strings.
 
HRESULT SetAttribute (LPCWSTR pszAttr, LPCWSTR pszValue, BOOL bLoading) OVERRIDE
 Sets an attribute using wide strings.
 
virtual HRESULT SetAttribute (const SStringW &strAttr, const SStringW &strValue, BOOL bLoading)
 Sets an attribute using wide strings.
 
HRESULT ISetAttribute (const IStringW *strAttr, const IStringW *strValue, BOOL bLoading) OVERRIDE
 Sets an attribute using IStringW objects.
 
LPCWSTR GetObjectClass () SCONST OVERRIDE
 Retrieves the object's class name.
 
int GetObjectType () SCONST OVERRIDE
 Retrieves the object's type.
 
BOOL IsClass (LPCWSTR lpszName) SCONST OVERRIDE
 Checks if the object is of a specific class.
 
BOOL GetAttribute (LPCWSTR strAttr, IStringW *pValue) SCONST OVERRIDE
 Retrieves an attribute value.
 
void OnInitFinished (IXmlNode *xmlNode) OVERRIDE
 Handles initialization completion.
 
void SetAttrHandler (FunAttrHandler attrHandler) OVERRIDE
 Sets the attribute handler.
 
virtual HRESULT DefAttributeProc (const SStringW &strAttr, const SStringW &strValue, BOOL bLoading)
 Default attribute processing.
 

Protected Member Functions

void OnInitFinished (IXmlNode *pNode) OVERRIDE
 Initializes the object after loading from XML.
 
HRESULT OnAttrColors (const SStringW &value, BOOL bLoading)
 Handles the "colors" attribute.
 
int LoadColorTable (IXmlNode *xmlNode)
 Loads the color table from an XML node.
 

Protected Attributes

SArray< GradientItem > m_arrGradient
 
- Protected Attributes inherited from TObjRefImpl< SObjectImpl< IGradient > >
LONG m_cRef
 Reference count.
 
- Protected Attributes inherited from SObjectImpl< IGradient >
SStringW m_strName
 
int m_nID
 
FunAttrHandler m_attrHandler
 

Additional Inherited Members

- Static Public Member Functions inherited from SObjectImpl< IGradient >
static int GetClassType ()
 Retrieves the class type.
 
static LPCWSTR GetClassName ()
 Retrieves the class name.
 
static LPCWSTR GetClassAlias ()
 Retrieves the class alias.
 
static void MarkAttributeHandled (SXmlAttr xmlAttr, bool bHandled)
 Marks an attribute as handled.
 
static bool IsAttributeHandled (SXmlAttr xmlAttr)
 Checks if an attribute is handled.
 

Detailed Description

Gradient management class.

This class manages gradient data, including loading and retrieving gradient items. It implements the IGradient interface and provides methods to handle gradient attributes.

Definition at line 18 of file SGradient.h.

Constructor & Destructor Documentation

◆ SGradient()

SNSBEGIN SGradient::SGradient ( )

Constructor.

Initializes the gradient object.

Definition at line 5 of file SGradient.cpp.

Member Function Documentation

◆ GetGradientData()

const GradientItem * SGradient::GetGradientData ( )

Gets the gradient data.

Returns
Pointer to the gradient data

Returns a pointer to the array of gradient items.

Definition at line 9 of file SGradient.cpp.

◆ GetGradientLength()

int SGradient::GetGradientLength ( )

Gets the length of the gradient.

Returns
Number of gradient items

Returns the number of gradient items in the gradient data.

Definition at line 14 of file SGradient.cpp.

◆ LoadColorTable()

int SGradient::LoadColorTable ( IXmlNode * xmlNode)
protected

Loads the color table from an XML node.

Parameters
xmlNodePointer to the XML node
Returns
Number of colors loaded

Loads the color table from the specified XML node and returns the number of colors loaded.

Definition at line 73 of file SGradient.cpp.

◆ OnAttrColors()

HRESULT SGradient::OnAttrColors ( const SStringW & value,
BOOL bLoading )
protected

Handles the "colors" attribute.

Parameters
valueAttribute value
bLoadingTRUE if loading, FALSE otherwise
Returns
HRESULT indicating success or failure

Processes the "colors" attribute to load gradient colors from the provided value.

Definition at line 62 of file SGradient.cpp.

◆ OnInitFinished()

void SGradient::OnInitFinished ( IXmlNode * pNode)
protected

Initializes the object after loading from XML.

Parameters
pNodePointer to the XML node
Returns
HRESULT indicating success or failure

Initializes the gradient object after it has been loaded from an XML node.

Definition at line 68 of file SGradient.cpp.

◆ SetAttribute()

virtual HRESULT SGradient::SetAttribute ( const SNS::SStringW &amp;amp;amp;amp; strAttribName,
const SNS::SStringW &amp;amp;amp;amp; strValue,
BOOL bLoading = FALSE )
inlinevirtual

Definition at line 57 of file SGradient.h.

Member Data Documentation

◆ m_arrGradient

SArray<GradientItem> SGradient::m_arrGradient
protected

Array of gradient items.

Definition at line 82 of file SGradient.h.


The documentation for this class was generated from the following files: