+ /**
+ * Mode prefix or 0. If this is defined, you should
+ * also implement GetPrefixRank() to return an integer
+ * value for this mode prefix.
+ */
+ inline char GetPrefix() const { return prefix; }
+ /**
+ * Get the 'value' of this modes prefix.
+ * determines which to display when there are multiple.
+ * The mode with the highest value is ranked first. See the
+ * PrefixModeValue enum and Channel::GetPrefixValue() for
+ * more information.
+ */
+ virtual unsigned int GetPrefixRank();
+ /**
+ * Returns the mode's type
+ */
+ inline ModeType GetModeType() const { return m_type; }
+ /**
+ * Returns the mode's parameter translation type
+ */
+ inline TranslateType GetTranslateType() const { return m_paramtype; }
+ /**
+ * Returns true if the mode can only be set/unset by an oper
+ */
+ inline bool NeedsOper() const { return oper; }
+ /**
+ * Returns the number of parameters for the mode. Any non-zero
+ * value should be considered to be equivalent to one.
+ * @param adding If this is true, the number of parameters required to set the mode should be returned, otherwise the number of parameters required to unset the mode shall be returned.
+ * @return The number of parameters the mode expects
+ */
+ int GetNumParams(bool adding);
+ /**
+ * Returns the mode character this handler handles.
+ * @return The mode character
+ */
+ inline char GetModeChar() { return mode; }
+
+ /** For user modes, return the current parameter, if any
+ */
+ virtual std::string GetUserParameter(User* useor);
+
+ /**
+ * Called when a channel mode change access check for your mode occurs.
+ * @param source Contains the user setting the mode.
+ * @param channel contains the destination channel the modes are being set on.
+ * @param parameter The parameter for your mode. This is modifiable.
+ * @param adding This value is true when the mode is being set, or false when it is being unset.
+ * @return allow, deny, or passthru to check against the required level
+ */
+ virtual ModResult AccessCheck(User* source, Channel* channel, std::string ¶meter, bool adding);
+
+ /**
+ * Called when a mode change for your mode occurs.
+ * @param source Contains the user setting the mode.
+ * @param dest For usermodes, contains the destination user the mode is being set on. For channelmodes, this is an undefined value.
+ * @param channel For channel modes, contains the destination channel the modes are being set on. For usermodes, this is an undefined value.
+ * @param parameter The parameter for your mode, if you indicated that your mode requires a parameter when being set or unset. Note that
+ * if you alter this value, the new value becomes the one displayed and send out to the network, also, if you set this to an empty string
+ * but you specified your mode REQUIRES a parameter, this is equivalent to returning MODEACTION_DENY and will prevent the mode from being
+ * displayed.
+ * @param adding This value is true when the mode is being set, or false when it is being unset.
+ * @return MODEACTION_ALLOW to allow the mode, or MODEACTION_DENY to prevent the mode, also see the description of 'parameter'.
+ */
+ virtual ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); /* Can change the mode parameter as its a ref */
+ /**
+ * If your mode is a listmode, then this method will be called for displaying an item list, e.g. on MODE \#channel +modechar
+ * without any parameter or other modes in the command.
+ * @param user The user issuing the command
+ * @param channel The channel they're requesting an item list of (e.g. a banlist, or an exception list etc)
+ */
+ virtual void DisplayList(User* user, Channel* channel);
+
+ /** In the event that the mode should be given a parameter, and no parameter was provided, this method is called.
+ * This allows you to give special information to the user, or handle this any way you like.
+ * @param user The user issuing the mode change
+ * @param dest For user mode changes, the target of the mode. For channel mode changes, NULL.
+ * @param channel For channel mode changes, the target of the mode. For user mode changes, NULL.
+ */
+ virtual void OnParameterMissing(User* user, User* dest, Channel* channel);
+
+ /**
+ * If your mode is a listmode, this method will be called to display an empty list (just the end of list numeric)
+ * @param user The user issuing the command
+ * @param channel The channel tehy're requesting an item list of (e.g. a banlist, or an exception list etc)
+ */
+ virtual void DisplayEmptyList(User* user, Channel* channel);
+
+ /**
+ * If your mode needs special action during a server sync to determine which side wins when comparing timestamps,
+ * override this function and use it to return true or false. The default implementation just returns true if
+ * theirs < ours. This will only be called for non-listmodes with parameters, when adding the mode and where
+ * theirs == ours (therefore the default implementation will always return false).
+ * @param their_param Their parameter if the mode has a parameter
+ * @param our_param Our parameter if the mode has a parameter
+ * @param channel The channel we are checking against
+ * @return True if the other side wins the merge, false if we win the merge for this mode.
+ */
+ virtual bool ResolveModeConflict(std::string &their_param, const std::string &our_param, Channel* channel);