diff options
author | Sebastien Braun | 2010-10-05 15:26:13 +0200 |
---|---|---|
committer | Sebastien Braun | 2010-10-05 18:15:50 +0200 |
commit | e3dcd9bc390bab4e650ec5bcbc1720cdcdea0247 (patch) | |
tree | 678e7c946d3b1e9c3ce4f12aef6c8149dd12d6b2 /src/input | |
parent | Add Permission checking and session information code. (diff) | |
download | pvs-e3dcd9bc390bab4e650ec5bcbc1720cdcdea0247.tar.gz pvs-e3dcd9bc390bab4e650ec5bcbc1720cdcdea0247.tar.xz pvs-e3dcd9bc390bab4e650ec5bcbc1720cdcdea0247.zip |
Add description to input event handlers so they can
Diffstat (limited to 'src/input')
-rw-r--r-- | src/input/inputEventHandler.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/input/inputEventHandler.h b/src/input/inputEventHandler.h index a0ada2e..44713c2 100644 --- a/src/input/inputEventHandler.h +++ b/src/input/inputEventHandler.h @@ -18,6 +18,9 @@ #define INPUTEVENTHANDLER_H_ #include <QtGlobal> +#include <QList> +#include <QString> +#include <QCoreApplication> #include <boost/mpl/contains.hpp> #include <boost/mpl/if.hpp> #include <boost/mpl/vector.hpp> @@ -57,6 +60,12 @@ template<quint16 Type = HANDLER_TYPE_DONT_CARE, quint16 Code = HANDLER_CODE_DONT_CARE, quint32 Value = HANDLER_VALUE_DONT_CARE> class DefaultInputEventHandler { +protected: + static QString tr(char const* string) + { + return QCoreApplication::translate("InputEventHandler", string); + } + public: virtual bool matches(InputEvent const& evt, InputEventContext const*) { if(Type != HANDLER_TYPE_DONT_CARE) { @@ -160,6 +169,11 @@ public: delegate.initialize(); } + static void describeInto(QList<SpecialInputEventDescription>& list) + { + Delegate::describeInto(list); + } + private: Delegate delegate; SecurityPolicy securityPolicy; @@ -176,6 +190,10 @@ public: void initialize() { } + + static void describeInto(QList<SpecialInputEventDescription>&) + { + } }; template<typename Delegate, typename SystemPolicy = policy::RequireNoSystem, typename SecurityPolicy = policy::Security<> > @@ -206,6 +224,18 @@ public: _handler.initialize(); _next.initialize(); } + + static void describeInto(QList<SpecialInputEventDescription>& list) + { + handler_type::describeInto(list); + next_in_chain::describeInto(list); + } + + static QList<SpecialInputEventDescription> describe() + { + QList<SpecialInputEventDescription> list; + describeInto(list); + return list; } }; @@ -219,6 +249,16 @@ struct InputEventHandlerChainHelper<End, End> void initialize() { // do nothing } + + static void describeInto(QList<SpecialInputEventDescription>&) + { + // do nothing + } + + static QList<SpecialInputEventDescription> describe() + { + return QList<SpecialInputEventDescription>(); + } }; template<typename Collection> |