MessageArguments is the base class for arguments passed in messages.
More...
#include <kanzi/core.ui/message/message_arguments.hpp>
Inherited by kanzi::ActivityBrowserController::ForceTriggerMessageArguments, kanzi::ActivityBrowserController::NodeInfoTreeAvailableArguments, kanzi::ActivityConcept::ActivityInternalMessageArguments, kanzi::ActivityConcept::ActivityMessageArguments, kanzi::ActivityConcept::StartActivationInternalMessageArguments, kanzi::ActivityConcept::StatusChangedInternalMessageArguments, kanzi::ActivityHostConcept::ActivationMessageArguments, kanzi::ActivityHostConcept::ActivityPrefabMessageArguments, kanzi::ActivityHostConcept::RegisterActivityElementInternalMessageArguments, kanzi::ActivityHostConcept::UnregisterActivityElementInternalMessageArguments, kanzi::ButtonConcept::CanceledMessageArguments, kanzi::ButtonConcept::ClickedMessageArguments, kanzi::ButtonConcept::LongPressMessageArguments, kanzi::ButtonConcept::PointerEnteredMessageArguments, kanzi::ButtonConcept::PointerLeftMessageArguments, kanzi::ButtonConcept::PressedMessageArguments, kanzi::ButtonConcept::ToggledOffMessageArguments, kanzi::ButtonConcept::ToggledOnMessageArguments, kanzi::ButtonConcept::ToggleStateChangedMessageArguments, kanzi::Command::CommandMessageArguments, kanzi::ExclusiveActivityHostConcept::ImplicitActivityChangeRequestMessageArguments, kanzi::FocusManager::InputOutsideOverlayMessageArguments, kanzi::FocusManager::MoveFocusMessageArguments, kanzi::FocusManager::PostFocusMessageArguments, kanzi::FocusManager::ScopeStateChangeMessageArguments, kanzi::InputManipulator::InputMessageArguments, kanzi::InputManipulator::KeyInputMessageArguments, kanzi::Keyboard::KeyStateChangedMessageArguments, kanzi::ListBoxConcept::ItemMessageArguments, kanzi::ListBoxConcept::ItemSelectedMessageArguments, kanzi::ListBoxScrollingConcept::ScrollMessageArguments, kanzi::NodeComponent::NodeComponentSourceMessageArguments, kanzi::NodeComponent::NodeComponentTargetMessageArguments, kanzi::Page::ActivatedMessageArguments, kanzi::Page::DeactivatedMessageArguments, kanzi::Page::NavigateMessageArguments, kanzi::Page::NavigationActivatedMessageArguments, kanzi::Page::NavigationDeactivatedMessageArguments, kanzi::Page::RegisterToNavigationMessageArguments, kanzi::Page::UnregisterFromNavigationMessageArguments, kanzi::PageHost::NavigationFinishedMessageArguments, kanzi::PageHost::NavigationStartedMessageArguments, kanzi::PrefabViewConcept::AsynchronousLoadCompletedMessageArguments, kanzi::PrefabViewConcept::LoadAsynchronouslyMessageArguments, kanzi::RangeConcept::CommonMessageArguments, kanzi::Screen::ActivateThemeMessageArguments, kanzi::ScrollViewConcept::ScrollDirectionMessageArguments, kanzi::ScrollViewConcept::ScrollDownMessageArguments, kanzi::ScrollViewConcept::ScrollEdgeMessageArguments, kanzi::ScrollViewConcept::ScrollEndMessageArguments, kanzi::ScrollViewConcept::ScrollHomeMessageArguments, kanzi::ScrollViewConcept::ScrollLeftMessageArguments, kanzi::ScrollViewConcept::ScrollMessageArguments, kanzi::ScrollViewConcept::ScrollPageDownMessageArguments, kanzi::ScrollViewConcept::ScrollPageMessageArguments, kanzi::ScrollViewConcept::ScrollPageUpMessageArguments, kanzi::ScrollViewConcept::ScrollRightMessageArguments, kanzi::ScrollViewConcept::ScrollUpMessageArguments, kanzi::ScrollViewConcept::SetScrollMessageArguments, kanzi::ScrollViewConcept::SetScrollTargetMessageArguments, kanzi::ScrollViewConcept::SnapRequestMessageArguments, kanzi::ScrollViewConcept::ZoomedMessageArguments, kanzi::StateManager::StateManagerMessageArguments, kanzi::TextBoxConcept::CursorPositionMessageArguments, kanzi::TextBoxConcept::DeleteSelectionMessageArguments, kanzi::TextBoxConcept::EditingStateChangedMessageArguments, kanzi::TextBoxConcept::EraseCharactersMessageArguments, kanzi::TextBoxConcept::InputMethodActionMessageArguments, kanzi::TextBoxConcept::InputMethodAvailableMessageArguments, kanzi::TextBoxConcept::ModifyEditingStateMessageArguments, kanzi::TextBoxConcept::ModifySelectionMessageArguments, kanzi::TextBoxConcept::MoveCursorMessageArguments, kanzi::TextBoxConcept::TextChangedMessageArguments, kanzi::TextBoxConcept::TextCompositionStateMessageArguments, kanzi::TextBoxConcept::TextContentMessageArguments, kanzi::TextBoxConcept::TextInsertionMessageArguments, kanzi::TextBoxConcept::TextRangeMessageArguments, kanzi::TextInputManipulator::CursorMovedMessageArguments, kanzi::TextInputManipulator::InputMethodActionMessageArguments, kanzi::TextInputManipulator::InputMethodAvailableChangedMessageArguments, kanzi::TextInputManipulator::InputMethodsDisconnectedMessageArguments, kanzi::TextInputManipulator::InputTypeChangedMessageArguments, kanzi::TextInputManipulator::ReadOnlyStateChangedMessageArguments, kanzi::TextInputManipulator::SelectionChangedMessageArguments, kanzi::TextInputManipulator::TextChangedMessageArguments, kanzi::TextInputManipulator::TextCompositionStateMessageArguments, and kanzi::ToggleButtonGroupConcept::ToggleButtonGroupConceptMessageArguments.
MessageArguments is the base class for arguments passed in messages.
An instance of MessageArguments together with an instance of MessageType forms a Kanzi message. In Kanzi when you dispatch a message, you dispatch a message of certain type and arguments.
While MessageArguments is a base class where you can inherit your own specialized arguments, MessageType is a templated class which takes message argument type as its template parameter. In practice this means that each MessageType is linked with a certain MessageArguments type. You can derive your own arguments class or use the MessageArguments base class. Note that MessageArguments as a base class carries only the basic message information, such as the timestamp and source of the message. To dispatch any other data with your messages, inherit your own message arguments class.
You can link a message type with only one type of message arguments, but you can use a certain type of message arguments with multiple message types. See MessageType.
- See also
- For examples on using Kanzi message arguments, message types and messages in general, see Node and MessageType.
◆ MessageArguments() [1/2]
kanzi::MessageArguments::MessageArguments |
( |
| ) |
|
|
explicitdefault |
◆ ~MessageArguments()
kanzi::MessageArguments::~MessageArguments |
( |
| ) |
|
◆ MessageArguments() [2/2]
◆ operator=()
◆ getArgument()
template<typename TDataType >
TDataType kanzi::MessageArguments::getArgument |
( |
const PropertyType< TDataType > & |
argumentType | ) |
const |
|
inline |
Returns the value of an argument.
- Parameters
-
- Returns
- The value of the argument. If the argument is not present in this message arguments instance, returns the default value of the PropertyType.
◆ getOptionalArgument()
template<typename TDataType >
optional<TDataType> kanzi::MessageArguments::getOptionalArgument |
( |
const PropertyType< TDataType > & |
argumentType | ) |
const |
|
inline |
Returns the value of an argument.
- Parameters
-
- Returns
- The value of the argument. If the argument is not present in this message arguments instance, returns nullopt.
◆ getAbstractArgument()
Returns the value of an argument using AbstractPropertyType.
- Parameters
-
argumentType | The AbstractPropertyType argument whose value to get. |
variant | The variant where to store the message argument value. |
- Returns
- If the argumentType is present in this message arguments instance, true, otherwise false.
◆ setArgument()
template<typename TDataType >
void kanzi::MessageArguments::setArgument |
( |
const PropertyType< TDataType > & |
argumentType, |
|
|
typename PropertyType< TDataType >::DataType |
value |
|
) |
| |
|
inline |
Sets the value of an argument.
- Parameters
-
argumentType | The PropertyType argument whose value to set. |
value | The value to set for the argument. |
◆ setAbstractArgument()
Sets the value of an argument using AbstractPropertyType.
- Parameters
-
argumentType | The AbstractPropertyType argument whose value to set. |
variant | The variant whose value to store to the message argument value. |
◆ isFrom()
bool kanzi::MessageArguments::isFrom |
( |
const Node & |
source | ) |
const |
|
inline |
Returns whether a node is the source node of a message.
- Parameters
-
- Returns
- If the passed node is the source of the message, true, otherwise false.
◆ getSource()
shared_ptr<Node> kanzi::MessageArguments::getSource |
( |
| ) |
const |
Returns the source node for a message.
- Returns
- The source node where the message was dispatched.
◆ setHandled()
void kanzi::MessageArguments::setHandled |
( |
bool |
handled | ) |
|
|
inline |
Sets the handling status for a message.
- Parameters
-
handled | The new handling status. |
◆ isHandled()
bool kanzi::MessageArguments::isHandled |
( |
| ) |
const |
|
inline |
Returns whether the message is handled.
- Returns
- If the message is handled, true, otherwise false.
◆ getTimestamp()
TimePoint kanzi::MessageArguments::getTimestamp |
( |
| ) |
const |
|
inline |
Returns the timestamp of a message.
- Returns
- The timestamp of the message.
◆ getDispatcher()
detail::MessageDispatcher* kanzi::MessageArguments::getDispatcher |
( |
| ) |
const |
|
inline |
Returns the message dispatcher that dispatches a message.
- Returns
- The MessageDispatcher that dispatches the message.
◆ getType()
◆ setSource()
void kanzi::MessageArguments::setSource |
( |
Node * |
source | ) |
|
|
inline |
Sets the source node that dispatches a message.
- Parameters
-
source | The source of the message. |
◆ setTimestamp()
void kanzi::MessageArguments::setTimestamp |
( |
TimePoint |
timestamp | ) |
|
|
inline |
Sets the timestamp of a message.
- Parameters
-
timestamp | The timestamp of the message. |
◆ setValid()
void kanzi::MessageArguments::setValid |
( |
bool |
valid | ) |
|
|
inline |
Sets the validity of a message.
- Parameters
-
valid | The validity of the message. |
◆ isValid()
bool kanzi::MessageArguments::isValid |
( |
| ) |
const |
|
inline |
Returns whether a message is valid.
- Returns
- If the message is valid, returns true, otherwise false.
◆ setDispatcher()
void kanzi::MessageArguments::setDispatcher |
( |
detail::MessageDispatcher * |
dispatcher | ) |
|
|
inline |
Sets a dispatcher for a message.
- Parameters
-
dispatcher | Message dispatcher that dispatches the message. |
◆ setType()
Sets the type of a message.
- Parameters
-
type | The type of the message. |
◆ getArgumentAllocatorPoolSize()
static size_t kanzi::MessageArguments::getArgumentAllocatorPoolSize |
( |
| ) |
|
|
static |
Gets the current size of memory pool of argument entries.
◆ getStaticMetaclass()
static const Metaclass* kanzi::MessageArguments::getStaticMetaclass |
( |
| ) |
|
|
static |
◆ makeEditorInfo()
Initializes and returns the Kanzi Studio editor information.
- Returns
- Editor information for Kanzi Studio.
The documentation for this class was generated from the following file: