Wt  4.13.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
Wt::WRasterFavicon Class Reference

A WFavicon using a WRasterImage as resource. More...

#include <Wt/WRasterFavicon.h>

Inheritance diagram for Wt::WRasterFavicon:
[legend]

Public Member Functions

 WRasterFavicon (std::shared_ptr< WAbstractDataInfo > info, const WLength &width=256, const WLength &height=256, const std::string &type="png")
 Constructs a WRasterFavicon.
 
void setdefaultFavicon (std::shared_ptr< WAbstractDataInfo > info)
 Sets the default favicon.
 
std::shared_ptr< WAbstractDataInfodefaultFavicon () const
 Returns the data info of the default favicon.
 
std::string url () const override
 Returns the url to the favicon.
 
void setOutlineBrush (const WBrush &brush)
 Sets the brush used to paint the outline of the circle.
 
WBrush outlineBrush () const
 Returns the brush used to paint the outline of the circle.
 
void setFillBrush (const WBrush &brush)
 Sets the brush used to fill the circle.
 
WBrush fillBrush () const
 Returns the brush used to fill the circle.
 
- Public Member Functions inherited from Wt::WFavicon
void update ()
 Sets the favicon in its update state.
 
void reset ()
 Sets the favicon in its default state.
 
bool isUpdated () const
 Returns whether the favicon is in its update state or not.
 

Protected Member Functions

WRasterImagefavicon () const
 Returns the WRasterImage.
 
void doUpdate () override
 Updates the favicon.
 
void doReset () override
 Resets the favicon.
 

Detailed Description

A WFavicon using a WRasterImage as resource.

This is a WFavicon that uses a WRasterImage as resource.

In its default state, it shows an image present in the docroot, and in its updated state, it shows the same image with a circle.

See also
WApplication::setFavicon()

Constructor & Destructor Documentation

◆ WRasterFavicon()

Wt::WRasterFavicon::WRasterFavicon ( std::shared_ptr< WAbstractDataInfo info,
const WLength width = 256,
const WLength height = 256,
const std::string &  type = "png" 
)
explicit

Constructs a WRasterFavicon.

Constructs a WRasterFavicon of given image type, width, and height and using the image described by info as default favicon.

By default, type is "png" and width and height are of 256 pixels.

Note
Like for WRasterImage, the mime type of the favicon is "image/" type.

Member Function Documentation

◆ defaultFavicon()

std::shared_ptr< WAbstractDataInfo > Wt::WRasterFavicon::defaultFavicon ( ) const

Returns the data info of the default favicon.

See also
setdefaultFavicon()

◆ doReset()

void Wt::WRasterFavicon::doReset ( )
overrideprotectedvirtual

Resets the favicon.

Clear the WRasterImage and repaint the default favicon on it.

Reimplemented from Wt::WFavicon.

◆ doUpdate()

void Wt::WRasterFavicon::doUpdate ( )
overrideprotectedvirtual

Updates the favicon.

Draw the circle on the WRasterImage.

You can override this function to change what is drawn on the favicon when update is called.

Reimplemented from Wt::WFavicon.

◆ favicon()

WRasterImage * Wt::WRasterFavicon::favicon ( ) const
protected

Returns the WRasterImage.

See also
doUpdate(), doReset()

◆ fillBrush()

WBrush Wt::WRasterFavicon::fillBrush ( ) const

Returns the brush used to fill the circle.

See also
setFillBrush()

◆ outlineBrush()

WBrush Wt::WRasterFavicon::outlineBrush ( ) const

Returns the brush used to paint the outline of the circle.

See also
setOutlineBrush()

◆ setdefaultFavicon()

void Wt::WRasterFavicon::setdefaultFavicon ( std::shared_ptr< WAbstractDataInfo info)

Sets the default favicon.

Sets the image described by info as the new default favicon.

◆ setFillBrush()

void Wt::WRasterFavicon::setFillBrush ( const WBrush brush)

Sets the brush used to fill the circle.

This sets the brush used to the circle added to the favicon when in updated state.

See also
update()

◆ setOutlineBrush()

void Wt::WRasterFavicon::setOutlineBrush ( const WBrush brush)

Sets the brush used to paint the outline of the circle.

This sets the brush used to paint the outline of the circle added to the favicon when in updated state.

See also
update()

◆ url()

std::string Wt::WRasterFavicon::url ( ) const
overridevirtual

Returns the url to the favicon.

This returns the url to the WRasterImage, updating the WRasterImage will therefor automatically update the favicon on the client side.

Implements Wt::WFavicon.