![]() |
LeechCraft 0.6.70-14794-g33744ae6ce
Modular cross-platform feature rich live environment.
|
Standard implementation of IHookProxy. More...
#include "defaulthookproxy.h"
Public Member Functions | |
DefaultHookProxy ()=default | |
Creates a new hook proxy. | |
DefaultHookProxy (QMap< QByteArray, QVariant > values) | |
Creates a new hook proxy, initialized with the given values. | |
void | CancelDefault () override |
Reimplemented from IHookProxy::CancelDefault(). | |
bool | IsCancelled () const |
Returns whether the default implementation is canceled. | |
const QVariant & | GetReturnValue () const override |
Reimplemented from IHookProxy::GetReturnValue(). | |
void | SetReturnValue (const QVariant &) override |
Reimplemented from IHookProxy::SetReturnValue(). | |
template<typename T > | |
void | FillValue (const QByteArray &name, T &val) |
Fills the value of the given parameter set by SetValue(). | |
QVariant | GetValue (const QByteArray &) const override |
Reimplemented from IHookProxy::GetValue(). | |
void | SetValue (const QByteArray &, const QVariant &) override |
Reimplemented from IHookProxy::SetValue(). | |
![]() | |
virtual | ~IHookProxy () |
virtual void | CancelDefault ()=0 |
Cancels default handler of the event. | |
virtual const QVariant & | GetReturnValue () const =0 |
Returns the current "return value" of this hook call chain. | |
virtual void | SetReturnValue (const QVariant &value)=0 |
Sets the "return value" of this hook chain. | |
virtual QVariant | GetValue (const QByteArray &name) const =0 |
Returns the value of the given parameter. | |
virtual void | SetValue (const QByteArray &name, const QVariant &value)=0 |
Updates the value of the given parameter. | |
Standard implementation of IHookProxy.
This class is the standard implementation of the IHookProxy interface and can be used in most cases.
Definition at line 25 of file defaulthookproxy.h.
|
default |
Creates a new hook proxy.
|
explicit |
Creates a new hook proxy, initialized with the given values.
[in] | values | The initial values of this proxy's parameters. |
Definition at line 13 of file defaulthookproxy.cpp.
|
overridevirtual |
Reimplemented from IHookProxy::CancelDefault().
Implements LC::IHookProxy.
Definition at line 18 of file defaulthookproxy.cpp.
|
inline |
Fills the value of the given parameter set by SetValue().
If SetValue() has been called with the given parameter name this function sets val to that value, otherwise it does nothing.
[in] | name | The name of the parameter. |
[out] | val | The value to fill. |
T | The type of the value, which should be known to Qt's metatypes system so that QVariant::value<T>() is valid. |
Definition at line 82 of file defaulthookproxy.h.
|
overridevirtual |
Reimplemented from IHookProxy::GetReturnValue().
Implements LC::IHookProxy.
Definition at line 28 of file defaulthookproxy.cpp.
|
overridevirtual |
Reimplemented from IHookProxy::GetValue().
Implements LC::IHookProxy.
Definition at line 38 of file defaulthookproxy.cpp.
bool LC::Util::DefaultHookProxy::IsCancelled | ( | ) | const |
Returns whether the default implementation is canceled.
This function returns whether CancelDefault() has been called at least once.
Definition at line 23 of file defaulthookproxy.cpp.
|
overridevirtual |
Reimplemented from IHookProxy::SetReturnValue().
Implements LC::IHookProxy.
Definition at line 33 of file defaulthookproxy.cpp.
|
overridevirtual |
Reimplemented from IHookProxy::SetValue().
Implements LC::IHookProxy.
Definition at line 43 of file defaulthookproxy.cpp.