Harlinn.Windows 0.1
Loading...
Searching...
No Matches
Harlinn::Windows::Graphics::SvgDocument Class Reference

#include <HWGraphics.h>

Inheritance diagram for Harlinn::Windows::Graphics::SvgDocument:
[legend]
Collaboration diagram for Harlinn::Windows::Graphics::SvgDocument:
[legend]

Public Member Functions

void SetViewportSize (const D2D1_SIZE_F &viewportSize) const
 Sets the size of the initial viewport.
 
D2D1_SIZE_F GetViewportSize () const
 Returns the size of the initial viewport.
 
void SetRoot (_In_opt_ ID2D1SvgElement *root) const
 Sets the root element of the document. The root element must be an 'svg' element. If the element already exists within an svg tree, it is first removed.
 
void SetRoot (const SvgElement &root) const
 
void GetRoot (ID2D1SvgElement **root) const
 Gets the root element of the document.
 
SvgElement GetRoot () const
 
void FindElementById (_In_ PCWSTR id, ID2D1SvgElement **svgElement) const
 Gets the SVG element with the specified ID. If the element cannot be found, the returned element will be null.
 
SvgElement FindElementById (_In_ PCWSTR id) const
 
void Serialize (_In_ IStream *outputXmlStream, _In_opt_ ID2D1SvgElement *subtree=nullptr) const
 Serializes an element and its subtree to XML. The output XML is encoded as UTF-8.
 
void Serialize (const Stream &outputXmlStream, _In_opt_ ID2D1SvgElement *subtree=nullptr) const
 
void Serialize (const Stream &outputXmlStream, const SvgElement &subtree) const
 
void Deserialize (_In_ IStream *inputXmlStream, ID2D1SvgElement **subtree) const
 Deserializes a subtree from the stream. The stream must have only one root element, but that root element need not be an 'svg' element. The output element is not inserted into this document tree.
 
void Deserialize (const Stream &inputXmlStream, ID2D1SvgElement **subtree) const
 
SvgElement Deserialize (_In_ IStream *inputXmlStream) const
 
SvgElement Deserialize (const Stream &inputXmlStream) const
 
void CreatePaint (D2D1_SVG_PAINT_TYPE paintType, _In_opt_ const D2D1_COLOR_F *color, _In_opt_ PCWSTR id, ID2D1SvgPaint **paint) const
 Creates a paint object which can be used to set the 'fill' or 'stroke' properties.
 
SvgPaint CreatePaint (D2D1_SVG_PAINT_TYPE paintType, _In_opt_ const D2D1_COLOR_F *color=nullptr, _In_opt_ PCWSTR id=nullptr) const
 
SvgPaint CreatePaint (const D2D1_COLOR_F *color) const
 
SvgPaint CreatePaint (PCWSTR id) const
 
void CreateStrokeDashArray (const D2D1_SVG_LENGTH *dashes, UINT32 dashesCount, ID2D1SvgStrokeDashArray **strokeDashArray) const
 Creates a dash array object which can be used to set the 'stroke-dasharray' property.
 
SvgStrokeDashArray CreateStrokeDashArray (const D2D1_SVG_LENGTH *dashes, UINT32 dashesCount) const
 
void CreatePointCollection (const D2D1_POINT_2F *points, UINT32 pointsCount, ID2D1SvgPointCollection **pointCollection) const
 Creates a points object which can be used to set a 'points' attribute on a 'polygon' or 'polyline' element.
 
SvgPointCollection CreatePointCollection (const D2D1_POINT_2F *points, UINT32 pointsCount) const
 
void CreatePathData (const FLOAT *segmentData, UINT32 segmentDataCount, const D2D1_SVG_PATH_COMMAND *commands, UINT32 commandsCount, ID2D1SvgPathData **pathData) const
 Creates a path data object which can be used to set a 'd' attribute on a 'path' element.
 
SvgPathData CreatePathData (const FLOAT *segmentData, UINT32 segmentDataCount, const D2D1_SVG_PATH_COMMAND *commands, UINT32 commandsCount) const
 
- Public Member Functions inherited from Harlinn::Windows::Graphics::Resource
template<typename T = Factory>
requires std::is_base_of_v< Factory, T>
T GetFactory ()
 
- Public Member Functions inherited from Harlinn::Common::Core::Unknown
constexpr Unknown () noexcept
 
 Unknown (IUnknown *unknown, bool addref=false) noexcept
 
 Unknown (REFIID iid, const Unknown &unknown, bool throwIfNoInterface=true)
 
 Unknown (const Unknown &other) noexcept
 
 Unknown (Unknown &&other) noexcept
 
 ~Unknown () noexcept
 
constexpr operator bool () const noexcept
 
Unknownoperator= (const Unknown &other) noexcept
 
Unknownoperator= (Unknown &&other) noexcept
 
