1.1 --- a/core/interfaces/IRootConsoleMenu.h Fri Jan 19 05:25:43 2007 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,90 +0,0 @@
1.4 -#ifndef _INCLUDE_SOURCEMOD_ROOT_CONSOLE_MENU_H_
1.5 -#define _INCLUDE_SOURCEMOD_ROOT_CONSOLE_MENU_H_
1.6 -
1.7 -/**
1.8 - * @brief Note: This interface is not exposed.
1.9 - * The reason should be obvious: we do not want users touching the "root" console menu.
1.10 - * If we exposed this, every little plugin would be dropping down a silly set of user commands,
1.11 - * whereas this menu is explicitly provided for stuff that only Core itself is capable of managing.
1.12 - */
1.13 -
1.14 -namespace SourceMod
1.15 -{
1.16 - /**
1.17 - * @brief Handles a root console menu action.
1.18 - */
1.19 - class IRootConsoleCommand
1.20 - {
1.21 - public:
1.22 - virtual void OnRootConsoleCommand(const char *command, unsigned int argcount) =0;
1.23 - };
1.24 -
1.25 - /**
1.26 - * @brief Manages the root console menu - the "sm" command for servers.
1.27 - */
1.28 - class IRootConsole
1.29 - {
1.30 - public:
1.31 - /**
1.32 - * @brief Adds a root console command handler. The command must be unique.
1.33 - *
1.34 - * @param cmd String containing the console command.
1.35 - * @param text Description text.
1.36 - * @param pHandler An IRootConsoleCommand pointer to handle the command.
1.37 - * @return True on success, false on too many commands or duplicate command.
1.38 - */
1.39 - virtual bool AddRootConsoleCommand(const char *cmd, const char *text, IRootConsoleCommand *pHandler) =0;
1.40 -
1.41 - /**
1.42 - * @brief Removes a root console command handler.
1.43 - *
1.44 - * @param cmd String containing the console command.
1.45 - * @param pHandler An IRootConsoleCommand pointer for verification.
1.46 - * @return True on success, false otherwise.
1.47 - */
1.48 - virtual bool RemoveRootConsoleCommand(const char *cmd, IRootConsoleCommand *pHandler) =0;
1.49 -
1.50 - /**
1.51 - * @brief Prints text back to the console.
1.52 - *
1.53 - * @param fmt Format of string.
1.54 - * @param ... Format arguments.
1.55 - */
1.56 - virtual void ConsolePrint(const char *fmt, ...) =0;
1.57 -
1.58 - /**
1.59 - * @brief Returns the string of an argument.
1.60 - *
1.61 - * @param argno The index of the argument.
1.62 - * @return A string containing the argument, or nothing if invalid.
1.63 - */
1.64 - virtual const char *GetArgument(unsigned int argno) =0;
1.65 -
1.66 - /**
1.67 - * @brief Returns the number of arguments.
1.68 - *
1.69 - * @return Number of arguments.
1.70 - */
1.71 - virtual unsigned int GetArgumentCount() =0;
1.72 -
1.73 - /**
1.74 - * @brief Returns the entire argument string.
1.75 - *
1.76 - * @return String containing all arguments.
1.77 - */
1.78 - virtual const char *GetArguments() =0;
1.79 -
1.80 - /**
1.81 - * @brief Draws a generic command/description pair.
1.82 - * NOTE: The pair is currently four spaces indented and 16-N spaces of separation,
1.83 - * N being the length of the command name. This is subject to change in case we
1.84 - * account for Valve's font choices.
1.85 - *
1.86 - * @param option String containing the command option.
1.87 - * @param description String containing the command description.
1.88 - */
1.89 - virtual void DrawGenericOption(const char *cmd, const char *text) =0;
1.90 - };
1.91 -};
1.92 -
1.93 -#endif //_INCLUDE_SOURCEMOD_ROOT_CONSOLE_MENU_H_