Wt
4.12.1
|
#include <Wt/WTheme.h>
Public Member Functions | |
WTheme () | |
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< WLinkedCssStyleSheet > | styleSheets () const =0 |
Returns a vector with stylesheets for the theme. More... | |
virtual void | init (WApplication *app) const |
Called when the theme is assigned to a WApplication. More... | |
virtual void | apply (WWidget *widget, WWidget *child, int widgetRole) const |
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 | loadValidationStyling (WApplication *app) const |
Load the required content for validation. More... | |
virtual void | applyValidationStyle (WWidget *widget, const Wt::WValidator::Result &validation, WFlags< ValidationStyleFlag > flags) const =0 |
Applies a style that indicates the result of validation. | |
virtual Side | panelCollapseIconSide () const |
Returns which side the WPanel collapse icon should be added on. More... | |
![]() | |
void | addChild (std::unique_ptr< WObject > child) |
Add a child WObject whose lifetime is determined by this WObject. | |
template<typename Child > | |
Child * | addChild (std::unique_ptr< Child > child) |
Add a child WObject, returning a raw pointer. More... | |
std::unique_ptr< WObject > | removeChild (WObject *child) |
Remove a child WObject, so its lifetime is no longer determined by this WObject. | |
template<typename Child > | |
std::unique_ptr< Child > | removeChild (Child *child) |
Remove a child WObject, so its lifetime is no longer determined by this WObject. 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... | |
![]() | |
observable () noexcept | |
Default constructor. | |
virtual | ~observable () |
Destructor. More... | |
template<typename... Args, typename C > | |
auto | bindSafe (void(C::*method)(Args...)) noexcept |
Protects a method call against object destruction. More... | |
template<typename... Args, typename C > | |
auto | bindSafe (void(C::*method)(Args...) const) const noexcept |
Protects a const method call against object destruction. More... | |
template<typename Function > | |
auto | bindSafe (const Function &function) noexcept |
Protects a function against object destruction. More... | |
Protected Member Functions | |
virtual void | applyFunctionalStyling (WWidget *widget, WWidget *child, int widgetRole) const =0 |
Applies the functional part of the theme to a widget's child. More... | |
virtual void | applyOptionalStyling (WWidget *widget, WWidget *child, int widgetRole) const =0 |
Applies the optional part of the theme to a widget's child. More... | |
![]() | |
virtual WStatelessSlot * | getStateless (Method method) |
On-demand stateless slot implementation. More... | |
Additional Inherited Members | |
![]() | |
typedef void(WObject::* | Method) () |
Typedef for a WObject method without arguments. | |
Abstract base class for themes in Wt.
|
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, Wt::WBootstrapTheme, Wt::WBootstrap5Theme, Wt::WBootstrap3Theme, and Wt::WBootstrap2Theme.
Applies the theme to a child of a composite widget.
The widgetRole
indicates the role that child
has within the implementation of the widget
.
Reimplemented in Wt::WBootstrapTheme.
|
protectedpure virtual |
Applies the functional part of the theme to a widget's child.
Only applies the functional part of the theme. This means that only things that are mandatory for the widget to function properly but depend on the theme are applied.
Implemented in Wt::WCssTheme, Wt::WBootstrapTheme, Wt::WBootstrap5Theme, Wt::WBootstrap3Theme, and Wt::WBootstrap2Theme.
|
protectedpure virtual |
Applies the optional part of the theme to a widget's child.
Only applies the optional part of the theme. This means that only things that are purely cosmetic and do not affect the functionality of the widget are applied.
This should only be called for widgets that have theme styling enabled.
Implemented in Wt::WCssTheme, Wt::WBootstrapTheme, Wt::WBootstrap5Theme, Wt::WBootstrap3Theme, and Wt::WBootstrap2Theme.
|
virtual |
Called when the theme is assigned to a WApplication.
This allows the theme to do things like load resource bundles when it is added to an application using WApplication::setTheme().
The default implementation does nothing.
Reimplemented in Wt::WBootstrapTheme, Wt::WBootstrap5Theme, Wt::WBootstrap3Theme, and Wt::WBootstrap2Theme.
|
virtual |
Load the required content for validation.
The styling, and scripts used for validation are separated. Loading these is not done on theme initialization.
Reimplemented in Wt::WCssTheme, Wt::WBootstrapTheme, Wt::WBootstrap5Theme, Wt::WBootstrap3Theme, and Wt::WBootstrap2Theme.
|
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, Wt::WBootstrapTheme, Wt::WBootstrap5Theme, Wt::WBootstrap3Theme, and Wt::WBootstrap2Theme.
|
virtual |
Returns which side the WPanel collapse icon should be added on.
Side is assumed to be Side::Left or Side::Right, other sides are not supported.
Reimplemented in Wt::WBootstrap5Theme.
|
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().
Reimplemented in Wt::WBootstrapTheme, Wt::WBootstrap5Theme, Wt::WBootstrap3Theme, and Wt::WBootstrap2Theme.
|
virtual |
Serves the CSS for the theme.
This must serve CSS declarations for the theme.
The default implementation serves all the styleSheets().
|
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, Wt::WBootstrapTheme, Wt::WBootstrap5Theme, Wt::WBootstrap3Theme, and Wt::WBootstrap2Theme.
|
pure virtual |
Returns a generic CSS class name for the chosen role.
Implemented in Wt::WCssTheme, Wt::WBootstrapTheme, Wt::WBootstrap5Theme, Wt::WBootstrap3Theme, and Wt::WBootstrap2Theme.