void swap (Unknown &other) noexcept
 
void ResetPtr (IUnknown *other=nullptr, bool addRef=false) noexcept
 
Unknownoperator= (nullptr_t)
 
IUnknown * Detach ()
 
template<typename T >
requires std::is_base_of_v<Unknown, T >
T As () const
 
template<typename T >
requires std::is_base_of_v<Unknown, T>
bool Is () const noexcept
 
template<typename T >
requires std::is_base_of_v<IUnknown, T>
ComPtr< TAs () const
 
template<typename T >
requires std::is_base_of_v<IUnknown, T>
bool Is () const noexcept
 This function can be used to detect if an object supports a particular COM interface derived from IUnknown.
 
template<typename T = IUnknown>
TGetInterfacePointer () const noexcept
 
bool QueryInterface (REFIID riid, void **itf) const
 Queries a COM object for a pointer to one of its interface; identifying the interface by a reference to its interface identifier (IID). If the COM object implements the interface, then it returns a pointer to that interface after calling IUnknown::AddRef on it.
 
template<typename T >
requires std::is_base_of_v<IUnknown, T>
bool QueryInterface (T **itf) const
 
constexpr bool operator== (const Unknown &other) const noexcept
 
constexpr bool operator!= (const Unknown &other) const noexcept
 
constexpr bool operator== (const IUnknown *other) const noexcept
 
constexpr bool operator!= (const IUnknown *other) const noexcept
 

Additional Inherited Members

- Public Types inherited from Harlinn::Common::Core::Unknown
typedef IUnknown InterfaceType
 
- Static Public Member Functions inherited from Harlinn::Common::Core::Unknown
template<typename T >
requires std::is_base_of_v<Unknown, T>
static T CoCreateInstanceFromClassId (const CLSID &clsid, DWORD classContext=CLSCTX_INPROC_SERVER)
 
template<typename T >
requires std::is_base_of_v<Unknown, T>
static T CoCreateInstanceFromClassId (const wchar_t *clsid, DWORD classContext=CLSCTX_INPROC_SERVER)
 
template<typename T >
requires std::is_base_of_v<Unknown, T>
static T CoCreateInstanceFromClassId (const WideString &clsid, DWORD classContext=CLSCTX_INPROC_SERVER)
 
template<typename T >
requires std::is_base_of_v<Unknown, T>
static T CoCreateInstanceFromProgId (const wchar_t *progId, DWORD classContext=CLSCTX_INPROC_SERVER)
 
template<typename T >
requires std::is_base_of_v<Unknown, T>
static T CoCreateInstanceFromProgId (const WideString &progId, DWORD classContext=CLSCTX_INPROC_SERVER)
 
template<typename T >
requires std::is_base_of_v<Unknown, T>
static T CoCreateInstanceFromDll (const ModuleHandle &dll, const CLSID &clsid)
 
- Protected Attributes inherited from Harlinn::Common::Core::Unknown
IUnknown * unknown_
 

Member Function Documentation

◆ CreatePaint() [1/4]

SvgPaint Harlinn::Windows::Graphics::SvgDocument::CreatePaint ( const D2D1_COLOR_F * color) const
inline

◆ CreatePaint() [2/4]

void Harlinn::Windows::Graphics::SvgDocument::CreatePaint ( D2D1_SVG_PAINT_TYPE paintType,
_In_opt_ const D2D1_COLOR_F * color,
_In_opt_ PCWSTR id,
ID2D1SvgPaint ** paint ) const
inline

Creates a paint object which can be used to set the 'fill' or 'stroke' properties.

Parameters
colorThe color used if the paintType is D2D1_SVG_PAINT_TYPE_COLOR.
idThe element id which acts as the paint server. This id is used if the paint type is D2D1_SVG_PAINT_TYPE_URI.

◆ CreatePaint() [3/4]

SvgPaint Harlinn::Windows::Graphics::SvgDocument::CreatePaint ( D2D1_SVG_PAINT_TYPE paintType,
_In_opt_ const D2D1_COLOR_F * color = nullptr,
_In_opt_ PCWSTR id = nullptr ) const
inline

◆ CreatePaint() [4/4]

SvgPaint Harlinn::Windows::Graphics::SvgDocument::CreatePaint ( PCWSTR id) const
inline

◆ CreatePathData() [1/2]

SvgPathData Harlinn::Windows::Graphics::SvgDocument::CreatePathData ( const FLOAT * segmentData,
UINT32 segmentDataCount,
const D2D1_SVG_PATH_COMMAND * commands,
UINT32 commandsCount ) const
inline

◆ CreatePathData() [2/2]

void Harlinn::Windows::Graphics::SvgDocument::CreatePathData ( const FLOAT * segmentData,
UINT32 segmentDataCount,
const D2D1_SVG_PATH_COMMAND * commands,
UINT32 commandsCount,
ID2D1SvgPathData ** pathData ) const
inline

Creates a path data object which can be used to set a 'd' attribute on a 'path' element.

◆ CreatePointCollection() [1/2]

SvgPointCollection Harlinn::Windows::Graphics::SvgDocument::CreatePointCollection ( const D2D1_POINT_2F * points,
UINT32 pointsCount ) const
inline

◆ CreatePointCollection() [2/2]

void Harlinn::Windows::Graphics::SvgDocument::CreatePointCollection ( const D2D1_POINT_2F * points,
UINT32 pointsCount,
ID2D1SvgPointCollection ** pointCollection ) const
inline

Creates a points object which can be used to set a 'points' attribute on a 'polygon' or 'polyline' element.

◆ CreateStrokeDashArray() [1/2]

SvgStrokeDashArray Harlinn::Windows::Graphics::SvgDocument::CreateStrokeDashArray ( const D2D1_SVG_LENGTH * dashes,
UINT32 dashesCount ) const
inline

◆ CreateStrokeDashArray() [2/2]

void Harlinn::Windows::Graphics::SvgDocument::CreateStrokeDashArray ( const D2D1_SVG_LENGTH * dashes,
UINT32 dashesCount,
ID2D1SvgStrokeDashArray ** strokeDashArray ) const
inline

Creates a dash array object which can be used to set the 'stroke-dasharray' property.

◆ Deserialize() [1/4]

SvgElement Harlinn::Windows::Graphics::SvgDocument::Deserialize ( _In_ IStream * inputXmlStream) const
inline

◆ Deserialize() [2/4]

void Harlinn::Windows::Graphics::SvgDocument::Deserialize ( _In_ IStream * inputXmlStream,
ID2D1SvgElement ** subtree ) const
inline

Deserializes a subtree from the stream. The stream must have only one root element, but that root element need not be an 'svg' element. The output element is not inserted into this document tree.

Parameters
inputXmlStreamAn input stream containing the SVG XML subtree.
subtreeThe root of the subtree.

◆ Deserialize() [3/4]

SvgElement Harlinn::Windows::Graphics::SvgDocument::Deserialize ( const Stream & inputXmlStream) const
inline

◆ Deserialize() [4/4]

void Harlinn::Windows::Graphics::SvgDocument::Deserialize ( const Stream & inputXmlStream,
ID2D1SvgElement ** subtree ) const
inline

◆ FindElementById() [1/2]

SvgElement Harlinn::Windows::Graphics::SvgDocument::FindElementById ( _In_ PCWSTR id) const
inline

◆ FindElementById() [2/2]

void Harlinn::Windows::Graphics::SvgDocument::FindElementById ( _In_ PCWSTR id,
ID2D1SvgElement ** svgElement ) const
inline

Gets the SVG element with the specified ID. If the element cannot be found, the returned element will be null.

◆ GetRoot() [1/2]

SvgElement Harlinn::Windows::Graphics::SvgDocument::GetRoot ( ) const
inline

◆ GetRoot() [2/2]

void Harlinn::Windows::Graphics::SvgDocument::GetRoot ( ID2D1SvgElement ** root) const
inline

Gets the root element of the document.

◆ GetViewportSize()

D2D1_SIZE_F Harlinn::Windows::Graphics::SvgDocument::GetViewportSize ( ) const
inline

Returns the size of the initial viewport.

◆ Serialize() [1/3]

void Harlinn::Windows::Graphics::SvgDocument::Serialize ( _In_ IStream * outputXmlStream,
_In_opt_ ID2D1SvgElement * subtree = nullptr ) const
inline

Serializes an element and its subtree to XML. The output XML is encoded as UTF-8.

Parameters
outputXmlStreamAn output stream to contain the SVG XML subtree.
subtreeThe root of the subtree. If null, the entire document is serialized.

◆ Serialize() [2/3]

void Harlinn::Windows::Graphics::SvgDocument::Serialize ( const Stream & outputXmlStream,
_In_opt_ ID2D1SvgElement * subtree = nullptr ) const
inline

◆ Serialize() [3/3]

void Harlinn::Windows::Graphics::SvgDocument::Serialize ( const Stream & outputXmlStream,
const SvgElement & subtree ) const
inline

◆ SetRoot() [1/2]

void Harlinn::Windows::Graphics::SvgDocument::SetRoot ( _In_opt_ ID2D1SvgElement * root) const
inline

Sets the root element of the document. The root element must be an 'svg' element. If the element already exists within an svg tree, it is first removed.

◆ SetRoot() [2/2]

void Harlinn::Windows::Graphics::SvgDocument::SetRoot ( const SvgElement & root) const
inline

◆ SetViewportSize()

void Harlinn::Windows::Graphics::SvgDocument::SetViewportSize ( const D2D1_SIZE_F & viewportSize) const
inline

Sets the size of the initial viewport.


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