diff options
-rw-r--r-- | include/mode.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/mode.h b/include/mode.h index 568c55038..dd5334c66 100644 --- a/include/mode.h +++ b/include/mode.h @@ -86,6 +86,7 @@ enum ParamSpec class PrefixMode; class ListModeBase; +class ParamModeBase; /** Each mode is implemented by ONE ModeHandler class. * You must derive ModeHandler and add the child class to @@ -108,6 +109,7 @@ class CoreExport ModeHandler : public ServiceProvider { MC_PREFIX, MC_LIST, + MC_PARAM, MC_OTHER }; @@ -192,6 +194,12 @@ class CoreExport ModeHandler : public ServiceProvider ListModeBase* IsListModeBase(); /** + * Check whether this mode handler inherits from ListModeBase + * @return non-NULL if this mode handler inherits from ParamModeBase, NULL otherwise + */ + ParamModeBase* IsParameterMode(); + + /** * Returns the mode's type */ inline ModeType GetModeType() const { return m_type; } @@ -716,3 +724,8 @@ inline ListModeBase* ModeHandler::IsListModeBase() { return (this->type_id == MC_LIST ? reinterpret_cast<ListModeBase*>(this) : NULL); } + +inline ParamModeBase* ModeHandler::IsParameterMode() +{ + return (this->type_id == MC_PARAM ? reinterpret_cast<ParamModeBase*>(this) : NULL); +} |