summaryrefslogtreecommitdiff
path: root/include/mode.h
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-02-15 13:51:35 +0100
committerAttila Molnar <attilamolnar@hush.com>2014-02-15 13:51:35 +0100
commit88baaf9e68efd9824b906a69320053734d408e14 (patch)
tree3843103118dbb43c99739e174fd4318000f2a558 /include/mode.h
parent8bdc2313a66bc200e7067e01159367f48571fef9 (diff)
Add ModeHandler::IsParameterMode() and MC_PARAM
Diffstat (limited to 'include/mode.h')
-rw-r--r--include/mode.h13
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);
+}