Wt  3.3.8
Public Member Functions | List of all members
Wt::WTheme Class Referenceabstract

#include <Wt/WTheme>

Inheritance diagram for Wt::WTheme:
Inheritance graph
[legend]

Public Member Functions

 WTheme (WObject *parent=0)
 Constructor.
 
virtual ~WTheme ()
 Destructor.
 
virtual std::string name () const =0
 Returns a theme name. More...
 
virtual std::string resourcesUrl () const
 Returns the URL where theme-related resources are stored. More...
 
virtual void serveCss (WStringStream &out) const
 Serves the CSS for the theme. More...
 
virtual std::vector< WCssStyleSheetstyleSheets () const =0
 Returns a vector with stylesheets for the theme. More...
 
virtual void apply (WWidget *widget, WWidget *child, int widgetRole) const =0
 Applies the theme to a child of a composite widget. More...
 
virtual void apply (WWidget *widget, DomElement &element, int elementRole) const =0
 Applies the theme to a DOM element that renders a widget. More...
 
virtual std::string disabledClass () const =0
 Returns a generic CSS class name for a disabled element.
 
virtual std::string activeClass () const =0
 Returns a generic CSS class name for an active element.
 
virtual std::string utilityCssClass (int utilityCssClassRole) const =0
 Returns a generic CSS class name for the chosen role. More...
 
virtual bool canStyleAnchorAsButton () const =0
 Returns whether the theme allows for an anchor to be styled as a button.
 
virtual void applyValidationStyle (WWidget *widget, const Wt::WValidator::Result &validation, WFlags< ValidationStyleFlag > flags) const =0
 Applies a style that indicates the result of validation.
 
- Public Member Functions inherited from Wt::WObject
 WObject (WObject *parent=0)
 Create a WObject with a given parent object. More...
 
virtual ~WObject ()
 Destructor. More...
 
virtual const std::string id () const
 Returns the (unique) identifier for this object. More...
 
virtual void setObjectName (const std::string &name)
 Sets an object name. More...
 
virtual std::string objectName () const
 Returns the object name. More...
 
void resetLearnedSlots ()
 Resets learned stateless slot implementations. More...
 
template<class T >
void resetLearnedSlot (void(T::*method)())
 Resets a learned stateless slot implementation. More...
 
template<class T >
WStatelessSlot * implementStateless (void(T::*method)())
 Declares a slot to be stateless and learn client-side behaviour on first invocation. More...
 
template<class T >
WStatelessSlot * implementStateless (void(T::*method)(), void(T::*undoMethod)())
 Declares a slot to be stateless and learn client-side behaviour in advance. More...
 
void isNotStateless ()
 Marks the current function as not stateless. More...
 
template<class T >
WStatelessSlot * implementJavaScript (void(T::*method)(), const std::string &jsCode)
 Provides a JavaScript implementation for a method. More...
 
void addChild (WObject *child)
 Adds a child object. More...
 
virtual void removeChild (WObject *child)
 Removes a child object. More...
 
const std::vector< WObject * > & children () const
 Returns the children.
 
WObjectparent () const
 Returns the parent object.
 

Additional Inherited Members

- Public Types inherited from Wt::WObject
typedef void(WObject::* Method) ()
 Typedef for a WObject method without arguments.
 
- Protected Member Functions inherited from Wt::WObject
virtual WStatelessSlot * getStateless (Method method)
 On-demand stateless slot implementation. More...
 
- Static Protected Member Functions inherited from Wt::WObject
static WObjectsender ()
 Returns the sender of the current slot call. More...
 

Detailed Description

Abstract base class for themes in Wt.

See also
WApplication::setTheme()

Member Function Documentation

virtual void Wt::WTheme::apply ( WWidget widget,
WWidget child,
int  widgetRole 
) const
pure virtual

Applies the theme to a child of a composite widget.

The widgetRole indicates the role that child has within the implementation of the widget.

Implemented in Wt::WCssTheme, and Wt::WBootstrapTheme.

virtual void Wt::WTheme::apply ( WWidget widget,
DomElement element,
int  elementRole 
) const
pure virtual

Applies the theme to a DOM element that renders a widget.

The element is a rendered representation of the widget, and may be further customized to reflect the theme.

Implemented in Wt::WCssTheme, and Wt::WBootstrapTheme.

virtual std::string Wt::WTheme::name ( ) const
pure virtual

Returns a theme name.

Returns a unique name for the theme. This name is used by the default implementation of resourcesUrl() to compute a location for the theme's resources.

Implemented in Wt::WCssTheme, and Wt::WBootstrapTheme.

std::string Wt::WTheme::resourcesUrl ( ) const
virtual

Returns the URL where theme-related resources are stored.

The default implementation considers a folder within Wt's resource directory, based on the theme name().

void Wt::WTheme::serveCss ( WStringStream out) const
virtual

Serves the CSS for the theme.

This must serve CSS declarations for the theme.

The default implementation serves all the styleSheets().

virtual std::vector<WCssStyleSheet> Wt::WTheme::styleSheets ( ) const
pure virtual

Returns a vector with stylesheets for the theme.

This should return a vector with stylesheets that implement the theme. This list may be tailored to the current user agent, which is read from the application environment.

Implemented in Wt::WCssTheme, and Wt::WBootstrapTheme.

virtual std::string Wt::WTheme::utilityCssClass ( int  utilityCssClassRole) const
pure virtual

Returns a generic CSS class name for the chosen role.

See also
WTheme::utilityCssClassRole

Implemented in Wt::WCssTheme, and Wt::WBootstrapTheme.


Generated on Mon Sep 4 2017 for the C++ Web Toolkit (Wt) by doxygen 1.8.11