Wt: Wt::WCssRule Class Reference

Wt 4.10.4

Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
Wt::WCssRule Class Referenceabstract
Style classes

Abstract rule in a CSS style sheet. More...

`#include <Wt/WCssStyleSheet.h>`

Inheritance diagram for Wt::WCssRule:
[legend]

## Public Member Functions
virtual | ~WCssRule ()
| Destructor.
void | setSelector (const std::string &selector)
| Sets the selector.
virtual std::string | selector () const
| Returns the selector.
WCssStyleSheet * | sheet () const
| Returns the style sheet to which this rule belongs.
void | modified ()
| Indicates that the rule has changed and needs updating.
virtual std::string | declarations ()=0
| Returns the declarations.
Public Member Functions inherited from Wt::WObject
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.
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.
virtual const std::string | id () const
| Returns the (unique) identifier for this object.
virtual void | setObjectName (const std::string &name)
| Sets an object name.
virtual std::string | objectName () const
| Returns the object name.
void | resetLearnedSlots ()
| Resets learned stateless slot implementations.
template<class T >
void | resetLearnedSlot (void(T::*method)())
| Resets a learned stateless slot implementation.
template<class T >
WStatelessSlot * | implementStateless (void(T::*method)())
| Declares a slot to be stateless and learn client-side behaviour on first invocation.
template<class T >
WStatelessSlot * | implementStateless (void(T::*method)(), void(T::*undoMethod)())
| Declares a slot to be stateless and learn client-side behaviour in advance.
void | isNotStateless ()
| Marks the current function as not stateless.
template<class T >
WStatelessSlot * | implementJavaScript (void(T::*method)(), const std::string &jsCode)
| Provides a JavaScript implementation for a method.
Public Member Functions inherited from Wt::Core::observable
| observable () noexcept
| Default constructor.
virtual | ~observable ()
| Destructor.
template<typename... Args, typename C >
auto | bindSafe (void(C::*method)(Args...)) noexcept
| Protects a method call against object destruction.
template<typename... Args, typename C >
auto | bindSafe (void(C::*method)(Args...) const) const noexcept
| Protects a const method call against object destruction.
template<typename Function >
auto | bindSafe (const Function &function) noexcept
| Protects a function against object destruction.

## Protected Member Functions
| WCssRule (const std::string &selector)
| Creates a new CSS rule with given selector.
Protected Member Functions inherited from Wt::WObject
virtual WStatelessSlot * | getStateless (Method method)
| On-demand stateless slot implementation.

## Additional Inherited Members
Public Types inherited from Wt::WObject
typedef void(WObject::*) | Method()
| Typedef for a WObject method without arguments.
Static Public Member Functions inherited from Wt::WObject

## Detailed Description

Abstract rule in a CSS style sheet.

A rule presents CSS style properties that are applied to a selected set of elements.

Use WCssTemplateRule if you would like to use a widget as a template for specifying (and updating) a style rule, using the widgets style properties, or WCssTextRule if you wish to directly specify the CSS declarations.

See also
  WCssStyleSheet

## Member Function Documentation

## ◆ declarations()

virtual std::string Wt::WCssRule::declarations | ( |  | ) |
| pure virtual

Returns the declarations.

This is a semi-colon separated list of CSS declarations.

Implemented in Wt::WCssTemplateRule, and Wt::WCssTextRule.

## ◆ setSelector()

void Wt::WCssRule::setSelector | ( | const std::string & | selector | ) |

Sets the selector.

Note
  The selector can only be changed as long as the rule hasn't been rendered.