kanzi::FocusManager::PreFocusMessageArguments Class Reference

Message arguments for the pre-focus messages. More...

#include <kanzi/core.ui/input/focus_manager.hpp>

Inheritance diagram for kanzi::FocusManager::PreFocusMessageArguments:
kanzi::FocusManager::PostFocusMessageArguments kanzi::MessageArguments

Public Member Functions

void setAccepted (bool accepted)
 Sets the acceptance status. More...
 
bool isAccepted () const
 Returns the focus acceptance status. More...
 
- Public Member Functions inherited from kanzi::FocusManager::PostFocusMessageArguments
FocusManager::FocusReason getFocusReason () const
 Returns the stored value for the focus reason. More...
 
void setFocusReason (FocusManager::FocusReason reason)
 Sets the focus reason value. More...
 
- Public Member Functions inherited from kanzi::MessageArguments
 MessageArguments ()
 
 MessageArguments (AbstractMessageType messageType)
 
 ~MessageArguments ()
 
template<typename TDataType >
TDataType getArgument (const PropertyType< TDataType > &argumentType) const
 
bool getAbstractArgument (AbstractPropertyType argumentType, Variant &variant) const
 
template<typename TDataType >
void setArgument (const PropertyType< TDataType > &argumentType, typename PropertyType< TDataType >::DataType value)
 
void setAbstractArgument (AbstractPropertyType argumentType, const Variant &variant)
 
bool isFrom (const Node &source) const
 
shared_ptr< NodegetSource () const
 
void setHandled (bool handled)
 
bool isHandled () const
 
chrono::milliseconds getTimestamp () const
 
KzuMessageDispatchergetDispatcher () const
 
AbstractMessageType getType () const
 
void setSource (Node *source)
 
void setTimestamp (chrono::milliseconds timestamp)
 
void setValid (bool valid)
 
bool isValid () const
 
void setDispatcher_internal (KzuMessageDispatcher *dispatcher)
 Internal function. More...
 
void setType_internal (AbstractMessageType type)
 Internal function. More...
 

Static Public Attributes

Properties

The property that holds the state of the pre-focus message acceptance.

If the value is true, the pre-focus step is accepted, otherwise the focus move is rejected. Defaults to true.

See also
setAccepted(), isAccepted();
static PropertyType< bool > AcceptFocusProperty
 
- Static Public Attributes inherited from kanzi::FocusManager::PostFocusMessageArguments
static PropertyType< int > FocusReasonProperty
 

Additional Inherited Members

- Static Public Member Functions inherited from kanzi::MessageArguments
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 

Detailed Description

Message arguments for the pre-focus messages.

These arguments hold the information for the reason of the focus change and the acceptance flag.

Member Function Documentation

void kanzi::FocusManager::PreFocusMessageArguments::setAccepted ( bool  accepted)

Sets the acceptance status.

By default the pre-focus messages are in accepted state. You need to call this method if you want to deny the focus move.

Parameters
acceptedThe new acceptance status.
// Reject losing focus when Tab or Backtab navigation reason is received.
static void allowLosingFocusOnOtherReason(FocusManager::PreFocusMessageArguments& arguments)
{
if (arguments.getFocusReason() != FocusManager::OtherFocusReason)
{
arguments.setAccepted(false);
arguments.setHandled(true);
}
}
// Allow getting focus when focus chain navigation reason is received.
static void allowGainingFocusOnFocusNavigation(FocusManager::PreFocusMessageArguments& arguments)
{
if (arguments.getFocusReason() != FocusManager::FocusChainNavigationReason)
{
arguments.setAccepted(false);
arguments.setHandled(true);
}
}
bool kanzi::FocusManager::PreFocusMessageArguments::isAccepted ( ) const

Returns the focus acceptance status.

Member Data Documentation

PropertyType<bool> kanzi::FocusManager::PreFocusMessageArguments::AcceptFocusProperty
static

The documentation for this class was generated from the following file: